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
F3350216: D11485.diff
Fri, Nov 22, 9:21 PM
Unknown Object (File)
Tue, Nov 19, 5:08 PM
Unknown Object (File)
Tue, Nov 19, 4:49 PM
Unknown Object (File)
Wed, Nov 13, 12:45 AM
Unknown Object (File)
Tue, Nov 12, 10:55 PM
Unknown Object (File)
Oct 22 2024, 2:44 PM
Unknown Object (File)
Oct 18 2024, 6:25 PM
Unknown Object (File)
Oct 18 2024, 6:25 PM
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
Branch
ashoat/goerli
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/.babelrc.cjs
7

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