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

refactor react-refresh plugin, babel user-dependency no longer needed #1178

Merged
merged 2 commits into from
Oct 2, 2020

Conversation

FredKSchott
Copy link
Owner

Changes

  • Follow up from debugging with @melissamcewen
  • For react users, replacing your build with Babel is a huge ask just to enable Fast Refresh
  • Instead, we pull Babel into the fast-refresh plugin to run by default (option added for older behavior).
  • This dramatically simplifies the CSA apps (no longer need Babel for build pipeline, can rely on faster, internal esbuild engine)

Testing

  • Tested manually.

Docs

  • Readme docs updated.

@FredKSchott FredKSchott requested a review from a team as a code owner October 1, 2020 23:44
@vercel
Copy link

vercel bot commented Oct 1, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/edpg63026
✅ Preview: https://snowpack-git-refactor-react-refresh.pikapkg.vercel.app

@@ -1,9 +1,3 @@
{
"presets": [["@babel/preset-react"], "@babel/preset-typescript"],
"plugins": ["@babel/plugin-syntax-import-meta"],
Copy link
Owner Author

Choose a reason for hiding this comment

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

somewhat related: tested with Melissa to confirm that this is no longer needed (included by default by Babel)

import './App.css.proxy.js';
function App() {
return /*#__PURE__*/React.createElement(\\"div\\", {
"import React, {useState} from \\"../web_modules/react.js\\";
Copy link
Owner Author

Choose a reason for hiding this comment

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

we now use esbuild instead of Babel in this app, which created the output changes here

@FredKSchott FredKSchott merged commit d69dbfe into master Oct 2, 2020
@FredKSchott FredKSchott deleted the refactor-react-refresh branch October 2, 2020 19:41
@Jack-Works
Copy link
Contributor

facebook/react#19914

Hi @FredKSchott, with this PR, TypeScript users can use react-refresh without babel totally. Please consider it

@FredKSchott
Copy link
Owner Author

That PR does not apply to Snowpack. Fast Refresh in Snowpack supports both JS & TS (you can try out our latest React TS template to confirm)

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

3 participants