Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

CommonJS import interoperability decisions #264

Closed
@GeoffreyBooth

Description

@GeoffreyBooth

As @MylesBorins mentioned in #261, there are some things we need to vote on. I was thinking that we should start with the biggest topic: support for import statements/expressions bringing CommonJS files and packages into ESM. That’s probably the biggest decision we have to make, in terms of the effect it has on the implementation we’re building and eventually shipping; and making this decision will probably take up most if not all of the time in the meeting, so there’s probably no point in preparing votes on anything else. Here are some questions that I propose we put to votes at a meeting:

  1. Do you support import interoperability of CommonJS in theory? As in, could there potentially be any implementation that satisfies you for allowing import statements and import() expressions of CommonJS files and packages? (If this question is voted “no,” we can skip the rest.)

  2. Do you support full CommonJS import interoperability via two-phase execution (CJS named exports via two-phase execution ecmascript-modules#31) if that turns out to be the only CommonJS import interoperability method that wins majority support?

  3. Do you support almost-full (all but export * from) CommonJS import interoperability via dynamic modules (WIP [Do not merge] - Irp type dynamic modules ecmascript-modules#29), if that turns out to be the only CommonJS import interoperability method that wins majority support?

  4. If both of the above PRs win majority support, which one do you prefer?

  5. If neither of the above PRs win majority support, do you prefer to keep the current --experimental-modules/ecmascript-modules “default export only” CommonJS import (so import _ from 'underscore' but not import { shuffle } from 'underscore') or would you prefer to remove CommonJS import interoperability altogether?

I tried to phrase these neutrally; if people have feedback I’ll edit this post. Please feel free to make your case for your preferences in this thread 😄

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions