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

Add support for automatic JSX runtime #1237

Merged
merged 42 commits into from
Nov 25, 2020
Merged

Add support for automatic JSX runtime #1237

merged 42 commits into from
Nov 25, 2020

Conversation

dcastil
Copy link
Contributor

@dcastil dcastil commented Nov 5, 2020

Closes #1160

React introduced the new JSX transform and Emotion added support in emotion-js/emotion#1970. So everything is in place for Theme UI to support the new JSX transform. 😊

To dos:

  • Resolve discussions I added below.
  • Test automatic JSX runtime manually
  • Write tests
  • Update documentation

@dcastil dcastil requested a review from hasparus November 6, 2020 19:19
packages/core/package.json Outdated Show resolved Hide resolved
@hasparus hasparus added this to the v0.5 milestone Nov 18, 2020
@shadcn
Copy link

shadcn commented Nov 23, 2020

This commit thread is a roller coaster of emotion (pun intended?)

fml tpyescript is so hard
why am I doing this to myself

Thanks for putting in the work for the rest of us @dcastil 👍

@dcastil
Copy link
Contributor Author

dcastil commented Nov 23, 2020

@arshad Haha yes, I was fighting TypeScript and as I fixed type bugs, new came up again and again. 😄 But now it works!

@hasparus
Copy link
Member

I'll handle the conflicts and changelog.

@hasparus hasparus merged commit f011561 into system-ui:master Nov 25, 2020
@dcastil dcastil deleted the add-support-for-automatic-jsx-runtime branch November 26, 2020 07:36
@lachlanjc lachlanjc mentioned this pull request Jan 21, 2021
@dbertella
Copy link

@dcastil is there any additional library to install in order to use jsxImportSource because at the moment I can't get it to work with the example in the readme. I opened an issue here if you need more context #1474 not sure if I'm just missing something very obvious here. Thanks!

@hasparus
Copy link
Member

@dbertella's comment is already answered in another issue, but I'll leave this here for posterity.

To use Theme UI with automatic runtime you need Theme UI version greater than 0.5.0-alpha.

However, classic runtime still works, so if you're already using it you don't need to migrate, it's possible to configure this in your Babel config or by setting DISABLE_NEW_JSX_TRANSFORM=true env var in CRA (see #1474 (comment)).

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.

Syntax error: pragma and pragmaFrag cannot be set when runtime is automatic.
6 participants