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 jsx-transform support to extensions build #577

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

faouzioudouh
Copy link
Contributor

@faouzioudouh faouzioudouh commented Oct 5, 2022

Trying to resolve this issue
This is my first PR here, if the fix is not enough/wrong feel free to direct me to the proper way to handle it.

WHY are these changes introduced?

React 17 has support for jsx without explicit React import, we want to have the same experience when building checkout extensions

WHAT is this pull request doing?

Added automatic option for esbuild options, to allow auto import of React
More details: https://esbuild.github.io/api/#jsx

How to test your changes?

  • Create an checkout extension
  • choose typescript-react template
  • Observe tsconfig.json file is generated
  • Make sure react is not imported in your component files
  • After building/deploying make sure you don't see React not defined error in your console

Screenshot 2022-10-05 at 13 36 15

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

@faouzioudouh faouzioudouh requested a review from a team October 5, 2022 12:02
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "yarn changeset add" to track your changes and include them in the next release CHANGELOG.

Copy link
Contributor

@misha-reyzlin-shopify misha-reyzlin-shopify left a comment

Choose a reason for hiding this comment

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

🎩 'd with development store, works great! 🚀

Copy link
Contributor

@jamesvidler jamesvidler left a comment

Choose a reason for hiding this comment

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

Nicely done! I tophatted this as well by deploying to my prod development store.

@faouzioudouh faouzioudouh force-pushed the add-jsx-transform-support-to-extensions-build branch from 22ea3ca to b02e2ff Compare October 5, 2022 15:23
@faouzioudouh faouzioudouh merged commit 985fd5f into main Oct 5, 2022
@shopify-shipit shopify-shipit bot temporarily deployed to production October 5, 2022 16:23 Inactive
Copy link
Member

@lemonmade lemonmade left a comment

Choose a reason for hiding this comment

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

Thank you so much for doing this!

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.

Support jsx-transform for React extensions
5 participants