You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were originally going to integrate with NPM based on the BladeRunnerJS NPM Integration Strawman, which involved doing our bundling and using SystemJS as our module format. Then, we subsequently came to the conclusion that we could more quickly get something out there by relying on a third-party bundler to bundle a script that caused the various parts of the bundle to be made available via our current module system (browser-modules), as per the Alternative NPM Integration Strawman.
Unfortunately, this approach means that clients that don't want to or can't use NPM would be forced to bundle every part of every BRJS and CT library, effectively creating a hard dependency on Node.js since this is unlikely to be acceptable to anyone. While we could go back to the original approach, we've since realized that the alternate approach has some other advantages that are worth taking into consideration before we make a decision.
Here are the pertinent facts...
Bundle ourselves:
No hard dependency on Node.js.
Can only use System.js.
No source maps.
Requires more time (though we have a BRJS / SystemJS spike so some of the additional work is now done).
System.js is a sizable dependency (additional 17.5KB when minified and gzipped — see these twocomments).
No slower than current bundling.
Use external bundler:
Hard dependency on Node.js.
Can use any bundler.
Can use sourcemaps.
Quicker to implement.
Modules from Node.js bundle have to be re-exported using define() invocations, which adds additional size.
Maybe slower because there are two bundlers, one of which requires a process to be spawned (e.g. ~1sec to bundle react & redux — use the bundle-all-spike to calculate your own figures).
So, which option would people prefer us to go with?
UPDATE:@trueadm suggested a third option which is better than the previous two. The idea here is to convert NPM libraries into a form that BRJS can already consume. Exactly how this would be done, and whether this can be done in a way that would still allow CSS and HTML templates to be required, etc, is still to be determined, but it seems like a promising idea.
Use NPM to BRJS conversion tool:
No dependency on Node.js
No bundler required.
No sourcemap support.
Quick to implement.
No change to the bundled size.
No change to the bundle creation speed.
The text was updated successfully, but these errors were encountered:
Assuming it can be made to work, we've decided to go with #1611 since it has no downsides, but still allows us to start migrating our libraries to NPM.
We were originally going to integrate with NPM based on the BladeRunnerJS NPM Integration Strawman, which involved doing our bundling and using SystemJS as our module format. Then, we subsequently came to the conclusion that we could more quickly get something out there by relying on a third-party bundler to bundle a script that caused the various parts of the bundle to be made available via our current module system (browser-modules), as per the Alternative NPM Integration Strawman.
Unfortunately, this approach means that clients that don't want to or can't use NPM would be forced to bundle every part of every BRJS and CT library, effectively creating a hard dependency on Node.js since this is unlikely to be acceptable to anyone. While we could go back to the original approach, we've since realized that the alternate approach has some other advantages that are worth taking into consideration before we make a decision.
Here are the pertinent facts...
Bundle ourselves:
Use external bundler:
define()
invocations, which adds additional size.So, which option would people prefer us to go with?
UPDATE: @trueadm suggested a third option which is better than the previous two. The idea here is to convert NPM libraries into a form that BRJS can already consume. Exactly how this would be done, and whether this can be done in a way that would still allow CSS and HTML templates to be required, etc, is still to be determined, but it seems like a promising idea.
Use NPM to BRJS conversion tool:
The text was updated successfully, but these errors were encountered: