Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce setup step #117

Closed
wants to merge 1 commit into from
Closed

Introduce setup step #117

wants to merge 1 commit into from

Conversation

mixonic
Copy link
Member

@mixonic mixonic commented May 28, 2021

Adapting from #107, avoid referencing the Ember global.

This PR only updates the "main" JS implementation. It does not attempt to remove global Ember interactions from the template compilation deprecation catcher. #107 simply removed the template compilation catcher, which I would like to avoid doing.

This PR would require that users of deprecation workflow add setup(self) to their app.js or another appropriate location. Likely they might want to only call setup( if running in a dev build. It isn't clear exactly how to document/automate that. (Finally it is possible someone might want to run deprecation workflow in a production build when running tests. That should be left as an exercise to the consumer IMO). We can probably suggest using https://api.emberjs.com/ember/3.26/classes/@ember%2Fdebug/methods/runInDebug?anchor=runInDebug

It also isn't clear if the payload in addon/index.js will still be a no-op in production. Generally deprecation workflow today is pretty clever about not adding any weight (from the config file or from its JS) to production builds. We likely need a solution for this since the config file is obnoxious to ship to prod, but this PR doesn't address/change the config file anyway.

TODO:

  • Figure out a solution for setup( being added upon installation, or document it
  • Figure out how to continue to make the JS a no-op in production build, or show it already is

@mixonic mixonic force-pushed the mixonic/drop-global-access branch from 54f95e6 to ca7a12b Compare May 28, 2021 02:25
@mixonic
Copy link
Member Author

mixonic commented May 28, 2021

I think the limitations of this approach are less than ideal. I spiked out an alternative approach in #118

@mixonic mixonic added the 2.0 2.0 blockers, see https://github.com/mixonic/ember-cli-deprecation-workflow/issues/109 label May 28, 2021
@mixonic mixonic closed this Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 2.0 blockers, see https://github.com/mixonic/ember-cli-deprecation-workflow/issues/109
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant