tc39 / proposal-built-in-modules

BSD 2-Clause "Simplified" License
892 stars 25 forks source link

Statically Identifiable Keyword/Syntax/Specifier #56

Open TheLarkInn opened 4 years ago

TheLarkInn commented 4 years ago

Mentioned in the Appendix:

It could also be possible to use specialized tokens in place of Identifier prefix, for example similar to C/C++:

import { ... } from <SomeStandardModule>;

Static analysis tools (like webpack, bundlers, lint, etc.) will need to be able to identify if a module specifier is a built-in module, or not.

Therefore, an enforceable, and differentiating sigil/keyword/symbol/syntax would be heavily preferred.

I personally think the above example would be perfect! As a parser could distinguish a module using a built-in module on a single pass.

TheLarkInn commented 4 years ago

I can delve into the webpack specific scenario here if it is not clear.