Can nodejs
( version > 23) also run *.tsx
("jsx": "react"
) files natively?
#4572
-
I found out at https://nodejs.org/en/learn/typescript/run-natively that starting with version 23, nodejs can run TypeScript ( I wonder, how can I make it run/import
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The experimental Node option uses a TypeScript wrapper called Amaro (https://github.com/nodejs/amaro). However, this is an example for SWC, not Amaro, because Amaro is actually a development of the TypeScript parser SWC (https://swc.rs/) for WebAssembly. In the SWC documentation there is a mention of support for JSX (https://swc.rs/blog/swc-1#what-can-swc-do) so theoretically Node.js v23 should support transpilation of JSX, as well as TSX. You may also be interested in the NanoJSX library (https://nanojsx.io/), which is a lightweight library for rendering JSX on the server side, it is easy to implement. |
Beta Was this translation helpful? Give feedback.
-
take a look to nodejs/node#56822 |
Beta Was this translation helpful? Give feedback.
take a look to nodejs/node#56822