Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

0.50: change to new globals #494

Merged
merged 1 commit into from
Jun 21, 2016
Merged

0.50: change to new globals #494

merged 1 commit into from
Jun 21, 2016

Conversation

probins
Copy link
Contributor

@probins probins commented Jun 20, 2016

No description provided.

@@ -107,7 +107,7 @@
return moduleRecords[key] || (moduleRecords[key] = {
key: key,
dependencies: [],
module: new Module({}),
module: new Reflect.Module({}),
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the above matter too much? Module is an internally scoped reference to Reflect.Module and not global.Module I think?

Copy link
Member

Choose a reason for hiding this comment

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

See https://github.com/ModuleLoader/es6-module-loader/blob/0.50/src/loader.js#L682, we rely on internal scoping through the build process.

It may well be worth rewriting the build using ES modules and Rollup as another task here to make these scoping assumptions clearer!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer having these add-ons as modules :-) Module() is surely left over from the old spec, and I think using Reflect.Module makes it clearer what's going on here, though I agree it probably doesn't matter much in practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may well be worth rewriting the build using ES modules and Rollup as another task here to make these scoping assumptions clearer!

just to make sure we're on the same wavelength, you're proposing rewriting src/*.js as ES6, and then use Rollup as build instead of concat to convert that into IIFE? I think that would be a very good idea - and would suggest extending to SystemJS as well.

Copy link
Member

Choose a reason for hiding this comment

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

Yes exactly!

@probins
Copy link
Contributor Author

probins commented Jun 21, 2016

Module() is marked as TODO, so we can leave that till later.

What is System.global used for? It's not in the spec AFAICS.

@guybedford
Copy link
Member

System.global is a separate spec at https://github.com/tc39/proposal-global.

@guybedford guybedford merged commit 1a6f551 into ModuleLoader:0.50 Jun 21, 2016
@probins probins deleted the 0.50-tidy branch June 22, 2016 17:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants