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

Use requireModule('ember') instead of window.Ember #1535

Merged
merged 10 commits into from
Apr 26, 2021

Conversation

RobbieTheWagner
Copy link
Member

Description

Screenshots

@RobbieTheWagner
Copy link
Member Author

@pzuraq @rwjblue I had to wrap the requires in try/catch to get things working here. I also needed to skip a couple mixin tests. Do we think that is okay for now, since we discourage mixins anyway?

@RobbieTheWagner RobbieTheWagner changed the title Use require('ember') instead of window.Ember Use requireModule('ember') instead of window.Ember Apr 25, 2021
/* eslint no-console: 0 */
const Ember = window.Ember;
let Ember;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you extract the logic of getting ember to some common function,
maybe getEmber()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely could! @avihai-yosef would you be interested in opening a PR to do that?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Sure

@RobbieTheWagner RobbieTheWagner merged commit 33b6124 into master Apr 26, 2021
@delete-merged-branch delete-merged-branch bot deleted the require-ember branch April 26, 2021 18:24
@lifeart lifeart mentioned this pull request Apr 29, 2021
patricklx pushed a commit to patricklx/ember-inspector that referenced this pull request Sep 19, 2022
* Use require('ember') instead of `window.Ember`

* require('ember') || window.Ember

* Try requireModule

* Try require.has

* requireModule again

* requireModule again

* Fix issues with deprecation re-entry and debug class name logging

* Fix tests for 3.27+

* Wrap ember require in try/catch

* Skip mixin tests

Co-authored-by: Chris Garrett <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants