Giter Site home page Giter Site logo

es6 workflow about jspm-cli HOT 4 CLOSED

guybedford avatar guybedford commented on August 14, 2024
es6 workflow

from jspm-cli.

Comments (4)

guybedford avatar guybedford commented on August 14, 2024

The best workflow here really is to share ES6 code as-is.

We assemble all the modules together in development, using SystemJS to load Traceur dynamically for compilation.

Then we do one single build at the end.

The big shift here would be moving towards sharing uncompiled code. Which moves away from the messy situation of half-builds at the moment.

from jspm-cli.

briandipalma avatar briandipalma commented on August 14, 2024

I was wondering about this myself.

Surely there is some overhead to compiling to ES5 on each browser refresh while developing?
I've yet to build a large application with the "compile to ES5 on the fly" approach so I might be wrong here. I was going to try and benchmark that approach to see what the overhead would be.

The workflow you are suggesting is

  • use a package manager to assemble your application packages, most of them being written in ES6.
  • load them all in with SystemJS and use traceur to compile them to ES5 on the fly and develop like that?

from jspm-cli.

guybedford avatar guybedford commented on August 14, 2024

Performance testing for this workflow would be very interesting indeed.

There is no single workflow for ES6 yet. We're still working things out. You do have to consider the implications of whatever approach you take for a project.

For example, I can compile some ES6 statically only using features from https://github.com/square/esnext. Perhaps leave in the ES6 module syntax to maintain support for bindings and circular references. If performance worries you, compile the ES6 module syntax into anonymous System.register([], function(){}) at this point already. Perhaps even compile into AMD or CommonJS.

The fact is that we can consume all of the above. If ES6 modules are used, they get interpreted. If other ES6 syntax is present this is parsed by Traceur.

So there is a kind of static -> dynamic compilation gradient here, and you can really pick and choose where to do what. For example if you don't want Traceur runtime, perhaps compile all the runtime-based features using esnext static compilers (eg regenerator), then only do module syntax, arrow functions and block scoping in the dynamic compilation.

I hope that makes some sense... it really is an open book.

from jspm-cli.

guybedford avatar guybedford commented on August 14, 2024

This is kind of an ongoing thing, and I think we have to let the best strategies evolve. Closing for now.

from jspm-cli.

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.