-
Notifications
You must be signed in to change notification settings - Fork 915
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
+74
−93
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,5 +33,4 @@ module.exports = babelJest.createTransformer({ | |
}, | ||
], | ||
], | ||
plugins: ["@babel/plugin-syntax-import-meta"], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
{ | ||
"presets": [["@babel/preset-react"], "@babel/preset-typescript"], | ||
"plugins": ["@babel/plugin-syntax-import-meta"], | ||
"env": { | ||
"development": { | ||
"plugins": ["react-refresh/babel"] | ||
} | ||
} | ||
"presets": [["@babel/preset-react"], "@babel/preset-typescript"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
create-snowpack-app/app-template-react-typescript/babel.config.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7506,26 +7506,26 @@ document.head.appendChild(styleEl);" | |
`; | ||
|
||
exports[`create-snowpack-app app-template-react: _dist_/App.js 1`] = ` | ||
"import React, { useState } from '../web_modules/react.js'; | ||
import logo from './logo.svg.proxy.js'; | ||
import './App.css.proxy.js'; | ||
function App() { | ||
return /*#__PURE__*/React.createElement(\\"div\\", { | ||
"import React, {useState} from \\"../web_modules/react.js\\"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
import logo2 from \\"./logo.svg.proxy.js\\"; | ||
import \\"./App.css.proxy.js\\"; | ||
function App2() { | ||
return /* @__PURE__ */ React.createElement(\\"div\\", { | ||
className: \\"App\\" | ||
}, /*#__PURE__*/React.createElement(\\"header\\", { | ||
}, /* @__PURE__ */ React.createElement(\\"header\\", { | ||
className: \\"App-header\\" | ||
}, /*#__PURE__*/React.createElement(\\"img\\", { | ||
src: logo, | ||
}, /* @__PURE__ */ React.createElement(\\"img\\", { | ||
src: logo2, | ||
className: \\"App-logo\\", | ||
alt: \\"logo\\" | ||
}), /*#__PURE__*/React.createElement(\\"p\\", null, \\"Edit \\", /*#__PURE__*/React.createElement(\\"code\\", null, \\"src/App.jsx\\"), \\" and save to reload.\\"), /*#__PURE__*/React.createElement(\\"a\\", { | ||
}), /* @__PURE__ */ React.createElement(\\"p\\", null, \\"Edit \\", /* @__PURE__ */ React.createElement(\\"code\\", null, \\"src/App.jsx\\"), \\" and save to reload.\\"), /* @__PURE__ */ React.createElement(\\"a\\", { | ||
className: \\"App-link\\", | ||
href: \\"https://reactjs.org\\", | ||
target: \\"_blank\\", | ||
rel: \\"noopener noreferrer\\" | ||
}, \\"Learn React\\"))); | ||
} | ||
export default App;" | ||
export default App2;" | ||
`; | ||
|
||
exports[`create-snowpack-app app-template-react: _dist_/index.css 1`] = ` | ||
|
@@ -7556,12 +7556,11 @@ document.head.appendChild(styleEl);" | |
exports[`create-snowpack-app app-template-react: _dist_/index.js 1`] = ` | ||
"import __SNOWPACK_ENV__ from '../__snowpack__/env.js'; | ||
import.meta.env = __SNOWPACK_ENV__; | ||
import React from '../web_modules/react.js'; | ||
import ReactDOM from '../web_modules/react-dom.js'; | ||
import App from './App.js'; | ||
import './index.css.proxy.js'; | ||
ReactDOM.render( /*#__PURE__*/React.createElement(React.StrictMode, null, /*#__PURE__*/React.createElement(App, null)), document.getElementById('root')); // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. | ||
// Learn more: https://www.snowpack.dev/#hot-module-replacement | ||
import React from \\"../web_modules/react.js\\"; | ||
import ReactDOM from \\"../web_modules/react-dom.js\\"; | ||
import App2 from \\"./App.js\\"; | ||
import \\"./index.css.proxy.js\\"; | ||
ReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App2, null)), document.getElementById(\\"root\\")); | ||
if (import.meta.hot) { | ||
import.meta.hot.accept(); | ||
}" | ||
|
@@ -8021,26 +8020,26 @@ document.head.appendChild(styleEl);" | |
`; | ||
|
||
exports[`create-snowpack-app app-template-react-typescript: _dist_/App.js 1`] = ` | ||
"import React from '../web_modules/react.js'; | ||
import logo from './logo.svg.proxy.js'; | ||
import './App.css.proxy.js'; | ||
function App({}) { | ||
return /*#__PURE__*/React.createElement(\\"div\\", { | ||
"import React from \\"../web_modules/react.js\\"; | ||
import logo2 from \\"./logo.svg.proxy.js\\"; | ||
import \\"./App.css.proxy.js\\"; | ||
function App2({}) { | ||
return /* @__PURE__ */ React.createElement(\\"div\\", { | ||
className: \\"App\\" | ||
}, /*#__PURE__*/React.createElement(\\"header\\", { | ||
}, /* @__PURE__ */ React.createElement(\\"header\\", { | ||
className: \\"App-header\\" | ||
}, /*#__PURE__*/React.createElement(\\"img\\", { | ||
src: logo, | ||
}, /* @__PURE__ */ React.createElement(\\"img\\", { | ||
src: logo2, | ||
className: \\"App-logo\\", | ||
alt: \\"logo\\" | ||
}), /*#__PURE__*/React.createElement(\\"p\\", null, \\"Edit \\", /*#__PURE__*/React.createElement(\\"code\\", null, \\"src/App.tsx\\"), \\" and save to reload.\\"), /*#__PURE__*/React.createElement(\\"a\\", { | ||
}), /* @__PURE__ */ React.createElement(\\"p\\", null, \\"Edit \\", /* @__PURE__ */ React.createElement(\\"code\\", null, \\"src/App.tsx\\"), \\" and save to reload.\\"), /* @__PURE__ */ React.createElement(\\"a\\", { | ||
className: \\"App-link\\", | ||
href: \\"https://reactjs.org\\", | ||
target: \\"_blank\\", | ||
rel: \\"noopener noreferrer\\" | ||
}, \\"Learn React\\"))); | ||
} | ||
export default App;" | ||
export default App2;" | ||
`; | ||
|
||
exports[`create-snowpack-app app-template-react-typescript: _dist_/index.css 1`] = ` | ||
|
@@ -8071,12 +8070,11 @@ document.head.appendChild(styleEl);" | |
exports[`create-snowpack-app app-template-react-typescript: _dist_/index.js 1`] = ` | ||
"import __SNOWPACK_ENV__ from '../__snowpack__/env.js'; | ||
import.meta.env = __SNOWPACK_ENV__; | ||
import React from '../web_modules/react.js'; | ||
import ReactDOM from '../web_modules/react-dom.js'; | ||
import App from './App.js'; | ||
import './index.css.proxy.js'; | ||
ReactDOM.render( /*#__PURE__*/React.createElement(React.StrictMode, null, /*#__PURE__*/React.createElement(App, null)), document.getElementById('root')); // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. | ||
// Learn more: https://www.snowpack.dev/#hot-module-replacement | ||
import React from \\"../web_modules/react.js\\"; | ||
import ReactDOM from \\"../web_modules/react-dom.js\\"; | ||
import App2 from \\"./App.js\\"; | ||
import \\"./index.css.proxy.js\\"; | ||
ReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App2, null)), document.getElementById(\\"root\\")); | ||
if (import.meta.hot) { | ||
import.meta.hot.accept(); | ||
}" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)