Coder Social home page Coder Social logo

Comments (6)

ericfong avatar ericfong commented on June 17, 2024

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.

RickWong avatar RickWong commented on June 17, 2024

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.

RickWong avatar RickWong commented on June 17, 2024

@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.

ericfong avatar ericfong commented on June 17, 2024

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.

RickWong avatar RickWong commented on June 17, 2024

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.

RickWong avatar RickWong commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.