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

initial module checkin #297

Merged
merged 7 commits into from
Feb 16, 2016
Merged

initial module checkin #297

merged 7 commits into from
Feb 16, 2016

Conversation

Yongqu
Copy link
Contributor

@Yongqu Yongqu commented Feb 11, 2016

This is initial runtime support for module ( parser change at 

#293).
This PR contain the basic support for host integration, and it can act as basic bootstrap to
enable edge support later.
Current es6 module spec does not clarify the dependency module loading sequence, and module
loader spec is not finalized yet. At this time, we will allow browser host to start from scripttype='module'
tag, and allow host to asynchronously fetch child module sources. This is in effect adding a small state
machine between ParseModule and ModuleDeclarationInstantiation. Once all modules are parsed and
initialized, the script engine notifies the host, and ModuleEvaluation of top level module will start
asynchronously, initiated from the host.
There are still a lot of unimplemented features, including experimental JSRT APIs that match
execution model, namespace object and ResolveExports, error handling etc. Also this change is
developed in parallel to the parser change it will be integrated with the parser part later.

@bmeck
Copy link

bmeck commented Feb 11, 2016

Please note that the WHATWG Loader and the Node loader have intrinsic differences and the Loader will likely require host environment setup outside of the VM. These problems are explained in nodejs/node-eps#3 which holds the Node a companion proposal to the WHATWG proposal about how Node needs to instrument things.

@bmeck
Copy link

bmeck commented Feb 11, 2016

reference to another potential change in the spec (at JS level, not Loader) : tc39/ecma262#368

@Yongqu
Copy link
Contributor Author

Yongqu commented Feb 11, 2016

@bmeck Thanks for the info and I'll take a look. We do want to support both es6 and node interaction. @bterlson

{
LoadScriptFlag_None = 0x0,
LoadScriptFlag_Expression = 0x1, // the script returns a value.
LoadScriptFlag_disableDeferredParse = 0x2, // do not defer-parse the code.
Copy link
Contributor

Choose a reason for hiding this comment

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

Want to make casing consistent between these flags?

@boingoing
Copy link
Contributor

Big change looks good to me!

@pleath
Copy link
Contributor

pleath commented Feb 12, 2016

Does this change contain the compile-time API that takes an import symbol and returns the module index and symbol index?

@Yongqu
Copy link
Contributor Author

Yongqu commented Feb 12, 2016

@pleath no that's part of ModuleDeclarationInitialization and it is not implemented yet.

@pleath
Copy link
Contributor

pleath commented Feb 12, 2016

Okay. Thanks. What's here LGTM.

@chakrabot chakrabot merged commit 16b6c98 into master Feb 16, 2016
chakrabot pushed a commit that referenced this pull request Feb 16, 2016
Merge pull request #297 from pr/yongqu/module
    This is initial runtime support for module ( parser change at
#293).
    This PR contain the basic support for host integration, and it can act as basic bootstrap to
enable edge support later.
    Current es6 module spec does not clarify the dependency module loading sequence, and module
loader spec is not finalized yet. At this time, we will allow browser host to start from scripttype='module'
tag, and allow host to asynchronously fetch child module sources. This is in effect adding a small state
machine between ParseModule and ModuleDeclarationInstantiation. Once all modules are parsed and
initialized, the script engine notifies the host, and ModuleEvaluation of top level module will start
asynchronously, initiated from the host.
    There are still a lot of unimplemented features, including experimental JSRT APIs that match
execution model, namespace object and ResolveExports, error handling etc. Also this change is
developed in parallel to the parser change it will be integrated with the parser part later.
@Yongqu Yongqu deleted the pr/yongqu/module branch February 17, 2016 22:34
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.

6 participants