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

feat: support named exports from CJS as named ESM imports #10673

Merged
merged 2 commits into from Oct 23, 2020

Conversation

@SimenB
Copy link
Collaborator

@SimenB SimenB commented Oct 21, 2020

Summary

See #9430 (comment)

Test plan

Test added

@SimenB SimenB added the ES Modules label Oct 21, 2020
@SimenB SimenB requested review from thymikee and jeysal Oct 21, 2020
@SimenB SimenB mentioned this pull request Oct 21, 2020
10 of 20 tasks complete
let cjsExports: ReadonlyArray<string> = [];

if (transformedCode) {
const {exports} = parseCjs(transformedCode.code);

This comment has been minimized.

@SimenB

SimenB Oct 21, 2020
Author Collaborator

this ignore re-exports - I'm not sure what the semantics are? Where would I get the "value" from?

EDIT: I guess we could resolve the resulting path? Again, not sure what the value would be

@@ -18,6 +18,8 @@ import {
Module as VMModule,
} from 'vm';
import * as nativeModule from 'module';
// @ts-expect-error

This comment has been minimized.

@SimenB SimenB merged commit 374fe52 into facebook:master Oct 23, 2020
26 checks passed
26 checks passed
cleanup-runs
Details
Running TypeScript compiler & ESLint
Details
Node v10.x on ubuntu-latest
Details
Node v10.x on macOS-latest
Details
Node v10.x on windows-latest
Details
Node v12.x on ubuntu-latest
Details
Node v12.x on macOS-latest
Details
Node v12.x on windows-latest
Details
Node v13.x on ubuntu-latest
Details
Node v13.x on macOS-latest
Details
Node v13.x on windows-latest
Details
Node v14.x on ubuntu-latest
Details
Node v14.x on macOS-latest
Details
Node v14.x on windows-latest
Details
Node v15.x on ubuntu-latest
Details
Node v15.x on macOS-latest
Details
Node v15.x on windows-latest
Details
Facebook CLA Check Contributor License Agreement is valid!
Details
ci/circleci: test-jest-circus Your tests passed on CircleCI!
Details
ci/circleci: test-node-10 Your tests passed on CircleCI!
Details
ci/circleci: test-node-12 Your tests passed on CircleCI!
Details
ci/circleci: test-node-13 Your tests passed on CircleCI!
Details
ci/circleci: test-node-14 Your tests passed on CircleCI!
Details
ci/circleci: test-node-15 Your tests passed on CircleCI!
Details
ci/circleci: test-or-deploy-website Your tests passed on CircleCI!
Details
facebook.jest #20201021.11 succeeded
Details
@SimenB SimenB deleted the SimenB:named-cjs-import branch Oct 23, 2020
This was referenced Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.