▲ | apatheticonion 18 hours ago | ||||||||||||||||
One of the issues I find is that JavaScript itself holds back the ability of tool makers to experiment with practical novel alternatives. 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
While something like Vue or Svelte could implement their own inline macros rather than investing in tooling for their custom file types
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) | |||||||||||||||||
▲ | b_e_n_t_o_n 17 hours ago | parent [-] | ||||||||||||||||
Js has decorators for class fields so you wouldn't even need a macro for that. `@state accessor value = "hello world"` works. I do like the idea of macros in general though. | |||||||||||||||||
|