-
Notifications
You must be signed in to change notification settings - Fork 326
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
Upgrade webpack to version 5 #6690
Upgrade webpack to version 5 #6690
Conversation
abc680a
to
1538bb9
Compare
While it did first look good to build with webpack 5 there are issues with the |
I think I would be okay with replacing the |
822516f
to
3e75f1b
Compare
b370efc
to
0611b07
Compare
0611b07
to
a1d2edb
Compare
"mobx": "^4.0.0", | ||
"mobx-react": "^5.0.0", | ||
"moment-timezone": "^0.5.14", | ||
"optimize-css-assets-webpack-plugin": "^6.0.1", |
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.
replaced by css-minimizer-webpack-plugin
: https://github.com/NMFR/optimize-css-assets-webpack-plugin
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1", | ||
"autoprefixer": "^9.8.6", | ||
"babel-eslint": "^10.0.2", | ||
"babel-jest": "^26.3.0", | ||
"babel-loader": "^8.0.6", | ||
"clean-webpack-plugin": "^4.0.0", |
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.
think we not longer need this with clean: true
@@ -87,10 +86,9 @@ | |||
"stylelint": "^13.2.1", | |||
"stylelint-config-standard": "^22.0.0", | |||
"url-search-params-polyfill": "^8.0.0", | |||
"webpack": "^4.27.0", | |||
"webpack-clean-obsolete-chunks": "^0.4.0", |
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.
The clean: true
is the new way for this: https://github.com/GProst/webpack-clean-obsolete-chunks
// set path to public root from bundled css: https://github.com/sulu/sulu/pull/6225 | ||
publicPath: path.relative(outputPath, '.'), |
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.
not longer required as all pathes in css/js are relative
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.
this is nice 🥳 i think the reason we dont need it anymore is because we configure the MiniCssExtractPlugin
with a relative filename
option
@@ -4,8 +4,8 @@ import {observer} from 'mobx-react'; | |||
import {action, computed, observable} from 'mobx'; | |||
import classNames from 'classnames'; | |||
import log from 'loglevel'; | |||
import IsEmail from 'isemail'; |
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.
Was never planned by the package to support browsers. They only support node based applications.
return false; | ||
} | ||
|
||
return /^(.+)@(.+)$/.test(value); |
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.
This is very dump regex. Not sure how strict we should even implement things here. /cc @sulu/core-team
We definitely should not be too strict in case of supporting also local and intranet domains @localhost
, @massive.local
, ...
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.
Looks like there is a official regex by whatwg:
Its also used inside the safari webkit browser: https://github.com/WebKit/WebKit/blob/e205a844146bab749642d1b88974b706fe4d9e7e/Source/WebCore/html/EmailInputType.cpp#L38-L39
@@ -89,14 +88,12 @@ | |||
"react-styleguidist": "^11.0.5", | |||
"react-test-renderer": "^17.0.0", | |||
"regenerator-runtime": "^0.13.3", | |||
"style-loader": "^2.0.0", |
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 removed this as it seems not longer be used by us, think the css extract is working differently for us. And in the skeleton it was not even installed.
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.
maybe it was used by react-styleguidist
? 🤔
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.
okay i think this was a leftover from a previous ckeditor configuration that was copied from their documentation: https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/integrating-from-source.html
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.
yes did see it in the ckeditor and I was thinking that I already once had that case. That I tried to use the style-loader but did then come to the conclution that it isn't compatible or require for our setup.
test('Email address with emojis should pass validation', () => { | ||
expect(idnEmailValidator('🤌@😎')).toBe(true); | ||
}); | ||
|
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.
Test was introduced by @luca-rath in #5815 but even browsers yet does not support this. So I think we can safely remove it:
db9855e
to
c276099
Compare
c276099
to
2fd8226
Compare
Co-authored-by: Niklas Natter <niklas.natter@gmail.com>
@@ -42,7 +42,7 @@ | |||
|
|||
.selectMultipleButtonContainer { | |||
display: flex; | |||
justify-content: end; |
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.
was this change intentional?
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.
yes autoprefixer did complain that flex-end
is supported better then end
and has same effect and did output a warning message about this line.
publicPath, | ||
clean: true, | ||
path: path.resolve(projectRootPath, publicDir, outputPath), | ||
filename: '[name].[chunkhash].js', | ||
}, | ||
stats: 'minimal', | ||
performance: { | ||
hints: false, | ||
}, | ||
devtool: argv.mode === 'development' ? 'eval-source-map' : 'source-map', |
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.
the build process works for me and the result looked good during my testing 🥳
unfortunately, it looks like our npm run watch
task does not work anymore. right now, i see the changes only after restarting the watch task
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.
the output of my console indicates that the change was detected, but no changes are written to the filesystem if i change the sulu source code
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.
okay i suspect that this is somehow caused by the location of the code of Sulu 😢 if i change the code of the assets/admin/app.js
file, the watch task works as expected. maybe files are not reloaded if they are located within the node_modules
folder?
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.
okay it looks like we are running into this issue: webpack/webpack#11612
adding the following to the configuration fixes the behaviour of the watch task:
snapshot: {
// detect changes in "node_modules/@sulu": https://github.com/webpack/webpack/issues/11612
managedPaths: [],
},
Co-authored-by: Niklas Natter <niklas.natter@gmail.com>
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.
🥳
🎉 |
requires #6688, sulu/skeleton#201What's in this PR?
Upgrade webpack to version 5.
Why?
Support latest version of webpack.
TODO
util
,process
packages viaisemail
package.Buffer
package see own js