Skip to content

new addon includes 300 deps #131

@NullVoxPopuli

Description

@NullVoxPopuli

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions