repl
repl copied to clipboard
feat: add support for tsx
I think we should have #61 first, and then users can transform Vue JSX themselves. Otherwise, we have to wait until PR https://github.com/alangpierce/sucrase/issues/450 or switch to Babel (with a huge bundle size than Sucrase)
The transform from Sucrase is the implementation of React, so it doesn't work.
@sxzz sorry i didn't consider React situation, you may remove the transform config below, it's for vue only.
jsxPragma: 'h',
jsxFragmentPragma: 'Fragment'
https://github.com/vuejs/repl/pull/68/commits/d0829caee2cfaeca3d0be1acb494300b7072b56a#diff-adb065f7ea26f7f005649ad48bcbf0534bc860c701bb4e19c3917b125f4e2f20R22
No, I mean we cannot use the built-in JSX transform function from Babel. Instead, we should use the Babel plugin https://github.com/vuejs/babel-plugin-jsx if we have to support JSX.
For example: v-model is the function that only existed in Vue not React, so Babel JSX doesn't support it.
<input v-model={foo}/>
No, I mean we cannot use the built-in JSX transform function from Babel. Instead, we should use the Babel plugin https://github.com/vuejs/babel-plugin-jsx if we have to support JSX.
For example:
v-modelis the function that only existed in Vue not React, so Babel JSX doesn't support it.<input v-model={foo}/>
Thanks for mentioning this. just switched to Babel !
hi, when to merge?
hi, when to merge?
hi, when to merge?
@sxzz @CaiWenlie is something still stopping this from being merged?
hi, when to merge?