Previously posted here:
Adden-shim is a compat feature and currently brings in many dozens of MB of unused dependencies in modern projects.
But still, for supporting broccoli-based environments, an addon must provide the addon-main.
Perhaps there is a smaller, 0 dependency thing we can do by default and only use addon-shim if certain behaviors are needed
For example, in this tiny package, we install (prod mode) over 300 dependencies
https://node-modules.dev/grid/depth#install=reactiveweb
Even with very few direct dependencies...
(As an aside, when we ship v2 addon by default, we'll want to make sure our packages are ESM)
But anyway, the tiny package i picked isn't minimal enough of an example.
Let's look at test-waiters:
Here you can see that test-waiters also pulls in 300 dependencies.
Most appear at depth 5 tho.
But it all comes down to the broccoli support weighing everything down.
- addon-shim brings in 76 dependencies
- macros brings in 299 dependencies
I would prefer those to be, at worse, single digits.
Let's look at macros: https://node-modules.dev/grid/depth#selected=@embroider/macros@1.19.6&install=@ember/test-waiters&focus=@embroider/macros@1.19.6
The biggest problem here is ember-cli-babel.... Which isn't needed in vite projects (especially those without compat)
Makes me wonder if we need nolyfill, but for the ember ecosystem
https://github.com/SukkaW/nolyfill
Cause i don't have a lot of hope that macros can ever drop a dependency as it can't make a breaking change.
Tho, maybe we can ignore macros entirely and make a new macros tool that doesn't bring in broccoli support hm.
Also, if macros is a babel plugin, why did we put it in 'dependencies' of every library?
Did we get confused because it wasn't in addon-dev's externals list for a time? Or because users of it need to get the types somehow? And we generally have a strict 'if you import it, declare it' rule? Idk
Previously posted here:
Adden-shim is a compat feature and currently brings in many dozens of MB of unused dependencies in modern projects.
But still, for supporting broccoli-based environments, an addon must provide the addon-main.
Perhaps there is a smaller, 0 dependency thing we can do by default and only use addon-shim if certain behaviors are needed
For example, in this tiny package, we install (prod mode) over 300 dependencies
https://node-modules.dev/grid/depth#install=reactiveweb
Even with very few direct dependencies...
(As an aside, when we ship v2 addon by default, we'll want to make sure our packages are ESM)
But anyway, the tiny package i picked isn't minimal enough of an example.
Let's look at test-waiters:
Here you can see that test-waiters also pulls in 300 dependencies.
Most appear at depth 5 tho.
But it all comes down to the broccoli support weighing everything down.
I would prefer those to be, at worse, single digits.
Let's look at macros: https://node-modules.dev/grid/depth#selected=@embroider/macros@1.19.6&install=@ember/test-waiters&focus=@embroider/macros@1.19.6
The biggest problem here is ember-cli-babel.... Which isn't needed in vite projects (especially those without compat)
Makes me wonder if we need nolyfill, but for the ember ecosystem
https://github.com/SukkaW/nolyfill
Cause i don't have a lot of hope that macros can ever drop a dependency as it can't make a breaking change.
Tho, maybe we can ignore macros entirely and make a new macros tool that doesn't bring in broccoli support hm.
Also, if macros is a babel plugin, why did we put it in 'dependencies' of every library?
Did we get confused because it wasn't in addon-dev's externals list for a time? Or because users of it need to get the types somehow? And we generally have a strict 'if you import it, declare it' rule? Idk