Skip to content

Comments

[pull] canary from vercel:canary#805

Merged
pull[bot] merged 4 commits intocode:canaryfrom
vercel:canary
Feb 19, 2026
Merged

[pull] canary from vercel:canary#805
pull[bot] merged 4 commits intocode:canaryfrom
vercel:canary

Conversation

@pull
Copy link

@pull pull bot commented Feb 19, 2026

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 : )

mischnic and others added 4 commits February 19, 2026 10:03
…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>
@pull pull bot locked and limited conversation to collaborators Feb 19, 2026
@pull pull bot added the ⤵️ pull label Feb 19, 2026
@pull pull bot merged commit cf83d7c into code:canary Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants