Closed kentcdodds closed 7 years ago
ping for those watching the repo. I've updated the issue with more info.
yes, it will be subject to the interop bridge since it is a single value. This weeks CTC will have an update on the bridge discussing why we can't do hoisting. (was on vacation last week, sorry)
@bmeck any update on this?
@sam-github still going to be same bridge as CJS, closable?
I don't know, I was hoping to read the link giving more context ;-).
@jdalton invited me to file this issue. I didn't see anything in the proposal about JSON support. Will importing JSON be supported?
Due to the fact that JSON is static, I think it'd be reasonable to use
ImportSpecifiers
as well. One drawback is it could be confusing. But in scenarios where the JSON file is large, tree shaking could be helpful in this scenario.Here's an example:
data.json
index.js
I think that this would be reasonable. As cool as it would be to have a destructuring-like syntax to get a specific picture (
large
for example), I don't think that's really in the cards here.All of that said, tree-shaking is really a bundler concern and I don't think that Node proper really needs to concern itself with that. So honestly, just getting the entire parsed JS object as a default export which could then be destructured as normal would be fantastic.