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
The smallest CanJS build is core.mjs, which includes model data, query logic, routing, and fixtures in addition to the web components-supporting parts. It's slightly over 100KB, minified + gzipped.
By contrast, Slim.js is under 4KB and hybrids is under 7KB (minified + gzipped). While we have better features than either of those, we are also up against React which is 41KB total for React and ReactDOM.
The reason why I bring this up is that if we want users to try our features for components, it's easier to make the case if they can see that adding our libraries will not incur much extra overhead (easier to show it with a file size than tell them how their production bundle might size up). It may be in our best interest, then, to give users who just want to do web components a small subset of our features in a mini rollup: StacheElement, types, bindings, Observables, and the infrastructure that would support them.
The text was updated successfully, but these errors were encountered:
Preliminary tests show that the savings in size is 35%. Exporting:
can-observable-object
can-observable-array
can-stache
can-stache-element
can-stache-bindings
can-dom-data
can-dom-events
{ MaybeBoolean, MaybeDate, MaybeNumber, MaybeString } from can-data-types
can-namespace
can-reflect
can-reflect-dependencies
can-reflect-promise
can-type
Gives a minified, gzipped file 68.8KB in size, about 65% of the size of core.mjs. It seems infeasible, then, to make CanJS for custom elements small enough to be an add-on library in another project.
Taking out stache, stache-element, and stache-bindings yields a bundle 27.5KB in size, so taken together the stache bits are more than half of the weight. It wouldn't be easy to un-bundle the bundle for a more complete breakdown.
The smallest CanJS build is core.mjs, which includes model data, query logic, routing, and fixtures in addition to the web components-supporting parts. It's slightly over 100KB, minified + gzipped.
By contrast, Slim.js is under 4KB and hybrids is under 7KB (minified + gzipped). While we have better features than either of those, we are also up against React which is 41KB total for React and ReactDOM.
The reason why I bring this up is that if we want users to try our features for components, it's easier to make the case if they can see that adding our libraries will not incur much extra overhead (easier to show it with a file size than tell them how their production bundle might size up). It may be in our best interest, then, to give users who just want to do web components a small subset of our features in a mini rollup: StacheElement, types, bindings, Observables, and the infrastructure that would support them.
The text was updated successfully, but these errors were encountered: