mitosis
mitosis copied to clipboard
Core: strip away types for JS Output
As per #511, we want to support 2 approaches:
- allow
mitosis buildto output plain JS files - allow
mitosis buildto output TS files
As part of getting TS support working, we started adding type outputs to various generators. Our generated code is somewhat in-between plain JS and TS, depending on the generator.
Currently, the MitosisComponent JSON generated by our JSX parser holds on to type information in all code blocks. To successfully implement a "js-only" mode, we'd need to:
- make sure that interfaces/types are not injected
- run every code block through a babel/esbuild transform that strips away any typescript code
yeah this is a good idea. in the generators the code would be simpler if we knew the output should be js or ts. I don't think Mitosis needs to generate the .d.ts for now and rely on the typescript compiler to figure that out