-
Notifications
You must be signed in to change notification settings - Fork 213
Migrate react preset and create-project to properly use RHL v4 #902
Conversation
(For reviewing reference) Migration guide: |
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.
Yey for more things updated! 😃
@@ -10,16 +10,21 @@ module.exports = (neutrino, opts = {}) => { | |||
const mode = neutrino.config.get('mode'); | |||
const options = merge({ | |||
hot: true, | |||
hotEntries: [require.resolve('react-hot-loader/patch')], |
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.
There are now no default hotEntries
in any of the presets that inherit web
(or in web
itself). Should we now remove hotEntries
from the web preset entirely?
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.
I'm thinking so.
|
||
For example: | ||
For example, if your `src/index` main entry renders a root component from | ||
`App.jsx`, then the exported component needs to have a hot export: |
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.
Should we add a link to the RHL docs?
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.
Yeah, that would be good.
I don't want to land this until #917 lands and I can bump the RHL major version installed in create-project. |
@@ -219,17 +218,6 @@ module.exports = (neutrino, opts = {}) => { | |||
config.devtool('cheap-module-eval-source-map'); | |||
config.when(options.hot, () => { | |||
neutrino.use(hot); | |||
config.when(options.hotEntries, (config) => { |
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.
I think we should add a check for hotEntries
so the user knows to clean up their config (and also why things aren't working if they rely on it) - like we do for the deprecated options.minify
options above.
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.
Good call.
Updated PR to upgrade create-project's install of RHL to v4. |
No description provided.