-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Native support of TSX #57079
Comments
I think this is mostly a duplicate of #56822, because that’s the hard part here. |
My take on this issue would be at least shipping a bunch of official loaders to make using tsx with nodejs more streamlined and well-tested (even if for time being the user must explicitly specify the required loader), even without waiting for the proper design of configuring transformations |
TSX is the coexistence of JSX and TS in the same file. And should not interference with each other. As soon as TS support is complete, JSX seems an obvious next step, but before finishing TS, it does not make sense. TSX support will be the consequence of both TS and JSX support. Seems duplicate of #56822. |
(If needed, please free to close this issue as duplicate) |
And we have a loader for tsx https://www.npmjs.com/package/@nodejs-loaders/tsx |
I've tried using it but it did not like the tsx being imported from a ts file. Maybe it can be made work, but I didn't succeed and rolled back to ts-node :( My code is at https://github.com/vadimkantorov/lexical-cli-render |
What is the problem this feature will solve?
It will simplify a lot the life of novices to web-dev ecosystem to have simpler support for running server-side rendering using TSX
My usecase: simple server-side rendering of Lexical JSON's https://github.com/vadimkantorov/lexical-cli-render from CLI. Currently I had to use ts-node, because Node did not support importing custom controls defined in TSX.
Discussed it in https://github.com/orgs/nodejs/discussions/57070
What is the feature you are proposing to solve the problem?
It appears that SWC (used by Amaro under the hood) already has support for TSX: https://swc.rs/blog/swc-1#typescript-support
But it seems disabled by Node: https://nodejs.org/api/typescript.html#determining-module-system
I assume that deciding on TSX support should also correlate somehow with decisions on JSX:
In this linked issue the main blocker seems to be design of running various code transformations. I hope it does not block the feature, as even streamlining some basic usecases would be of great help to novices.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: