Table source type detection#465
Conversation
|
I love the idea. Though I think the problem was the dependence on Acorn. I hope to compare notes from what I understand. As you know, I was using From the perspective of eval, where other factors may be absent, it does seem like |
I'm not sure that was an issue, since Acorn is already part of Node core.
I could redo the PR to implement Regardless of this method and whether or not it is publicly available, how would people react to a potential PR for |
|
As i recall, the pushback (mine included) was primarily around auto. There is ambiguity in the Script and Module syntax, and unless there’s no way for an ambiguous file to be mis-parsed, it doesn’t seem appropriate to have that kind of risk in node core. I think that regardless of the plan in core, it seems more productive to publish and integrate on an npm package first - that way the semantics and edge cases can be fleshed out in advance. |
|
Going to merge this per 2020-01-15 meeting. We can always revisit or reopen, or open new/similar issues. |
|
After this the only two remaining open roadmap items are both in Stage 4, and they’re dual packages/conditional exports and loaders. The former we’re hopefully about to wrap up, the latter I guess we could change the status to say it will be open/iterated upon indefinitely, something like that? I feel like loaders might never be “done” per se. |
So eight months ago I opened nodejs/node#27808 to add a utility method to Node core for detecting if JavaScript source code contained ES module syntax. That PR is still open and it’s not looking likely that it will be merged anytime soon, so I’m thinking of closing it. I might release the code as a standalone NPM package.
The PR’s
containsModuleSyntaxmethod wasn’t all that useful on its own, and wasn’t used by Node core; it was created to be a dependency for potential Node core features like--input-type=auto. Are will still planning on implementing--input-type=auto, or any other feature that might rely oncontainsModuleSyntax?If not, I can close the PR and mark this roadmap item as done/tabled, unless anyone has any objections or reasons we might want source detection in the future.