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

Named register extra #1855

Merged
merged 4 commits into from
Oct 6, 2018
Merged

Named register extra #1855

merged 4 commits into from
Oct 6, 2018

Conversation

guybedford
Copy link
Member

This creates a new drop-in extra for System.register('name', ... bundles support.

Normalization is handled by simply appending to the origin - System.register('name becomes https://site.com/name.

So imports will work as long as the resolved URLs match this - System.import('/name') or System.import('//site.com/name') would work in the above.

@guybedford
Copy link
Member Author

An alternative to origin-relative might be to make the bundle namespace its own URL space: bundle:app.

So the workflow would be:

bundle.js

System.register('app/x', ...)
System.register('app/y', ...)

With usage:

await System.import('./bundle.js');
const mx = await System.import('bundle:app/x');

Perhaps that is more obvious than origin-relative resolution.

Is bundle: the right name?

@guybedford
Copy link
Member Author

I've updated this branch to use the bundle: scheme now.

I think this seems like a good approach, will merge shortly.

@guybedford guybedford merged commit b34c829 into master Oct 6, 2018
@guybedford guybedford deleted the named-register branch July 31, 2019 03:14
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.

1 participant