Partly functioning fuse-box, but moving te webpack now.
This commit is contained in:
parent
3125477c7b
commit
2eee936026
66 changed files with 19040 additions and 365 deletions
|
@ -1,10 +0,0 @@
|
|||
.text {
|
||||
color: brown;
|
||||
font-size: 25pt;
|
||||
}
|
||||
.count {
|
||||
color: blue;
|
||||
}
|
||||
.button {
|
||||
color: red;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
import 'jsdom-global/register';
|
||||
import { configure, mount, render, shallow } from 'enzyme';
|
||||
import InfernoEnzymeAdapter = require('enzyme-adapter-inferno');
|
||||
import { should } from 'fuse-test-runner';
|
||||
import { Component } from 'inferno';
|
||||
import { renderToSnapshot } from 'inferno-test-utils';
|
||||
import About from './About';
|
||||
configure({ adapter: new InfernoEnzymeAdapter() });
|
||||
|
||||
export class AboutTest {
|
||||
public 'Should be okay'() {
|
||||
const wrapper = mount(<About />);
|
||||
wrapper.find('.button').simulate('click');
|
||||
const countText = wrapper.find('.count').text();
|
||||
should(countText).beString().equal('1');
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
import { Component } from 'inferno';
|
||||
import './About.css';
|
||||
interface IState {
|
||||
clickCount: number;
|
||||
}
|
||||
interface IProps {}
|
||||
export default class About extends Component<IProps, IState> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
clickCount: 0,
|
||||
};
|
||||
this.increment = this.increment.bind(this);
|
||||
}
|
||||
protected increment() {
|
||||
this.setState({
|
||||
clickCount: this.state.clickCount + 1,
|
||||
});
|
||||
}
|
||||
public render() {
|
||||
return (
|
||||
<div>
|
||||
Simple Inferno SSR template
|
||||
<p className="text">Hello, world!</p>
|
||||
<button onClick={this.increment} className="button">
|
||||
Increment
|
||||
</button>
|
||||
<p className="count">{this.state.clickCount}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
import { Component, render } from 'inferno';
|
||||
import { Link, Route, StaticRouter, Switch } from 'inferno-router';
|
||||
import About from '../About/About';
|
||||
import Home from '../Home/Home';
|
||||
interface IState {}
|
||||
interface IProps {
|
||||
name: string;
|
||||
}
|
||||
export default class App extends Component<IProps, IState> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
public render() {
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<h3>{this.props.name}</h3>
|
||||
<div>
|
||||
<Link to="/Home">
|
||||
<p>Home</p>
|
||||
</Link>
|
||||
</div>
|
||||
<div>
|
||||
<Link to="/About" className="link">
|
||||
<p>About</p>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Switch>
|
||||
<Route exact path="/Home" component={Home} />
|
||||
<Route exact path="/About" component={About} />
|
||||
</Switch>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
import { Component } from 'inferno';
|
||||
interface IState {}
|
||||
interface IProps {}
|
||||
export default class Home extends Component<IProps, IState> {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
protected click() {
|
||||
/**
|
||||
* Try to debug next line
|
||||
*/
|
||||
console.log('hi');
|
||||
}
|
||||
public render() {
|
||||
return (
|
||||
<div>
|
||||
Home page
|
||||
<button onClick={this.click}>Click me</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import { Component } from 'inferno';
|
||||
import { hydrate } from 'inferno-hydrate';
|
||||
import { BrowserRouter } from 'inferno-router';
|
||||
import App from './components/App/App';
|
||||
import { initDevTools } from 'inferno-devtools';
|
||||
import { App } from '../shared/components/app';
|
||||
/* import { initDevTools } from 'inferno-devtools'; */
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
@ -14,8 +14,8 @@ declare global {
|
|||
|
||||
const wrapper = (
|
||||
<BrowserRouter>
|
||||
<App name={window.isoData.name} />
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
);
|
||||
initDevTools();
|
||||
/* initDevTools(); */
|
||||
hydrate(wrapper, document.getElementById('root'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue