Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for tsx #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: add support for tsx #68

wants to merge 3 commits into from

Conversation

CaiWenlie
Copy link

No description provided.

Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transform from Sucrase is the implementation of React, so it doesn't work.

@sxzz
Copy link
Member

sxzz commented Jan 17, 2023

I think we should have #61 first, and then users can transform Vue JSX themselves.
Otherwise, we have to wait until PR alangpierce/sucrase#450 or switch to Babel (with a huge bundle size than Sucrase)

@CaiWenlie
Copy link
Author

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'

d0829ca#diff-adb065f7ea26f7f005649ad48bcbf0534bc860c701bb4e19c3917b125f4e2f20R22

@sxzz
Copy link
Member

sxzz commented Jan 18, 2023

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}/>

@CaiWenlie
Copy link
Author

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}/>

Thanks for mentioning this. just switched to Babel !

@amnsss
Copy link

amnsss commented Jun 15, 2023

hi, when to merge?

@mengqiuleo
Copy link

hi, when to merge?

1 similar comment
@ddztomcat
Copy link

hi, when to merge?

@husayt
Copy link

husayt commented Nov 7, 2023

@sxzz @CaiWenlie is something still stopping this from being merged?

@yjy8749
Copy link

yjy8749 commented Dec 7, 2023

hi, when to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants