97 points · by judofyr · 9y ago · 30 comments
If the performance profile is as asserted "From a hot cache, mrmanager is capable of executing React (with ReactDOM) in 9ms instead of SystemJS' 150ms.", I and many others would likely benefit from making the loader open source
I've been working some time on a web playground ( https://flems.io ). It is based on an open source single file module (https://github.com/porsager/flems) that anyone can use to make a live showcase for their documentation / examples and what not. Flems.io simply uses unpkg.com directly. Unpkg.com does it's own resolution by first looking for an `unpkg` field, then `browser` and last `main` in package.json. This works great since most browser packages also comes with a browser distribution. If the package doesn't point to a browser compatible bundle you can always go directly to a working one, like in the case of react, which would be used like this: https://goo.gl/b4546q
For example if adding a URL on https://flems.io it will store the xhr.responseURL to take advantage of this to pin the version. I would guess guess Scrimba does something similar?
You'd want to load it dynamically over the network? That sounds like a very bad plan (tying your app uptime to the one of the NPM servers).