ember-cli / ember-cli/ember-addon-blueprint

new addon includes 300 deps

Open
#131 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Previously posted here:
- https://github.com/embroider-build/addon-blueprint/issues/343

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

Image

Even with very few direct dependencies...

Image

(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:

Image

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

Image

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.