-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: feature freeze on wpackio/scripts
No more featured needed for v1. Let's focus on finishing up.
- Loading branch information
Showing
17 changed files
with
284 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"eslint.autoFixOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
console.log('Hello Mobile!!'); | ||
// Auto page load when HMR is not defined | ||
|
||
console.log('Hello Mobile!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function iAmGroot() { | ||
console.log('I am dynamic groot! With Hot reloading!😱💩'); | ||
console.log('I am dynamic groot! With Hot reloading!😱🐶'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export default function logger() { | ||
console.log('Load me 🤟🎉💥😜'); | ||
// Automatic Hot Module Replacement | ||
console.log('Load me 🤟🎉💥😜😺'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { hot } from 'react-hot-loader'; | ||
import Box from './components/Box'; | ||
import Todo from './components/Todo'; | ||
|
||
const App = () => ( | ||
<Box heading="Hello From React"> | ||
<p>I can be hot reloaded!</p> | ||
<p>Heres something of an app.</p> | ||
<h4>Todo App.!</h4> | ||
<Todo /> | ||
</Box> | ||
); | ||
|
||
export default hot(module)(App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
|
||
const Box = ({ heading, children }) => ( | ||
<div className="box"> | ||
<h2>{heading}</h2> | ||
<div className="box__content">{children}</div> | ||
</div> | ||
); | ||
|
||
export default Box; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
const List = ({ items }) => ( | ||
<ul> | ||
{items.map((item, index) => ( | ||
<li key={index}>{item}</li> | ||
))} | ||
</ul> | ||
); | ||
|
||
export default List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React, { Component } from 'react'; | ||
import List from './List'; | ||
|
||
export default class Todo extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
term: '', | ||
items: [], | ||
}; | ||
} | ||
|
||
onChange = event => { | ||
this.setState({ term: event.target.value }); | ||
}; | ||
|
||
onSubmit = event => { | ||
event.preventDefault(); | ||
this.setState(state => ({ | ||
term: '', | ||
items: [...state.items, state.term], | ||
})); | ||
}; | ||
|
||
render() { | ||
const { term, items } = this.state; | ||
return ( | ||
<div> | ||
<form className="App" onSubmit={this.onSubmit}> | ||
<input value={term} onChange={this.onChange} /> | ||
<button type="submit">Add+</button> | ||
</form> | ||
<List items={items} /> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import App from './App'; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
const entry = document.querySelector('#wpackio-reactapp'); | ||
render(<App />, entry); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.