Page MenuHomePhabricator

Update to Webpack 5
ClosedPublic

Authored by ashoat on Feb 12 2023, 6:47 PM.
Tags
None
Referenced Files
F3486296: D6699.diff
Wed, Dec 18, 4:27 AM
Unknown Object (File)
Tue, Dec 3, 1:16 PM
Unknown Object (File)
Thu, Nov 21, 8:05 PM
Unknown Object (File)
Thu, Nov 21, 2:09 AM
Unknown Object (File)
Nov 12 2024, 9:52 AM
Unknown Object (File)
Nov 11 2024, 4:44 AM
Unknown Object (File)
Nov 11 2024, 4:42 AM
Unknown Object (File)
Nov 8 2024, 10:46 AM
Subscribers
None

Details

Summary

I followed the official docs to update to Webpack 5. Details will be explained inline.

Depends on D6698

Test Plan
  1. I tested dev build in web via yarn dev in web + keyserver and then tested the website
  2. I tested prod build by running yarn prod in web and then tested the website by running keyserver with yarn prod-build && yarn-prod
  3. I tested native, just in case

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 12 2023, 6:59 PM
Harbormaster failed remote builds in B16351: Diff 22353!

Please ignore failing CI – it's intentional, otherwise this diff would be too big and difficult to review

keyserver/src/responders/landing-handler.js
99 ↗(On Diff #22353)

After updating to Webpack 5, this appears to be how we need to access a Webpack-built commonjs bundle from ESM code

keyserver/src/responders/website-responders.js
111 ↗(On Diff #22353)

After updating to Webpack 5, this appears to be how we need to access a Webpack-built commonjs bundle from ESM code

landing/webpack.config.cjs
17 ↗(On Diff #22353)

From upgrade guide:

When using [hash] placeholder in webpack configuration, consider changing it to [contenthash]. It is not the same, but proven to be more effective.

lib/webpack/shared.cjs
19 ↗(On Diff #22353)

From upgrade guide:

When using [hash] placeholder in webpack configuration, consider changing it to [contenthash]. It is not the same, but proven to be more effective.

web/webpack.config.cjs
28 ↗(On Diff #22353)

From upgrade guide:

When using [hash] placeholder in webpack configuration, consider changing it to [contenthash]. It is not the same, but proven to be more effective.

36–38 ↗(On Diff #22353)

For context on why I was comfortable adding empty objects for crypto and path, see the investigation on this Linear task

37 ↗(On Diff #22353)

This got migrated to fs: false on the right

This revision is now accepted and ready to land.Feb 12 2023, 7:31 PM
This revision was landed with ongoing or failed builds.Feb 12 2023, 8:08 PM
Closed by commit rCOMM9d946bde0a68: Update to Webpack 5 (authored by ashoat). · Explain Why
This revision was automatically updated to reflect the committed changes.