refactor: convert app/scripts/lib/ens-ipfs/contracts/resolver.js to TypeScript#41328
Conversation
…Script Agent-Logs-Url: https://github.com/MetaMask/metamask-extension/sessions/921aa13e-994a-4b03-a77c-d164ae824d17 Co-authored-by: DDDDDanica <12678455+DDDDDanica@users.noreply.github.com>
app/scripts/lib/ens-ipfs/contracts/resolver.js to TypeScript
app/scripts/lib/ens-ipfs/contracts/resolver.js to TypeScriptapp/scripts/lib/ens-ipfs/contracts/resolver.js to TypeScript
Builds ready [fabc2d2]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [3d01c6f]
⚡ Performance Benchmarks
Dapp page load benchmarks: data not available. Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…ver-js-to-typescript
|
Builds ready [0f068f7]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 2 warn · 🔴 0 fail)
Dapp page load benchmarks: data not available. Bundle size diffs [🚀 Bundle size reduced!]
|
gauthierpetetin
left a comment
There was a problem hiding this comment.
I left a non-blocking comment. LGTM
|
|
||
| expect(functionNames).toContain('contenthash'); | ||
| expect(functionNames).toContain('text'); | ||
| expect(functionNames).toContain('addr'); |
There was a problem hiding this comment.
Nit: Given that app/scripts/lib/ens-ipfs/resolver.js calls supportsInterface and content functions, maybe we can test these here as well, by adding:
expect(functionNames).toContain('supportsInterface');
expect(functionNames).toContain('content');
Builds ready [0f068f7]
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 2 warn · 🔴 0 fail)
Dapp page load benchmarks: data not available. Bundle size diffs [🚀 Bundle size reduced!]
|



[skip-e2e]
Part of the ongoing JS→TS migration. Converts the ENS resolver ABI contract file to TypeScript and removes it from the migration dashboard tracking list.
Changes
resolver.js→resolver.tswith no functional changesas constassertion to the ABI array for literal type inference and immutability"app/scripts/lib/ens-ipfs/contracts/resolver.js"fromdevelopment/ts-migration-dashboard/files-to-convert.jsonThe default export is preserved to maintain compatibility with the existing
import resolverAbi from './contracts/resolver'inens-ipfs/resolver.js.⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.
Note
Low Risk
Low risk refactor of a static ABI export plus a new unit test; main risk is accidental ABI shape drift impacting
ens-ipfs/resolver.jscontract calls.Overview
Refactors the ENS resolver contract ABI export by replacing
contracts/resolver.jswith a TypeScriptcontracts/resolver.tsthat builds the same ABI via small typed helpers and exports itas const.Adds
resolver.test.tsto assert the ABI is non-empty and includes key resolver functions, and removes the old JS file fromdevelopment/ts-migration-dashboard/files-to-convert.json.Written by Cursor Bugbot for commit 0f068f7. This will update automatically on new commits. Configure here.