Import typescript files with bring
#6042
Labels
🛠️ compiler
Compiler
✨ enhancement
New feature or request
needs-discussion
Further discussion is needed prior to impl
Use Case
The current mechanism to import javascript/typescript is
extern
. Among several DX issues, a primary difficulty is that it forces the user to declare types for the module upfront within the consuming wing file. This takes the source of truth for types away from the implementation. Instead, we can import typescript files like wing files to allow them to be the source of truth:Proposed Solution
To limit the implementation difficulty, I would propose the following limitations/simplifications:
async
translates to inflightIdeally, the naive implementation of
The above restrictions basically already match existing
extern
restrictions.Implementation Notes
Depends on #3013 to run ESM+typescript in preflight.
https://docs.rs/oxc_parser/latest/oxc_parser/ and https://docs.rs/oxc_semantic/latest/oxc_semantic/ could be invaluable here
Component
No response
Community Notes
The text was updated successfully, but these errors were encountered: