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

Test with new jsx automatic transform #349

Closed
itsdouges opened this issue Nov 7, 2020 · 7 comments · Fixed by #421
Closed

Test with new jsx automatic transform #349

itsdouges opened this issue Nov 7, 2020 · 7 comments · Fixed by #421
Labels
chore 🧹 It's something tedious

Comments

@itsdouges
Copy link
Collaborator

Currently unsure if we need to do anything to make it work.

@itsdouges itsdouges added the chore 🧹 It's something tedious label Nov 7, 2020
@itsdouges itsdouges changed the title Get jsx automatic transform working Test with new jsx automatic transform Nov 7, 2020
@karlhorky
Copy link

You will need to use @jsxImportSource instead of @jsx and @jsxFrag.

Also, if you don't have the following exports, then you will need them:

  • jsx
  • jsxs
  • jsxDEV
  • createElement

Source: emotion-js/emotion#1970

@itsdouges
Copy link
Collaborator Author

hi @karlhorky - interestingly we don't actually use a custom jsx pragma - so the theory is we won't have to do much to get it working.

still need to test soon though! 😄

@karlhorky
Copy link

Ah nice, good to hear! Best of luck!

@karlhorky
Copy link

Wonder if these things will still be needed for TypeScript support (the jsxImportSource option for the new transform released in TS 4.1), since TS won't be able to benefit from the Compiled Babel plugin...

@itsdouges
Copy link
Collaborator Author

Hi, what are we talking about? 🙂

When using Babel it doesn't really matter what your setting is for JSX because TSC isn't used to compiled your code.

@karlhorky
Copy link

For sure - I'm thinking of other situations such as when TS tries to figure out the JSX transform and comes across the unknown css prop, which it will complain about - eg. I've had this issue with the Emotion CSS prop before (also using a Babel plugin), and needed to configure jsxImportSource in tsconfig.json.

@itsdouges
Copy link
Collaborator Author

hmm yeah that's a good point - we could definitely have that problem 😅

will take inspiration from emotion for their solution later when it comes up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore 🧹 It's something tedious
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants