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

Deconflict global variables used inside format-specific code #2880

Merged
merged 6 commits into from May 31, 2019

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented May 29, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #2853

Description

The original issue was that variables named module would shadow the module variable of the SystemJS wrapper. This is a much more general solution that includes the following improvements:

  • in all formats, global variables that are needed to render dynamic imports or resolve import.meta.url or asset/chunk URLs are protected from being shadowed by renaming any conflicting variables
  • this is very specific—only variables that actually cause conflicts are renamed
  • the new logic is used to determine which builtin dependencies need to be injected by the AMD wrapper and also suppress the exports and module parameters of the SystemJS wrapper if they are not needed
  • not directly related, but AMD asset und chunk URLs are now resolved via require.toUrl instead of module.uri + string concatenation (@surma will probably not like this as this means his AMD loader might need adustments again).

@lukastaegert lukastaegert merged commit b006d13 into master May 31, 2019
@lukastaegert lukastaegert deleted the deconflict-wrapper-globals branch May 31, 2019 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SystemJS callback module param conflicts with any module declaration
1 participant