Sync upstream v2.10.1 (merge conflicts) - #29
Conversation
…amic-labs SDK Turbopack's scope hoisting emits code that reads the SDK's UserFieldEditorContext through the wrong binding. useContext then receives a non-context value, returns undefined, and the SDK throws from its own useUpdateUserWithModal: useUserUpdateRequest can only be used inside the context of DynamicContextProvider The thrower is the SDK's internal SyncAuthFlow, which the SDK itself renders inside UserFieldEditorContextProvider — so in a correct build that context cannot be missing. A webpack build of the same source is fine, so the defect is Turbopack's, not ours. Impact: a hard crash on the initial load of every page, on any instance with NEXT_PUBLIC_ACCOUNT_AUTH_PROVIDER=dynamic. Invisible in dev (unminified, no hoisting) and found only by running the v2.10.0 image locally, so v2.10.0 would have broken every dynamic-auth instance on rollout. Bisected to blockscout#3574; not fixed by Next 16.3.0, and not reducible to a single import — the trigger is an emergent property of the module graph. webpack turns out to be the better bundle anyway, not just the correct one. Against the Turbopack build it cuts JS-before-FCP 1038 -> 697 KB (-33%) and emitted chunk bytes 49.2 -> 21.4 MB, at 2-3x the build time. The other fix, experimental.turbopackScopeHoisting:false, was measured and rejected: it nearly doubles FCP and triples blocking time while leaving M6 almost unchanged. Dev stays on Turbopack — it is ~3x faster to compile and this crash class only exists in a minified production build. - build, build:next and prod.preset.sh now pass --webpack (build:analyze and profile:preset already did). prod:preset matters because it is the measurement path: profiling a bundler we no longer ship would be misleading. - resolve.fallback maps @react-native-async-storage/async-storage to false. webpack surfaces that unresolvable optional import inside @metamask/sdk, which a browser bundle never needs; the build is warning-free. Introduces .agents/adr/ for decisions that are expensive to rediscover, indexed from AGENTS.md. This is record 0001 and carries the full evidence. Also automates the perf-trace capture used to make the call: trace.mjs records a DevTools-format trace over CDP so trace-metrics.py can consume several runs per variant. Its README now warns that M6 alone is not a sufficient gate — that is exactly how the scope-hoisting option looked cheap. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`trace.mjs` is a CLI tool — its stdout is the interface (usage hint, and one line per trace written). Uses a file-level disable with a reason rather than one per call site. Fixes the Code quality job on blockscout#3612. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ge (blockscout#3611) * docs: spec for displaying fee payer and calls on the tx details page Refs blockscout#3607 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Display the fee payer and batched calls on the transaction details page Eden transactions of type 0x76 are sponsored batches: an executor submits an ordered list of calls and a separate sponsor pays the fee. Render both fields inside the collapsible details, gated on their presence in the response. Pin @blockscout/api-types to a beta built from the backend `dev` branch once `master` had been merged into it, which is the first published build carrying the eden chain type alongside the response shorthands the app relies on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Tag a sponsored transaction in the details page header Transaction lists have no room for another badge, so `sponsored_transaction` is listed last in TYPES_ORDER with no label of its own. Without an entry there it scores -1 and sorts ahead of every real type, masking labels like "Contract call". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for Eden-specific sponsored batch transactions by displaying the fee payer and the list of batched calls on the transaction details page. It also adds an Architecture Decision Record (ADR 0001) detailing the switch back to webpack for production builds due to a Turbopack scope-hoisting issue with the Dynamic-labs SDK, along with related tooling and documentation updates. A critical issue was identified in the newly added test file where React Testing Library utilities are incorrectly imported from 'vitest/lib' instead of '@testing-library/react', which would cause the test suite to fail.
| import React from 'react'; | ||
|
|
||
| import { afterEach, describe, expect, it } from 'vitest'; | ||
| import { cleanup, render, screen } from 'vitest/lib'; |
There was a problem hiding this comment.
The utilities cleanup, render, and screen are React Testing Library utilities and should be imported from @testing-library/react instead of vitest/lib. Importing them from vitest/lib will cause the test suite to fail as they are not exported by Vitest.
| import { cleanup, render, screen } from 'vitest/lib'; | |
| import { cleanup, render, screen } from '@testing-library/react'; |
f098874 to
1199019
Compare
1199019 to
b1493d3
Compare
Upstream Sync - v2.10.1
Auto-merge with upstream
v2.10.1failed due to conflicts.To resolve:
v2.10.1to trigger Docker buildUpstream release notes