Page MenuHomePhabricator

[lib][native][web][keyserver][landing] Update to Ethers.js 6
ClosedPublic

Authored by ashoat on Mar 29 2024, 7:12 PM.
Tags
None
Referenced Files
F1715080: D11485.id38625.diff
Tue, May 7, 4:32 PM
F1715079: D11485.id38566.diff
Tue, May 7, 4:32 PM
F1715048: D11485.diff
Tue, May 7, 4:32 PM
F1714965: D11485.id.diff
Tue, May 7, 4:01 PM
Unknown Object (File)
Thu, Apr 11, 11:33 AM
Unknown Object (File)
Apr 6 2024, 6:10 PM
Unknown Object (File)
Apr 5 2024, 5:19 PM
Unknown Object (File)
Apr 5 2024, 5:52 AM
Subscribers

Details

Summary

We use Ethers.js for resolving ENS addresses across much of our stack.

As part of addressing the deprecation of the Ethereum testnet Goerli, we need to update to Ethers.js. See point 1a here.

Test Plan

Unit tests will be fixed later in the stack. I also tested that ENS resolution still worked in native, web, and keyserver

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/.babelrc.cjs
7 ↗(On Diff #38566)

Without @babel/plugin-transform-private-methods, I saw this error in Metro:

iOS Bundling failed 3691ms
error: ../node_modules/ethers/lib.commonjs/abi/abi-coder.js: /Users/ashoat/src/comm/node_modules/ethers/lib.commonjs/abi/abi-coder.js: Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration.
  112 |  */
  113 | class AbiCoder {
> 114 |     #getCoder(param) {
      |     ^
  115 |         if (param.isArray()) {
  116 |             return new array_js_1.ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);
  117 |         }

Without { loose: true }, I saw this error in Metro:

iOS Bundling failed 3570ms
error: ../node_modules/ethers/lib.commonjs/wallet/wallet.js: /Users/ashoat/src/comm/node_modules/ethers/lib.commonjs/wallet/wallet.js: 'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled).

This happens to be the same Babel plugin that we added to landing and keyserver in D11427.

This revision is now accepted and ready to land.Apr 1 2024, 9:13 AM