Repository navigation
perf: use literal ABIs for deployless calls in call - #5511
Merged
Merged
Conversation
|
@backseats is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: aedff22 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
call.tsbuilds two constructor ABIs for deployless calls withparseAbiat runtime:Because
callis on every read path, this pulls abitype's human-readable ABI parser into any bundle that reads contracts, even when the app never usesparseAbior deployless calls. This replaces both with the literal ABIs thatparseAbireturns for those signatures (checked by printing its output), so behavior is unchanged.Bundle size
A tree-shaken read path (
createClient,http,readContractfromviem/actions), bundled with esbuild (minify, ESM, browser) against the published 2.57.19 build, withcall.jspatched the same way:That is −12.4 KB minified and −3.2 KB gzipped for any app that reads contracts and doesn't import
parseAbiitself.Tests
pnpm test --run src/actions/public/{call,readContract,simulateContract}.test.ts: 120 passed, 8 skipped. The deploylesscodeandfactorypaths are covered incall.test.ts.call > errors > gas fee is less than block base fee,simulateContract > node errors > fee cap too low), so they are environment-related, not from this change.tsc -band Biome are clean.