Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gjs gjs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 104
    • Issues 104
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gjsgjs
  • Merge requests
  • !150

WIP: ES6 Modules

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed djrenren requested to merge djrenren/gjs:es6-modules into master May 19, 2018
  • Overview 41
  • Commits 7
  • Pipelines 16
  • Changes 5

Allow for gjs scripts to use es6 import syntax:

  • Import other JS modules
  • Import C Modules

(optional)

  • Move GIR import logic to JS

Open Questions:

How do we handle loading scripts (as opposed to modules)?

Module loading forces strict mode so we can't load old scripts as modules. We need a way to distinguishing. Options include:

  • Using .jsm files (a la node)
  • Requiring a command line flag like -m (a la mozjs shell)
  • Autodetection of module semantics (a la typescript)

There's also the question when a module wants to import a script. I think the least janky way to do this is to require the use of the legacy imports interface for such a thing, but I'm open to suggestions.

Import resolution semantics

Do we auto-resolve import mod from "foo/bar" to foo/bar/index.js if bar is a directory. I think we should. How does name resolution work for gir imports?

Edited May 19, 2018 by djrenren
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: es6-modules