TypeScript's tsx macro is designed with React-like libraries in mind and alternative frameworks need to create custom file types and LSPs just to get off the ground.
I'd love to see the JavaScript spec define a generic macro system to enable experimentation (with IDE support) for alternative frameworks.
For example, jsx/tsx could be expressed with an inline macro
export App() {
return jsx!(Hello World)
}
While something like Vue or Svelte could implement their own inline macros rather than investing in tooling for their custom file types export class App {
#[onChange] // {this.value = "updated"}, 1000)
}
render() {
return vue!({{this.value}})
}
}
If it's part of the spec, the browser could interpret it without a preprocessor and compilers like tsc/swc etc could precalculate the transformations and ship the transformed JavaScript (like we do today with tsx)