-
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
chore: bump loaders and optimize webpack configuration #27505
chore: bump loaders and optimize webpack configuration #27505
Conversation
b00199c
to
bb29ce3
Compare
async (exec) => { | ||
const { stdout } = await exec() | ||
|
||
expect(stdout).to.include('Your system is missing the dependency: Xvfb') | ||
}, | ||
) | ||
|
||
// TODO: Where is this image located? Needs to be bumped to Node 16.16.0 or later | ||
smokeTestDockerImage( |
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.
anyone have any ideas? this doesn't live in the docker images repo AFAIK
5c637cc
to
089ce60
Compare
8 flaky tests on run #49751 ↗︎
Details:
cypress\e2e\scaffold-project.cy.ts • 1 flaky test • launchpad-e2e
cypress\e2e\scaffold-component-testing.cy.ts • 1 flaky test • launchpad-e2e
cypress\e2e\config-warning.cy.ts • 1 flaky test • launchpad-e2e
cypress\e2e\error-handling.cy.ts • 2 flaky tests • launchpad-e2e
cypress\e2e\specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e
The first 5 flaky specs are shown, see all 7 specs in Cypress Cloud. This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
089ce60
to
376ac5d
Compare
@@ -149,6 +151,8 @@ describe('e2e forms', () => { | |||
}) | |||
|
|||
systemTests.it('passes with http on localhost', { | |||
// FIXME: webkit is 404ing on redirects after the form submit on the default clientRoute /__/ | |||
browser: '!webkit', |
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 can't get these to pass on develop
locally as well with webkit (pre webpack 5 updates)
2d348f8
to
dd5beff
Compare
changes are rebased off of |
script > 2.6.0 has issues with packheard transpilation, which likely isnt worth the squeeze here to update it further
… works with webpack 5, so we need ot pin the dep to 8 in the system-test project
…andling where applicable. Additionally, remove react-svg-loader and move to svgr loader inside the runner to bundle svgs needed for react components. Make sure that all SVGs are being imported correctly chore: tell webpack preprocessor to process svgs inside of e2e tests for the reporter. We did not need this before because we were using react-svg-loader, which was used directly in source to process the svg and allowed the svg to work under test. Since the source code is now bundler independent, we need to tell cypress to bundle the svgs under test. To do this, we pass our webpack config into @cypress/webpack-preprocessor to allow loading the svgs. This is not a breaking change.
…y better and handle caching/debugging better
…nger supported. node 12 doesnt ship with fs/promises, which causes fatal errors with babel-loader 9 try to test against new docker images [run ci]
… to the clientRoute 404ing after submitting
… 4 from hoisted deps [run ci]
…s within the svg. see https://react-svgr.com/docs/options/#svgo [run ci]
dd5beff
to
661f07c
Compare
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
As a follow up to #27438, this PR follows the clean up configuration guide set forth by webpack on the 4 -> 5 update and is the last step in the upgrade. This includes:
Bumping loaders to latest
loaders
ts-loader
fromv8
tov9
fbff60f release notes (node version deprecation and min webpack 5 support)sass-loader
fromv10
tov13
1afd7d3 release notes (node version deprecation and min webpack 5 support).tilda
imports are deprecated and aren't needed (same withcss-loader
) and have been removed see v11 release notespostcss-loader
fromv4
tov7
ed6ed1b release notes (node version deprecation and min webpack 5 support)css-loader
fromv5
tov6
3c6d1ee release notes (option changes that don't effect us, node version deprecation and min webpack 5 support). theesModules
config is enabled by default, which we can opt to turn off if needed.tilda
imports are deprecated now, which was addressed with thesass-loader
commit.babel-loader
fromv8
tov9
37840fd release notesbabel-loader
v9
, babel^7.12.0
must be used and greater than Nodev14
is needed.latest@7
, which entails:@babel/plugin-proposal-class-properties
is no longer a proposal and is now@babel/plugin-transform-class-properties
@babel/plugin-proposal-object-rest-spread
is no longer a proposal and is now@babel/plugin-transform-object-rest-spread
@babel/plugin-transform-private-methods
and@babel/plugin-transform-private-property-in-object
are added intowebpack.config.base.ts
to reduce warnings ofloose: true
for@babel/plugin-proposal-class-properties
and@babel/plugin-proposal-object-rest-spread
asloose: false
is the default. Ifloose: true
is enabled for@babel/plugin-proposal-class-properties
and@babel/plugin-proposal-object-rest-spread
, it must be enabled for@babel/plugin-transform-private-methods
and@babel/plugin-transform-private-property-in-object
as well.webpack@4
tests had a dependency onbabel-loader@8
, I needed to pin it in thepackage.json
of the system-tests to keep the dependency trees as expected 31e3a3ecoffee-loader
fromv1
tov4
andcoffeescript
fromv1
tov2.6
9a7f0bf release notes.[email protected]
has issues with packherd and didn't seem worth investigating at this timefile-loader
as it deprecated will no longer be supported 4a8ecfe. This means a few things:inside the
webpack.config.base.ts
, we now use the preferredasset/resource
type for:eot
,ttf
,woff
, andwoff2
png
andgif
(the rule is configured but there are no image assets in the build), hence the removalpngRule
inside@packages/runner
The options are slightly different for
asset/resource
->filename
then they are forfile-loader
->options.name
, but the files resolve to the same spot. This can be verified by runningyarn build
inside@packages/runner
svg
s are NOT handled byasset/resource
loading (as none exist to my knowledge). What we were previously doing is leverage react-svg-loader (which is no longer maintained) inside@packages/runner
src files to tell webpack how to process the file since we didn't have the loader declared in config. To modernize the loader config, 4a8ecfe also:react-svg-loader
including direct references to loader importing inside@packages/reporter
src code which further decouples the src from the bundling (most agree this is a good thing)@svgr/webpack
overreact-svg-loader
forjsx
/tsx
files inside@packages/reporter
. Since we no longer have explicit loader references inside the source, our reporter E2E tests need to know how to processsvg
s insidetsx
/jsx
files under test. For this, we pass the@packages/reporter
webpack configuration into the@cypress/webpack-preprocessor
inside thefile:preprocessor
plugin event insidecypress.config.ts
Plugins
mini-css-extract-plugin
fromv1
tov2
811cdca release notes (option changes that do not effect our config, node version deprecation and min webpack 5 support)html-webpack-plugin
fromv4
tov5
8ba2524 release notes (option changes that do not effect our config, node version deprecation and min webpack 5 support)copy-webpack-plugin
fromv6
tov11
379dc94 release notes (option changes that don't effect us, node version deprecation and min webpack 5 support)Making small optimizations and fixing build warnings
Url
import from validation code as it should be available as global built in d85c75chash
to usecontenthash
as recommended by clean up configuration guide b668c30moduleIds
andchunkIds
fromwebpack.config.base.ts
as the defaults are likely better, which is also recommended in clean up configuration guide 3f8a2e5Misc Changes
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?