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

Make defaultId function more robust #1261

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented Feb 6, 2021

The current defaultId function for templates attempts to load the crypto module
when in Node. However, it uses require directly, which may be
clobbered by AMD require (in the case of Ember). This was previously
handled by using Babel transforms, but that solution is somewhat
brittle. This updates the logic to check for the module global
instead, and defers to it if it exists, before checking for require.

The current `defaultId` function attempts to load the `crypto` module
when in Node. However, it uses `require` directly, which may be
clobbered by AMD require (in the case of Ember). This was previously
handled by using Babel transforms, but that solution is somewhat
brittle. This updates the logic to check for the `module` global
instead, and defers to it if it exists, before checking for `require`.
@rwjblue
Copy link
Member

rwjblue commented Feb 6, 2021

Can you cross link any issues that this fixes?

@pzuraq
Copy link
Member Author

pzuraq commented Feb 9, 2021

Superseded by #1262

@pzuraq pzuraq closed this Feb 9, 2021
@pzuraq pzuraq reopened this Feb 17, 2021
@pzuraq
Copy link
Member Author

pzuraq commented Feb 17, 2021

Just to note, this PR did not solve any specific issue, it was related to the refactoring for the build pipeline in Ember.

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.

None yet

2 participants