ember-math-helpers
ember-math-helpers copied to clipboard
Tree-shaking via only / except configuration is broken in v4
The tree-shaking via only
and except
configuration options does not seem to work anymore in 4.0.0. I think it was dropped when converting the addon to v2 in #945.
I assume this was done by accident as the feature is still documented: https://github.com/RobbieTheWagner/ember-math-helpers/blob/f7c0446d05558a1a700f27a0565f370e9471eab5/docs/docs/configuration.md?plain=1#L1-L19
This breaking change is also not listed in the changelog: https://github.com/RobbieTheWagner/ember-math-helpers/blob/f7c0446d05558a1a700f27a0565f370e9471eab5/CHANGELOG.md?plain=1#L6-L24
I noticed this when investigating if we can convert Ember Bootstrap to a v2 addon without dropping support for tree-shaking through configuration.
@jelhan you are correct that support was dropped for it. I believe tree shaking should be automatic with embroider and only use the things you import, but I could be wrong.
I believe tree shaking should be automatic with embroider and only use the things you import, but I could be wrong.
That's only true if consuming app uses Embroider and opted in to { staticHelpers: true }
as far as I know.
I believe tree shaking should be automatic with embroider and only use the things you import, but I could be wrong.
That's only true if consuming app uses Embroider and opted in to
{ staticHelpers: true }
as far as I know.
That's possible, but that is the future, so I don't know if we need configs for this anymore in this addon.
I don't know if we need configs for this anymore in this addon.
I think it's a maintainer decision. I see two options:
- Document the breaking change in the changelog and update the docs. Or
- Rollback the v2 addon conversion and restore the functionality as a bug fix.
A third one would be restoring the functionality for apps not using Embroider. This is discussed here: https://github.com/embroider-build/embroider/issues/1748#issuecomment-1875698206 It would be still a breaking change introduced in v4 but affecting a smaller subset of apps using this addon.
I think documenting the breaking change is probably the best way to go here.