Skip to content

fix(tempo): mark aggregate Abis exports as pure - #5401

Merged
jxom merged 1 commit into
mainfrom
fix/tempo-abis-pure-aggregates
Nov 3, 2026
Merged

jxom merged 1 commit into
mainfrom
fix/tempo-abis-pure-aggregates

Conversation

@jxom

@jxom jxom commented Nov 3, 2026

Copy link
Copy Markdown
Member

Problem

viem/tempo's Abis builds core, earn, zone, propAmm and all with array spreads at module scope. esbuild and Rolldown treat those spreads as possible side effects, so any import of Abis.js (for example only Abis.tip20) ships every Tempo ABI.

Fix

Wrap each aggregate in /* @__PURE__ */ (() => [...] as const)(), in the generator (scripts/generateTempoAbis.ts) and in src/tempo/Abis.ts. The emitted Abis.d.ts is byte-identical before and after, so inferred types are unchanged.

Size (bundle using only tip20, minified)

Bundler Before After
esbuild 0.28 (import { tip20 } from '_esm/tempo/Abis.js') 187,312 B (18,762 gz) 10,320 B (1,353 gz)
Rolldown 1.1.5 (import { Abis } from 'viem/tempo', Abis.tip20) 187,307 B (18,745 gz) 10,311 B (1,330 gz)

Rollup and the existing size-limit (webpack/terser) setup already dropped these, so no size-limit entry is added; it would not catch a regression.


Generated by Claude Code

Wrap `core`, `earn`, `zone`, `propAmm` and `all` in pure IIFEs so
bundlers can drop them (and the ABIs they spread) when unused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D3nmWh7r4vjvCGKnyH9BNT
@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e75a711

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

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

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
viem Building Building Preview Nov 3, 2026 8:34pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T20:37:46.285214Z e75a711 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jxom
jxom merged commit 1d45769 into main Nov 3, 2026
34 of 36 checks passed
@jxom
jxom deleted the fix/tempo-abis-pure-aggregates branch November 3, 2026 20:36
@github-actions github-actions Bot mentioned this pull request Nov 3, 2026

This branch was successfully deployed

1 active deployment
Preview — e75a7110 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants