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 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 compiler/json_exports branch from 29260d3 to 1d05615 Compare October 26, 2019 23:36
@ry
Copy link
Member

ry commented Oct 27, 2019

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

@kevinkassimo
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

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - LGTM

@ry ry merged commit 6869bfa into denoland:master Oct 27, 2019
@zekth
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import Json is not exposing properties as exports
3 participants