Comments (6)
Hi, I think is off topic. But
When using "piping" + "babel/register" in my project,
The dev server restart (for about 0.5 to 1 second) after every changes that we make.
I think that is because piping "hot" reloading and babel slow compilation?
Will this make the compilation even slower?
from react-isomorphic-starterkit.
0.5 to 1 second is considered fast, for restarting node server-side :) "babel/register" allows us to write modern Javascript (ES5/6/7) and Babel Typecheck will allow static + runtime type checking, which prevents an entire class of bugs. So it's worth it. But you can turn it off.
Also, perhaps I should bring back the production build for the server, so Babel-transformations are pre-compiled for production.
from react-isomorphic-starterkit.
@ericfong Do you think webpack hot-loading for the server (https://github.com/webpack/hot-node-example) would be a faster solution?
from react-isomorphic-starterkit.
The problem of "piping" + "babel/register":
Step 1: file changed
2: restart
3: compile
4: finally can be used
If webpack way:
Step 1: file changed
2: compile
3: restart after compile (browser HMR is like that, not sure about server)
4: Can be used
Pros: faster?
Cons: stack trace is ... the friend of flux (fuXk)
Personally, I prefer faster.
SourceMap for node?
By the way, I use babel for jsx only. I am using iojs 2.0.
We only use es6 syntax that support natively by iojs.
from react-isomorphic-starterkit.
I'll have to experiment with server-side HMR. Never done that before. If you have the time, a Pull Request is welcome :)
from react-isomorphic-starterkit.
On-topic: I added Babel Typecheck plugin. It works quite well for regular functions et cetera but unfortunately doesn't support some ES6 syntax (class methods) yet.
from react-isomorphic-starterkit.
Related Issues (20)
- hot reloading client side not working
- Timed out waiting for dist/*.js after 30 seconds HOT 2
- Internal Server Error when running npm run watch HOT 3
- React-router example
- Location object does not get passed to components server side.
- Had to downgrade to Node v5 for `npm run watch` to work HOT 4
- Images not loading in Webpack build
- Heroku deployment is not working simple express app
- 帅哥,服务端渲染的原理是什么?
- General questions about react-transmit usage within this kit HOT 2
- `Server-side React render was discarded` after migrating to express HOT 1
- Passing custom data (e.g. token) to props during server-side render HOT 1
- Nested containers (with getFragment) prevents server from rendering HOT 3
- npm run watch fails after update to webpack 2 HOT 1
- Doesn't work HOT 1
- Help? It fails to start
- All done but nothing works HOT 3
- Operand to 'typeid'
- not working HOT 2
- does not work out of the box
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-isomorphic-starterkit.