-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faster builds #1758
Faster builds #1758
Conversation
Awesome stuff. Maybe this change is alreday doing this, but I think the dev build should avoid bundling in lieu of something like https://github.com/ModuleLoader/es6-module-loader. The one (and perhaps only) thinkg the require.js build had going for it was granular level reloads. IMO it's the achilles heel of browserify. Questions on whitelist:
|
It isn't at the moment. I did try this some time ago and it was excruciatingly slow because you effectively need to do the same work in the client (i.e. the ES6 modules have to get converted to SystemJS, which involves a full-blown parse/transformation step, and I'm not sure that it's able to save any of that work between reloads), but with the added overhead of a few hundred requests (plus the extra code complexity). At this point I'm fairly convinced that the best route is to make esperanto smarter about not re-analysing modules, though I can be persuaded.
It's a bit unpredictable... it's on the whitelist (
More that we're just not using them at the moment, and a longer whitelist means a slower build. There are a few places it might be nice to use |
What I'm thinking is do the ES6 transpile and module on the server, but then do something like browserify external require to create individual files. Concat file names to a file of script tags (that can only run with files added remove). And then a do a shim |
I think I've actually broken the back of it - on my machine initial builds now take around 8 seconds, with rebuilds around ~1.5-2 seconds. Esperanto was indirectly slowing things down by generating a source mapping for every character. It now only generates mappings for the start of each AST node, which means a) the sourcemap is much smaller, b) the subsequent sorcery transformation is much quicker because it doesn't have hundreds of thousands of mappings to trace, but c) the mappings are still accurate down to the character rather than the line, unlike browserify :) There's still room for improvement but I don't think it's painful any more - I'll merge this in and close #1730 for now. |
See #1730. Not ready for merge, this is just to track progress. So far, this
Needs an
npm install
, obviously.