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

Support named imports/exports for subset of properties in JSON modules #3210

Merged
merged 1 commit into from Oct 27, 2019

Conversation

@kevinkassimo
Copy link
Contributor

kevinkassimo commented Oct 26, 2019

Closes #3171

Added some named exports for JSON modules if:

  1. JSON contains a single object
  2. corresponding field is not a reserved word
  3. corresponding field can be represented as a subset of valid variables (alphanumeric only)

Sidenote: I wonder we might be able to take advantage of SyntheticModule at some point.

@kevinkassimo kevinkassimo force-pushed the kevinkassimo:compiler/json_exports branch from 29260d3 to 1d05615 Oct 26, 2019
@ry

This comment has been minimized.

Copy link
Collaborator

ry commented Oct 27, 2019

Is this part of some specification or matching behavior in Node?

@kevinkassimo

This comment has been minimized.

Copy link
Contributor Author

kevinkassimo commented Oct 27, 2019

@ry No I don't think so. This is more like a behavior of webpack or similar.
cc @zekth who made the original FR

@ry
ry approved these changes Oct 27, 2019
Copy link
Collaborator

ry left a comment

Ok - LGTM

@ry ry merged commit 6869bfa into denoland:master Oct 27, 2019
10 checks passed
10 checks passed
test macOS-10.14
Details
test_std macOS-10.14
Details
test windows-2019
Details
test_std windows-2019
Details
test ubuntu-16.04
Details
test_debug ubuntu-16.04
Details
test_std ubuntu-16.04
Details
bench ubuntu-16.04
Details
lint ubuntu-16.04
Details
license/cla Contributor License Agreement is signed.
Details
@zekth

This comment has been minimized.

Copy link
Contributor

zekth commented Oct 28, 2019

Great job @kevinkassimo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.