Attributes MVP (experimental and write-only) and CI hardening#2134
Conversation
🦋 Changeset detectedLatest commit: 606af96 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
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 |
📊 Benchmark Results
workflow with no steps💻 Local Development
workflow with 1 step💻 Local Development
workflow with 10 sequential steps💻 Local Development
workflow with 25 sequential steps💻 Local Development
workflow with 50 sequential steps💻 Local Development
Promise.all with 10 concurrent steps💻 Local Development
Promise.all with 25 concurrent steps💻 Local Development
Promise.all with 50 concurrent steps💻 Local Development
Promise.race with 10 concurrent steps💻 Local Development
Promise.race with 25 concurrent steps💻 Local Development
Promise.race with 50 concurrent steps💻 Local Development
workflow with 10 sequential data payload steps (10KB)💻 Local Development
workflow with 25 sequential data payload steps (10KB)💻 Local Development
workflow with 50 sequential data payload steps (10KB)💻 Local Development
workflow with 10 concurrent data payload steps (10KB)💻 Local Development
workflow with 25 concurrent data payload steps (10KB)💻 Local Development
workflow with 50 concurrent data payload steps (10KB)💻 Local Development
Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
stream pipeline with 5 transform steps (1MB)💻 Local Development
10 parallel streams (1MB each)💻 Local Development
fan-out fan-in 10 streams (1MB each)💻 Local Development
SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
❌ Some benchmark jobs failed:
Check the workflow run for details. |
🧪 E2E Test Results✅ All tests passed Summary
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 📋 Other
|
TooTallNate
left a comment
There was a problem hiding this comment.
Approve — this is exactly the fix the PR #2088 review flagged
I'd called out the Maximum call stack size exceeded regression on PR #2088 and noted that Peter's earlier attempt (930886fe3 fix(next): replace base64 sourcemap regex with string scan on the attributes-mvp-plan branch) targeted the wrong file — builder-deferred.ts. The actual failing path was workflow-handler error stack remapping in source-map.ts, which uses an independent copy of the same regex. This PR fixes the right file.
Diagnosis confirmed
The original regex:
workflowCode.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.+)/)The (.+) greedy capture against multi-MB base64 payloads is what triggers V8's irregexp recursion stack overflow. Same root cause as the matchAll regex Peter previously hit in the deferred-entries discoverer.
What I verified locally
pnpm turbo run build --filter @workflow/core✓pnpm --filter @workflow/core test✓ (1024 pass — 1 new, 1023 existing)pnpm --filter @workflow/core exec vitest run src/source-map.test.ts✓- Manual smoke test of 5 edge cases against the built artifact:
- Happy path with valid map ✓
- 1MB padding (would crash the regex) ✓
- No-map case returns original stack ✓
data:application/json;charset=utf-8;base64,…parameter handling ✓- Comma-before-
;base64,correctly bails ✓
Bonus: the new scanner is strictly more permissive than the old regex
The old regex required the data URL to be exactly data:application/json;base64,… — no parameters allowed ((.+) would never match if e.g. ;charset=utf-8; appeared between json and ;base64,). The new scanner searches for ;base64, after the prefix, so it also handles data:application/json;charset=utf-8;base64,… correctly. So this isn't just a stack-overflow fix — it also extends remapping to data URLs that were silently skipped before.
Test design
The test is good:
const match = vi.spyOn(String.prototype, 'match');
remapErrorStack(...);
expect(
match.mock.calls.some(([pattern]) =>
String(pattern).includes('sourceMappingURL')
)
).toBe(false);Enforcing the regex is NEVER called on the bundle is the right invariant — it documents that the implementation has moved off the regex path entirely, and would fail if someone accidentally regressed to match. The 1MB padding setup is enough to actually trigger the V8 stack overflow if the regex came back.
Small observation (not a blocker)
The implementation duplicates the same pattern Peter has in packages/next/src/builder-deferred.ts:956 (or had on the attributes-mvp-plan branch). If a third place ever needs to scan inline base64 sourcemaps, worth extracting extractInlineSourceMapBase64() + isBase64Char() to a shared util. Not needed now — two callsites doesn't justify the extraction overhead.
CI
No failures so far on the run (mostly in-progress), and most importantly the local test passes. Once the in-progress nextjs-webpack Local Dev jobs land green, this confirms the fix for the regression I flagged on PR #2088.
Approving.
|
No backport to This commit bundles the Attributes MVP — a new experimental v5-targeted feature with cross-package API additions (new To override, re-run the Backport to stable workflow manually via |
Includes all of #2088
and additionally fixes nextjs-webpack errors surfaced by doing: