-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(npm/webpack-preprocessor): WIP support webpack 5 alongside webpack 4 #16493
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
Surprising that there's so little to be done. Doesn't seem like it will cause adverse effects.
@@ -330,8 +330,6 @@ const preprocessor: WebpackPreprocessor = (options: PreprocessorOptions = {}): F | |||
// when we should watch, we hook into the 'compile' hook so we know when | |||
// to rerun the tests | |||
if (file.shouldWatch) { | |||
debug('watching') |
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.
lol what's wrong with this debug message?
Possibly related: Why do we always set up the Webpack 4 hook, even with Webpack 5, in cypress/npm/webpack-dev-server/src/plugin.ts Lines 88 to 103 in a19009a
|
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 you should bring back the debug message. But this looks good
…ck 4 (#16493) * feat: support webpack 5 alongside webpack 5 * revert code
I think the peerDependeny in
|
@WIStudent you are absolutely right. Can you create an issue so that we don't forget to fix it? Thank you in advance. |
User facing changelog
Experimental support for webpack v5 alongside webpack v4 in
@cypress/webpack-preprocessor
.Additional details
Initially, I tried to make a
next
version of@cypress/webpack-preprocessor
that would support Webpack 5. I then updated all the dependencies in the monorepo to webpack 5, and tried to get everything to pass.I got everything to compile. I got most of the tests to pass, but not all. A lot of our dependencies (or their dependencies, etc) are coupled to webpack 4.
The main problem is that webpack 5 deprecated auto polyfills of node modules. I tried a few things, like using a polyfill, providing custom implementations. It got pretty close to passing (around 95% of specs passing in
packages
).There are some hard blockers:
npm/react/examples
andnpm/webpack-preprocessor/examples
can never pass. Specifically, ones using tools like CRA, which have not yet upgraded to Webpack 5.For now, I think we should try and support webpack 4 an 5 alongside each other, like I've done here. The next version of
@cypress/webpack-preprocessor
, which will be v6, will drop support for Webpack 4. At this point we should transition Cypress to use webpack 5 internally, too. It's a big change, so it might take some time. This is another compelling reason to do this incremental update.How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?