Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Support jsx-transform for React extensions #127

Open
vividviolet opened this issue Oct 26, 2021 · 10 comments · Fixed by Shopify/cli#577
Open

Support jsx-transform for React extensions #127

vividviolet opened this issue Oct 26, 2021 · 10 comments · Fixed by Shopify/cli#577
Labels
future-work This will not be worked on for the upcoming release javascript

Comments

@vividviolet
Copy link
Member

React 17 has support for jsx without React: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html

Our ESBuilder needs to also add this support as it doesn't come for free. More info in this issue: evanw/esbuild#334

@vividviolet vividviolet created this issue from a note in Shopify CLI Extensions (To do) Oct 26, 2021
@t6d t6d added the future-work This will not be worked on for the upcoming release label Nov 2, 2021
@t6d
Copy link
Contributor

t6d commented Nov 2, 2021

Is this required for the initial release or just a nice to have?

@t6d t6d moved this from To do to On Hold in Shopify CLI Extensions Nov 2, 2021
@vividviolet
Copy link
Member Author

I think we need to have this since the current build tool support it. I'll look into whether this is feasible. If it's not we'd need to add a disclaimer into our release notes that React is required for jsx even if you're not using any specific React methods or hooks

@marvinhagemeister
Copy link
Contributor

FYI: esbuild added support for the jsx-runtime transform recently: evanw/esbuild#334

@jamesvidler
Copy link
Contributor

Is this still required for GA?

@jamesvidler
Copy link
Contributor

@vividviolet is this still something we think is important for GA?

@vividviolet
Copy link
Member Author

I think so - it used to work with the old build tools so we'd just be putting back something that's missing

@jamesvidler
Copy link
Contributor

@vividviolet are you able to share some context you have on how we might go ahead and implement this?

@cpeddecord
Copy link
Contributor

@jamesvidler
Copy link
Contributor

Closing this issue - was resolved in Shopify/cli#577.

@jamesvidler
Copy link
Contributor

jamesvidler commented Oct 5, 2022

Re-opening this because we only implemented this the Node CLI, not the Go CLI. The Node CLI isn't used publicly yet.

Jsx implementation in Node
Follow-up PR to add-back the React import when using Go

To close this issue:
We should remove the import React from 'react'; from the checkout ui extension template BUT only if:

  1. Wait until Node CLI flow is being used publicly and Go CLI is not longer used
  2. OR implement the jsx-transform in the GO CLI

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
future-work This will not be worked on for the upcoming release javascript
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants