-
Notifications
You must be signed in to change notification settings - Fork 220
Update quilt packages to support webpack 5 #2013
Conversation
dbb83fc
to
a778d68
Compare
c008ab4
to
5dd5e31
Compare
Co-authored-by: Michelle Chen <[email protected]> Co-authored-by: Ates Goral <[email protected]>"
"@types/loader-utils": "^1.1.3", | ||
"common-tags": "^1.8.0" | ||
"common-tags": "^1.8.0", | ||
"webpack": "^5.40.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.
❤️
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 assuming this looks good as I'm very light on webpack context.
One question: Previously we had had webpack dependencies for ^4.BLAH
(as single major version) and we've widened them up to >=5.BLAH
so now when webpack 6 comes along these packages will claim to work. Do we feel good about that being the case in webpack 6? (In the past we've done this for lint tooling where we doubt be public API will change much but it seems like when webpack does a major version everything changes.)
"webpack": "^5.40.0" | ||
}, | ||
"peerDependencies": { | ||
"webpack": ">=5.38.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.
Is webpack here used just for types? If that's the case can we mark it as an optional peer dependency? https://github.com/Shopify/loom/blob/06c44051385af276a1982a583b34aeac6160c75f/packages/loom-plugin-babel/package.json#L45-L48
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 catch. Updated.
Bonsu thought: Whats the migration path like for these packages? Is there anything that consumers need to change as part of bumping to the new major versions? |
{...options, kind: AssetKind.Scripts}, | ||
await this.getResolvedManifest(options.locale), | ||
); | ||
|
||
const scripts = |
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 seems like a breaking change that should have some attention drawn to it
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 right. We dropped the vendor dll in sewing-kit.
packages/react-server/package.json
Outdated
"node-loader": "^1.0.0", | ||
"react": "^17.0.2", | ||
"react-dom": "17.0.2", | ||
"saddle-up": "^0.5.4", | ||
"setimmediate": "^1.0.5", | ||
"webpack": "^4.25.1" | ||
"webpack": ">=5.40.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.
Should this be 5.38?
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.
Yep! Fixed
@@ -61,7 +59,7 @@ async function loadDocument( | |||
loader.resolve(resolveContext, imported, (error, result) => { | |||
if (error) { | |||
reject(error); | |||
} else { | |||
} else if (result) { |
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.
Do we still want a default?
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 catch. Updated.
const serverModule = getModule(serverResults, 'server'); | ||
const [client, clientIndex, server] = await runBuild(name, [ | ||
DEFAULT_CLIENT_FILE_PATH, | ||
'client/index.js', |
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 seems strange that you pass two client entries and return all three.
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 provided list is a list of files we want to test the contents of.
So its asking for the contents of:
DEFAULT_CLIENT_FILE_PATH
, client/index.js
, DEFAULT_SERVER_FILE_EPATH
.
It doesn't affect the compilation and is just a test utility.
There is a mistake in that EPATH
should be PATH
.
const compiler: Compiler = webpack(contextConfig); | ||
compiler.outputFileSystem = new MemoryOutputFileSystem({}); | ||
// We use memfs.fs to prevent webpack from outputting to our actual FS |
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.
❤️
@@ -65,7 +65,7 @@ export function runWebpack( | |||
(error, stats) => { | |||
if (error) { | |||
reject(error); | |||
} else if (stats.hasErrors()) { | |||
} else if (stats && stats.hasErrors()) { |
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.
stats can now be falsy in v5?
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.
they can be undefined.
version "8.4.0" | ||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.0.tgz#af53266e698d7cffa416714b503066a82221be60" | ||
integrity sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w== | ||
acorn@^8.2.4, acorn@^8.4.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.
We have both acorn 7 and 8?
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. 7 is still here because of espree
which is imported by loom.
=> Found "espree#[email protected]"
info This module exists because "_project_#@shopify#loom-plugin-eslint#eslint#espree" depends on it.
=> Found "acorn-globals#[email protected]"
info This module exists because "_project_#@shopify#loom-plugin-jest#jest#@jest#core#jest-config#jest-environment-jsdom#jsdom#acorn-globals" depends on it.
I think @BPScott recent work updating web-configs will help here.
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.
Indeedy my eslint 8 PR bumps espree from v7.x to v9.x, which in turn bumps the transitive dep on acorn from 7.x to 8.x. Which fixes the eslint transitive dependency. Nothing to fix the jsdom one though
string_decoder "^1.1.1" | ||
util-deprecate "^1.0.1" | ||
|
||
readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@~2.3.6: |
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.
dedupe?
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 tried, I haven't been able too
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.
Couple of small questions but nothing major. 🏅
👋 It looks like you're updating JavaScript packages that are known You can deduplicate them with the
A duplicate React version may cause an invalid hook call warning. React context providers usually use module-scoped globals as their |
They just need to be on webpack 5. They are drop in replacements with no actual changes other than the webpack dependency update. |
Description
This PR updates packages with
webpack
support to version 5.Fixes (issue #)
Type of change
@shopify/jest-dom-mocks
Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)graphql-mini-transforms
Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)@shopify/react-server
Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)@shopify/sewing-kit-koa
Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)@shopify/web-worker
Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)Checklist