Browser compatible bower build
blainekasten opened this issue · 6 comments
Given that bower is used for front-end package management. What are your thoughts on making a browserified build and have the bower.json set the main to that file?
I'm currently trying to use this with bower_rails which when using ftdomdelegate, errors out due to the module
.
My only options currently is to download the build code, or try and mangle browserify into the ftdomdelegate in the bower rails loading.
If this is something you're interested in, I'll totally do the labor to make it happen.
I use it with bower every day… bower+browserify*+debowerify but I do sympathise with people who just want to download & use the code.
* soon to be webpack.
In this case as this module doesn't have any dependencies and is only split over two files I'd be pretty relaxed about combining the two files and adding UMD. The hardest bit would be probably updating the documentation!
Something like:-
- Update
package.json
&bower.json
to pointmain
atlib/delegate.js
- Move logic from
index.js
intolib/delegate.js
- Add UMD (my preference is @wilsonpage -style (which I used in denodeify but not against alternatives if you think another is better.))
- In
README.md
ditch references to build service and just point at the file directly. - Simplify the build process*
- Make sure tests are OK.
Definitely wouldn't expect you to do this all but if you wanted to get it working to the point where you app is happy with it on a fork I can pick it up from there and do some of the tidying up?
(* Note to self: eventually ditch grunt-browserify, ditch grunt, ditch grunt-jshint, ditch uglify => things can be so much simpler => wait this will make the tests way simpler too. nice)
Word. This sounds good. I'll definitely fork and get it as far as I need it.
So, working through this I've got it mostly done. However, if I load the file in node. It freaks out about Element
not being defined (cause it isn't in Node). Feel free to call me an idiot, but is there any use to this library in Node? I don't use node ever, but there is no DOM tree to bind listeners and such too, right?
It shouldn't be used in node. The package.json is there for Browserify.
#66 PR up. All tests still pass, though I didn't write tests for the changes to be UMD compatible. Do we want tests for that?
Thanks for opening this blainekasten. Closing this as we don't have plans to publish bundled versions of Origami-maintained components currently, and it's no longer needed.