ember-sortable icon indicating copy to clipboard operation
ember-sortable copied to clipboard

2.2.0: massive bundle size increase

Open st-h opened this issue 5 years ago • 7 comments
trafficstars

Describe the bug The bundle size for 2.2.0-beta almost doubles compared to 2.1.3.

ember-cli-bundle-analyzer lists the following sizes added to vendor.js 5.4kb version 2.1.3 10.3kb version 2.2.0-beta

I think this is due to bundling the modifier version together with the non modifier version, even though both code paths are pretty much independent from each other.

For the 2.2.0 release it would be great if either both versions could be released separately, or the non-modifier version would be dropped in favour of the modifier version (which would also mean old ember versions would no longer be able to use the latest version of ember-sortable).

Keeping the current way of packaging would lead to unnecessary bloat of consuming ember apps, as always both versions of this addon will be included and will have to be parsed and compiled by the browser, which easily leads to performance issues especially on mobile.

st-h avatar Feb 10 '20 17:02 st-h

Note that this—

the non-modifier version would be dropped in favour of the modifier version (which would also mean old ember versions would no longer be able to use the latest version of ember-sortable)

—would definitely be a breaking change. That would require a 3.0. (Which is a good idea, just need to be clear about it!)

chriskrycho avatar Feb 10 '20 21:02 chriskrycho

This is expected as a tradeoff for supporting modifier. The goal is to keep modifier in beta until it's battled tested enough before we release 3.0.0 supporting only modifier.

2.2.0-beta.* is meant for battle testing both non-modifier and modifier. 3.0.0-beta will be for battle testing modifier-only.

I'm open to any better ideas.

ygongdev avatar Feb 10 '20 22:02 ygongdev

@ygongdev Thanks a lot for the clarification. Sometimes there are good reasons one should not try to add beta releases to production apps. 😬 Is the non modifier version going to be dropped, or will that continue as 2.x when the modifier 3.x release is out? Now that both versions don't share any code, we could also create a dedicated modifier repo/addon, which might make it easier to still maintain any non-modifier releases.

st-h avatar Feb 11 '20 09:02 st-h

There was some discussion originally about making the modifier version a new addon and not a change to this one. It was eventually arrived at not a new addon. It was discussed in the original PR. Maybe reading it might remind us why we didnt do that in the first place, or show us why not doing it was a bad decision :)

https://github.com/adopted-ember-addons/ember-sortable/pull/344#issuecomment-566271653

cah-brian-gantzler avatar Feb 11 '20 16:02 cah-brian-gantzler

The direction I'm leaning toward is stop development on non-modifier, aka no more 2.x releases and focus on modifier, aka 3.x releases.

Here are some reasons why 2.x still exists and why there's non-modifier and modifier currently bundled together:

  1. Not everyone has adopted 3.8 or using modifiers.
  2. Not everyone is using modifiers.
  3. Feature parity with non-modifier

The release of 3.x is also dependent on when we are able to flesh out all the problems we're discovering with the modifiers right now :) Unfortunately, I'm quite new to modifiers, so I won't have much to contribute until I start digging deeper.

ygongdev avatar Feb 11 '20 19:02 ygongdev

I'd vote for moving modifier to a 3.0-alpha Also think about a codemod to upgrade apps from 2.x.x to 3.0.0

BryanCrotaz avatar Apr 23 '20 04:04 BryanCrotaz

I wrote a codemod for 1.x => 3.x, 2.x seems a lot harder to codemod but still doable. Happy to share for any 1.x-ers

runspired avatar Jan 03 '22 07:01 runspired