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

TypeScript support #784

Open
vmutafov opened this issue Dec 1, 2023 · 0 comments
Open

TypeScript support #784

vmutafov opened this issue Dec 1, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vmutafov
Copy link

vmutafov commented Dec 1, 2023

Currently, in order to execute TypeScript code inside GraalJS, one should use the TypeScript compiler (or some other compiler like swc or esbuild) in order to prepare the sources for execution in GraalJS. Although this is possible, there are some disadvantages like:

  • supporting an extra build step which is quite different from standard Java setups
  • good understanding of how TypeScript modules are translated to JavaScript modules and using a custom Truffle File System for resolving them
  • additional configuration for debugging support

Having a way to execute TypeScript code in a Truffle context would simplify all those aspects as ideally the developer should be concerned only with writing his code and not dealing with any additional setup. Any necessary configurations should be done using the standard way of configuring a Graal context through its options.

Having said that, I have created a PoC how I imagine TypeScript support could look like:

It would be great to hear your thoughts about it and see if it's possible to contribute this into GraalJS itself. Huge thanks to @chumer for providing valuable feedback and support for implementing this!

@chumer chumer added the enhancement New feature or request label Dec 6, 2023
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

3 participants