[pull] canary from vercel:canary#805
Merged
pull[bot] merged 4 commits intocode:canaryfrom Feb 19, 2026
Merged
Conversation
…g (3/8) (#89864) ## Summary Use `Buffer.indexOf` when available in `uint8array-helpers.ts` for faster byte sequence scanning. Falls back to the existing manual loop on non-Node environments. ## Test plan - [ ] `pnpm test-unit test/unit/stream-utils/uint8array-helpers.test.ts` passes
…89819) ## What? Adds a `maybe-build-native.mjs` script to `packages/next-swc/` that conditionally rebuilds native SWC bindings during `pnpm build`. The script is integrated into the turborepo pipeline as the `build` task for `@next/swc`. ## Why? Developers often forget to run `pnpm swc-build-native` after pulling Rust changes, leading to confusing runtime errors. Conversely, rebuilding native binaries when nothing changed wastes significant time. This automates the decision so `pnpm build` always does the right thing. ## How? The `maybe-build-native.mjs` script runs as `@next/swc`'s `build` task and: 1. **Skips in CI** — exits immediately when the `CI` env var is set, since CI uses prebuilt `@next/swc-*` npm packages 2. **Finds the last version bump** — uses `git log -G` to locate the commit that last changed `"version":` in `packages/next/package.json` 3. **Checks for Rust changes** — compares `*.rs` files against the working tree (committed + staged + unstaged) since that version bump commit 4. **Rebuilds if needed** — runs `build-native` and copies/formats the generated TypeScript definitions 5. **Clears stale binaries** — if no Rust changes are detected, removes any leftover `.node` files from `native/` so the prebuilt npm packages are used instead Turborepo's `turbo.json` is configured with Rust-specific inputs (`crates/`, `Cargo.*`, `rust-toolchain`) and `CI` in `env` so CI and local builds get separate cache keys. ### Files changed - `packages/next-swc/maybe-build-native.mjs` — new script with the conditional build logic - `packages/next-swc/package.json` — added `"build": "node maybe-build-native.mjs"` - `packages/next-swc/turbo.json` — added `build` task with Rust inputs, `CI` env, and `native/*.node` outputs
…s (4/8) (#89865) ## Summary Fix dead-code elimination in `packages/next/cache.js` to prevent server-only internals from being pulled into browser bundles. Restructures the conditional exports so bundlers can properly tree-shake server paths. ## Test plan - [ ] `pnpm --filter=next build` succeeds - [ ] No runtime behavior changes --------- Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )