Page MenuHomePhabricator

[landing][lib][web] Add buffer polyfill for webworkers
ClosedPublic

Authored by ashoat on Apr 4 2024, 11:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 24, 2:53 PM
Unknown Object (File)
Fri, Jun 14, 7:20 AM
Unknown Object (File)
Wed, Jun 12, 10:01 PM
Unknown Object (File)
Apr 10 2024, 10:54 AM
Unknown Object (File)
Apr 9 2024, 9:04 AM
Unknown Object (File)
Apr 8 2024, 1:45 PM
Unknown Object (File)
Apr 5 2024, 2:00 AM
Unknown Object (File)
Apr 4 2024, 12:31 PM
Subscribers

Details

Summary

The updated siwe library (which will be added in the next diff) now relies on a buffer polyfill. This diff adds the buffer polyfill to webworkers.

Test Plan

Confirmed that the siwe library no longer printed a "buffer not found" error when loading web locally

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

landing/package.json
44 ↗(On Diff #38785)

Noticed that yarn was hoisting an older version of buffer to the root node_modules, so I added this change (and the one to web/package.json) to make it hoist the version we want

I suspect that the Webpack configs are pulling buffer from the web/landing context rather than the lib context, since there's no require step in lib... it's just a string buffer that gets passed to (and executed on) web/landing

lib/webpack/shared.cjs
86–88 ↗(On Diff #38785)

This is where I got the line from, and how we configure the Buffer polyfill in the main tab (non-webworker) context

This revision is now accepted and ready to land.Apr 4 2024, 11:59 AM