Skip to content

Commit

Permalink
Update the template
Browse files Browse the repository at this point in the history
  • Loading branch information
koistya committed Apr 26, 2018
1 parent 459c58a commit 7657c2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/react-app-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-app-tools",
"version": "2.0.0",
"version": "2.0.2",
"description": "Build and test tooling for web application development with Node.js and React.",
"repository": "kriasoft/react-app",
"author": "Kriasoft <hello@kriasoft.com> (https://www.kriasoft.com)",
Expand Down Expand Up @@ -39,8 +39,8 @@
"react-app": "./bin/react-app.js"
},
"dependencies": {
"@babel/core": "7.0.0-beta.38",
"@babel/runtime": "7.0.0-beta.38",
"@babel/core": "7.0.0-beta.41",
"@babel/runtime": "7.0.0-beta.41",
"autoprefixer": "7.2.5",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.2.1",
Expand Down
7 changes: 3 additions & 4 deletions packages/react-app-tools/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ module.exports = function(

// Setup the script rules
appPackage.scripts = {
start: 'react-scripts start',
build: 'react-scripts build',
test: 'react-scripts test --env=jsdom',
eject: 'react-scripts eject',
start: 'react-app start',
build: 'react-app build',
test: 'react-app test --env=jsdom',
};

appPackage.browserslist = defaultBrowsers;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-app-tools/template/src/app.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import './index.css';
import App from './components/App';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.hydrate(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
Expand Down
5 changes: 2 additions & 3 deletions packages/react-app-tools/template/src/app.node.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const path = require('path');
const express = require('express');
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const App = require('./components/App');
const App = require('./components/App').default;
const assets = require('./assets.json');

const app = express();
Expand All @@ -12,7 +11,7 @@ app.get('*', (req, res) => {
<html>
<body>
<div id="root">${ReactDOMServer.renderToString(<App />)}</div>
${assets.map(src => `<script src="${src}"></script>`)}
${assets.main.map(src => `<script src="${src}"></script>`)}
</body>
</html>
`);
Expand Down

0 comments on commit 7657c2a

Please sign in to comment.