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)
Fri, Nov 8, 7:09 AM
Unknown Object (File)
Fri, Nov 8, 5:39 AM
Unknown Object (File)
Sun, Nov 3, 7:54 AM
Unknown Object (File)
Oct 12 2024, 7:07 PM
Unknown Object (File)
Oct 12 2024, 7:07 PM
Unknown Object (File)
Oct 12 2024, 7:07 PM
Unknown Object (File)
Oct 12 2024, 7:07 PM
Unknown Object (File)
Sep 5 2024, 8:44 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