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

JSON modules are being reverted on web #391

Closed
guybedford opened this issue Sep 28, 2019 · 7 comments
Closed

JSON modules are being reverted on web #391

guybedford opened this issue Sep 28, 2019 · 7 comments
Labels
modules-agenda To be discussed in a meeting

Comments

@guybedford
Copy link
Contributor

See whatwg/html#4943, it appears this is due to lack of consensus between browsers based on a security concern. It does not seem to imply that they won't be implemented in future.

Given that we have erred on the side of web compatibility so far in the implementation, I would like to suggest we bring back the --experimental-json-modules flag for Node.js as we unflag modules to indicate the stability of the feature.

For example, were JSON modules to reland but with slightly different semantics (eg import json from './file.json' as json has been proposed or similar), then that keeps the door open for Node.js to be able to share in any new semantics.

@devsnek
Copy link
Member

devsnek commented Sep 28, 2019

we don't have the security problem that the web has, I see no reason to destabilise it.

@ljharb
Copy link
Member

ljharb commented Sep 28, 2019

I am also highly skeptical that any new syntax would gain consensus to indicate mime/module type.

@MylesBorins
Copy link
Contributor

MylesBorins commented Sep 30, 2019

I think that while stakeholders from the web discuss the feature and figure out if it has a future it is reasonable for us to include the flag, for now. While it is not the most convenient we can use makeRequire to synchronously parse JSON from disk

@Fishrock123
Copy link
Contributor

As far as I am aware, there is no precedent for re-experimental-flagging a feature. That may be Semver-Major.

@jkrems
Copy link
Contributor

jkrems commented Oct 7, 2019

Does it change things that the unflagged feature is still behind --experimental-modules itself? E.g. it was never "fully" unflagged.

@MylesBorins
Copy link
Contributor

MylesBorins commented Oct 7, 2019 via email

@guybedford
Copy link
Contributor Author

The PR for Node.js core has been merged here. We can unflag or reconsider stability here at any time further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modules-agenda To be discussed in a meeting
Projects
None yet
Development

No branches or pull requests

6 participants