kellyselden / ember-cli-tree-shaker

Experiment with tree-shaking in Ember CLI
MIT License
76 stars 7 forks source link

Issue with ember-changeset-validations #17

Closed RobbieTheWagner closed 6 years ago

RobbieTheWagner commented 6 years ago

ember-changeset-validations uses ember-validators, but does not import the modules specifically https://github.com/poteto/ember-changeset-validations/blob/master/addon/validators/presence.js#L2

I get errors that presence is not a valid validator type because it is stripped out. I'm manually including them for now, but wanted to bring up the issue.

kellyselden commented 6 years ago

That is the same issue that affects ember-metrics, which is mentioned in the README. You are using the includes option as intended for addons like this.

RobbieTheWagner commented 6 years ago

@kellyselden my only concern is that this is nested, so people may not realize that an addon that uses another addon isn't importing modules. Any suggestions to address that?

kellyselden commented 6 years ago

Any suggestions to address that?

Two things come to mind. Addons could be updated to use imports instead of dynamic lookups, or we can scan all code and try and detect these scenarios. The latter will be very difficult and probably slow down the build.