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

ES6 feature: Modules: Tracking Issue #1000

Closed
1 of 10 tasks
mikesherov opened this issue Feb 8, 2015 · 6 comments
Closed
1 of 10 tasks

ES6 feature: Modules: Tracking Issue #1000

mikesherov opened this issue Feb 8, 2015 · 6 comments
Labels
Milestone

Comments

@mikesherov
Copy link
Member

Syntax:

  • imports:
ImportDeclaration :
  import ImportClause FromClause ;
  import ModuleSpecifier ;
ImportClause :
  ImportedDefaultBinding
  NameSpaceImport
  NamedImports
  ImportedDefaultBinding , NameSpaceImport
  ImportedDefaultBinding , NamedImports
ImportedDefaultBinding :
  ImportedBinding
NameSpaceImport :
  * as ImportedBinding
NamedImports :
  { }
  { ImportsList }
  { ImportsList , }
FromClause :
  from ModuleSpecifier
ImportsList :
  ImportSpecifier
  ImportsList , ImportSpecifier
ImportSpecifier :
  ImportedBinding
  IdentifierName as ImportedBinding
ModuleSpecifier :
  StringLiteral
ImportedBinding :
  BindingIdentifier
  • exports:
ExportDeclaration :
  export * FromClause ;
  export ExportClause FromClause ;
  export ExportClause ;
  export VariableStatement
  export Declaration
  export default HoistableDeclaration[Default]
  export default ClassDeclaration[Default]
  export default [lookahead ∉ {function, class}] AssignmentExpression[In] ;
ExportClause :
  { }
  { ExportsList }
  { ExportsList , }
ExportsList :
  ExportSpecifier
  ExportsList , ExportSpecifier
ExportSpecifier :
  IdentifierName
  IdentifierName as IdentifierName

Spec:

Remaining Tasks:

@ikarienator
Copy link
Contributor

We need to discuss in Wednesday meeting on whether we need to expose an API to parse using different start symbols and the details on it.

In ES5, the only start symbol is Script, so parse is unambiguous. In ES6, we have two symbols, Script and Module. Modules are parsed only in strict mode and imports/exports are only allowed in top level of Modules.

@ariya
Copy link
Contributor

ariya commented Feb 14, 2015

For now, Script vs Module can be handled just like in commit 85fc2f4 from the harmony branch.

@ariya ariya added es6 and removed es6migration labels Feb 18, 2015
@jeffmo
Copy link
Member

jeffmo commented Feb 25, 2015

FWIW We've found it useful already (at FB) to add a nonStrictModule source type for intermediary conversion-of-codebase purposes. I've been meaning to send this upstream, but wanted to try it downstream first to be sure it's worth it.

(@ariya feel free to say you told me so: #290 (comment))

Worth considering here too. We found it to be super convenient to be able to opt in to disabling implicit-strict in order to switch existing CJS (etc) modules over to ES6 before having a chance to go through and audit for strict-safety.

@caridy
Copy link
Contributor

caridy commented Feb 26, 2015

@jeffmo that's pretty interesting.

@caridy
Copy link
Contributor

caridy commented Mar 11, 2015

I plan to work on the modules, at least taking the bulk of the work.

@mikesherov mikesherov added this to the 2.2 milestone Mar 15, 2015
@caridy
Copy link
Contributor

caridy commented Mar 23, 2015

implemented in #1149

@ariya ariya closed this as completed in 81acde6 Apr 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants