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)
Mar 8 2025, 5:00 AM
Unknown Object (File)
Mar 8 2025, 5:00 AM
Unknown Object (File)
Mar 8 2025, 4:59 AM
Unknown Object (File)
Mar 8 2025, 4:59 AM
Unknown Object (File)
Mar 1 2025, 1:08 PM
Unknown Object (File)
Feb 3 2025, 1:04 AM
Unknown Object (File)
Jan 19 2025, 1:34 PM
Unknown Object (File)
Jan 11 2025, 11:17 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