-
Notifications
You must be signed in to change notification settings - Fork 68
Upgrade to Neutrino 9 beta #158
Conversation
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.
Some additional changes:
- the
config.devtool('source-map')
can now be replaced by the new built-indevtool
web preset option (https://master.neutrinojs.org/packages/web/#source-maps) - the web preset's
env
option now allows defaults to be specified, meaning most of the manual env handling in this file can be replaced (https://master.neutrinojs.org/packages/web/#environment-variables) - the manual
neutrino.config.output.publicPath('/')
can be replaced by thepublicPath
option to the web preset - the
links
property of the web preset'shtml
option will no longer have any effect (since the underlying template has changed). you'll want to either (a) switch to importing the fonts from an NPM package, (b) copy the default template and add the link there then point at the template using thetemplate
option, or (c) find an html-webpack-plugin plugin (see here) that can add them automatically to the existing template
Unrelated to the upgrade but I also spotted these:
warning " > metrics-graphics@2.12.0" has unmet peer dependency "jquery@>=1.11.1".
warning " > react-metrics-graphics@1.0.2" has incorrect peer dependency "react@^0.14.0".
warning " > react-metrics-graphics@1.0.2" has incorrect peer dependency "react-dom@^0.14.0".
warning " > postcss-cssnext@2.11.0" has unmet peer dependency "caniuse-db@^1.0.30000652".
package.json
Outdated
"start": "webpack-dev-server --mode development", | ||
"start:local": "BACKEND=http://localhost:3000 webpack-dev-server --mode development", | ||
"test": "jest", | ||
"lint": "eslint --cache --ext mjs,jsx,js src", |
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.
If you'd like tests to be linted too, make this end in src tests
rather than just src
.
Also for parity with the yarn start
/ yarn build
console output, optionally add --formatter codeframe
.
Hi @edmorley thanks for your help. In general I see this warning: WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ If I add the 'web' preset I get this failure:
If I comment out the 'web' preset I get this failure instead:
|
Also, any info about the favicon?
|
I'm going to try to drop PostCss since it is always getting on the way. |
That will be fixed by setting |
|
Hi @edmorley this is ready to be reviewed. Thanks! |
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 haven't tested locally but the Neutrino-related changes look great!
Before merging I'd recommend also doing one last rm -r yarn.lock node_modules && yarn
to refresh the lockfile and pick up latest versions.
Thanks for looking! |
It was no trouble at all - glad I could help :-) |
// Read https://stackoverflow.com/a/36623117 | ||
// This is the key to making React Router work with neutrino | ||
// Fix issue with nested routes e.g /index/garbage | ||
publicPath: '/', |
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've been looking into how output.publicPath
and devServer.publicPath
works for some Neutrino cleanup - and remembered seeing this here. I think this may not be necessary? Reading the linked Stack Overflow issue, the problem is really fixed by using historyApiFallback
, which Neutrino has enabled for some time.
Could you try removing it and confirming that both dev and prod builds work as expected? If they don't then it might be a bug that we could fix upstream.
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 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.
Ah I see - I've done some reading up on this area and think Neutrino could be setting better defaults here. I've filed:
neutrinojs/neutrino#1171
No description provided.