Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-blank-space loader hook that doesn't make tsc run first #2651

Open
mhofman opened this issue Dec 2, 2024 · 0 comments
Open

ts-blank-space loader hook that doesn't make tsc run first #2651

mhofman opened this issue Dec 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mhofman
Copy link
Contributor

mhofman commented Dec 2, 2024

What is the Problem Being Solved?

With #2415 we added support for .ts in bundle source. However people also want to use .ts when running scripts in Node.js. Since support for native .ts support in Node.js is still experimental and not widely available, the alternative is to use the ts-blank-space/register loader hook. However that hook runs ts-blank-space and tsc as first run script, open the TCB to compromise.

Description of the Design

  • Provide an alternative loader hook that loads ts-blank-space and its tsc dependency in a separate worker.

  • Remove the fallback resolution to lookup for .ts files when a .js file fails to resolve, and potentially only resolve .ts files if the file is not in node_modules, aligning with the experimental Node.js behavior.

Security Considerations

Users would still have to trust ts-blank-space and tsc to not transform their .ts code beyond the intended type stripping, but the import and evaluation of any .js file would remain unaffected.

Scaling Considerations

Shuffling large strings over a worker boundary might be expensive.

Test Plan

TBD

Compatibility Considerations

This would likely be a new package of @endo that depends on ts-blank-space.

Upgrade Considerations

None

@mhofman mhofman added the enhancement New feature or request label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant