Open rvagg opened 11 years ago
agreed. my favorite bits of browserify are mostly the ability to bundle node native modules.
+1
Check this out: https://github.com/rvagg/nodei.co/blob/master/browser-lib/ender.js - compiled by browserify and used here: https://github.com/rvagg/nodei.co/blob/master/browser-lib/index.js#L1
Best of both worlds, slightly awkward but it works... Just need to automate it I spoze.
I'm gonna take a look at doing this when I have some free time.
Personally, I'd rather see Ender upgrade it's own module system. I've gotten back to work on updating my previous work on this front to the current, modularized version of Ender. It's going well, and it would bring the ability to have multi-file modules, relative requires, and better common-js semantics.
I don't really see the argument for using Browserify through Ender. What is Ender really bringing to the table in that case other than compatibility with existing Ender modules? Why not just port those modules to Browserify instead?
What appeals to me about Ender is that the resulting builds are simple, readable and predictable. I feel like using Browserify negates those advantages.
@amccollum I hear you and mostly agree; the big problem I have is that browserify is getting a lot of dev attention and Ender is not. I don't have time to maintain the Ender internals myself and I'm not even doing enough frontend work at the moment. The idea behind using browserify is to piggyback the dev effort that's going in there while maintaining the additional sugar that Ender brings to the table -- in particular, managing a lot of the npm stuff and being able to add/remove/rebuild etc.
Unless you're managing to find some extra time upgrade and maintain the Ender internals, or someone else steps up to the plate, I don't see a better alternative.
Just consider; browserify has nice sourcemaps support, that's maintained and used by many devs. There's transforms that can do lots of neat stuff--like convert 'const' to 'var' (one of my favourite trivial transforms!). We're not going to get around to these things.
I have an immediate need for the sourcemaps & some of the transforms. Will be moving forward on this asap.
Now that ender@2.0.0
is out, I'd like to use this issue to ask if people have urgent needs that Browserify solves but Ender still doesn't. Ender now has much better support for CommonJS modules (due to the new package handling) and generates source maps. It sounds like transforms
might be a good candidate to add and would probably be pretty simple to do.
I'm toying with the idea of replacing some of the back-end bundling code with browserify, or parts of browserify at least. As far as bundling Node-style code, browserify is getting quite a bit of love and can already do a lot of things we want the Ender CLI to be able do so perhaps we should just leverage what they already do?