-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ADD browserify support #137
Conversation
I was getting the browserify parse error: "ParseError: 'import' and 'export' may appear only with 'sourceType: module'" and this fixed it! thanks. |
yes - i think this pull request fixes that error. I hope it gets merged soon, |
@ChisholmKyle thx. i found https://www.npmjs.com/package/dat.gui but it seems it's quite outdated Can a release be cut? npm only has version 0.6.1 but on github it's 0.6.5... I would like to use this change in production. |
the tools added by @serapath should most likely be |
hey :-) If you install a dependency which has a dependency which has a dependency which uses a transform... would you expect your your project to break when you try to run something like I agree with the theoretic thought, that something that isn't explicitly required by your project should probably be a dev dependency... but then again, i tend to not care how things are called, but what they do. so It's nice that ppl make up theories (e.g optional dependencies), but they figure out it was a mistake and they deprecate or remove or use them differently than was once intended... If you have a better idea, how would you get around the potential problem of arcane error messages - or even if not arcane - then the need to install maybe a few or even half a dozen depdencies manually using these days, so many ppl put some unnecessary ES6 into their modules |
@serapath Let's be a bit more specific here to avoid confusion.
It doesn't use the transform. Also, I consider transpiling code a build step, therefore it should be a |
hm, maybe i'm misunderstanding something. ...but if i type If the project ...and this will or might happen to many modules in my dependency tree - especially if they use ES6. I am basically forced to run transforms globally and apply them to every single module in my dependency tree - which is slow and sometimes dangerous (maybe it breaks stuff) and i would like to avoid that using maybe there is a trick to get them to install without putting them in Maybe i'm completely wrong here. Haven't tried in a while, but the last time i did i remember an |
correct. I agree with you that the situation about transpiling dependencies is tricky. This is my opinion:
|
I also consider it a build step. Also - i feel it's wrong to apply "transforms" to every dependency in the dependency tree, which seems to make it slower then necessary and introduces unnecessary risk of breaking things, by applying transforms to stuff that was never meant to have a certain transform applied. So yeah... i dont know. I kind of feel it's slowly time to have an in-browser Can't wait for that to happen and then i might slowly leave the terminal and live only inside browser environments and work on bringing browser environments closer to the metal (thus - a minimal kernel with just some kind of browser environment on top) ..so all apps and all everything lives inside a browser like environment. ....boot from html file :P |
What I meant with "build step" is that npm packages should be published in a transpired form, not transpiled in a build of the consuming package. |
i'm not sure. i don't agree with that. For which platform would you build? The newest browsers support many features, so should they use. So should they use the built form which turns ES6 into ES5 and add some other changes even though they support ES6? What about minification? During dev i would like to be able to step through dependency code if necessary and only minify it when i need it. So you say you would set the |
In my opinion, it makes sense to have a If you want to generate additional ES6 bundles for modern browsers (you should generate ES5 bundles anyway to not lock people out), you can do so by configuring your bundler.
That is a different question. During dev, using a modern browser, you wouldn't bundle the code from |
Similar proposal: http://2ality.com/2017/04/transpiling-dependencies-babel.html |
Latest release (0.6.5) is now on npm. Let us know if there are any issues with this, thanks! |
for each dependency, browserify only executes transforms that dependency needs.
This speeds up the process a lot, because transforms don't get executed globally on all dependencies.
Therefore each dependency needs to list it's required transforms and make them install so a module that uses that dependency can execute the pipeline and all required transforms have been installed :-)
Would be really nice if this could be merged. thx ;-)