Adding the r.js bundler using the requirejs and almond runtimes. #5

Merged
merged 1 commit into from Aug 20, 2016

Projects

None yet

3 participants

@ryanfitzer
Contributor

Also updated the concatenation of _markLoaded() and _markFinished() to make sure \n characters in require.js error messages aren't converted to new lines.

@ryanfitzer
Contributor

Here are the results:

Results including r.js

@nolanlawson
Owner

Wow, interesting stuff! Which browser did you run this on? Either way, very happy to merge.

I'm happy to see RequireJS do so well here; didn't realize it was so competitive with Browserify/Webpack. Hadn't heard of the Almond bundler, but perf-wise it seems pretty comparable to the default bundler?

@nolanlawson nolanlawson merged commit 815ce48 into nolanlawson:master Aug 20, 2016
@phated
phated commented Aug 20, 2016

Almond isn't a bundler. It's actually a shim that makes the final bundle behave more like browserify. It doesn't allow dynamic loads, etc. See https://github.com/requirejs/almond

@ryanfitzer
Contributor
ryanfitzer commented Aug 21, 2016 edited

Which browser did you run this on?

Chrome 52 on OS X, running from localhost.

I'm happy to see RequireJS do so well here; didn't realize it was so competitive with Browserify/Webpack.

I was expecting it to do better on file size. I had a hunch the runtime numbers would be good. Glad to finally have some evidence.

Hadn't heard of the Almond bundler, but perf-wise it seems pretty comparable to the default bundler?

As @phated commented, it's a paired down version of RequireJS. If your production bundle can be loaded with a regular<script src>, Almond is the way to go.

There's also Alameda. Pretty much the same as RequireJS, but didn't add it because it only supports IE10+ and assumes Promises are available. Although, I did test it and was surprised it didn't do better than RequireJS on runtime:

alameda

Again, thanks for putting this together!

@nolanlawson
Owner

Cool, I'd say Alameda is still interesting, since folks can drop in Promise shims to add IE<10 support. Seems like it doesn't offer a huge difference to almond/rjs, though.

@ryanfitzer
Contributor

I can add it, if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment