Open MarkMcCulloh opened 8 months ago
Hi,
This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
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 https://github.com/winglang/wing/issues/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