[PR #1082] [MERGED] chore(shims): delete unused deprecated exports #1079

Closed
opened 2026-05-06 13:11:52 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/1082
Author: @james-elicx
Created: 5/5/2026
Status: Merged
Merged: 5/5/2026
Merged by: @james-elicx

Base: mainHead: chore/delete-dead-shim-exports


📝 Commits (1)

  • 7b8b734 chore(shims): delete unused deprecated toRscUrl export

📊 Changes

3 files changed (+3 additions, -27 deletions)

View changed files

📝 packages/vinext/src/server/app-browser-entry.ts (+3 -3)
📝 packages/vinext/src/shims/navigation.ts (+0 -19)
📝 packages/vinext/src/shims/next-shims.d.ts (+0 -5)

📄 Description

Summary

Deletes the deprecated toRscUrl export from the navigation shim and its matching ambient declaration. All internal callers already use createRscRequestUrl, which appends RSC cache-busting params for variant headers.

The originally-proposed requestAsyncStorage deletion was not performed — see "Verification" below for the reason.

What changed

  • packages/vinext/src/shims/navigation.ts — remove toRscUrl(href) function (deprecated, zero internal callers).
  • packages/vinext/src/shims/next-shims.d.ts — remove the matching ambient export function toRscUrl(href: string): string declaration so the public type surface no longer advertises it.
  • packages/vinext/src/server/app-browser-entry.ts — update a stale code comment that named toRscUrl to instead reference createRscRequestUrl (the actual current call site).

Verification

toRscUrl — safe to delete

$ grep -rn "toRscUrl" packages/ tests/ examples/
packages/vinext/src/server/app-browser-entry.ts:1082:            // toRscUrl strips trailing slash before appending .rsc, so the
packages/vinext/src/shims/navigation.ts:306:export function toRscUrl(href: string): string {
packages/vinext/src/shims/next-shims.d.ts:125:  export function toRscUrl(href: string): string;

Three hits: the function definition, the ambient type declaration, and one stale code comment. No call sites. After this PR:

$ grep -rn "toRscUrl" packages/ tests/ examples/
(no matches)

requestAsyncStorage — kept (load-bearing)

The task originally also proposed deleting the requestAsyncStorage legacy alias in shims/internal/work-unit-async-storage.ts. Verification turned up multiple production-relevant uses, so it was left in place:

$ grep -rn "request-async-storage\|requestAsyncStorage" packages/ tests/ examples/
packages/vinext/src/check.ts:157:  "next/dist/client/components/request-async-storage.external": { ... }
packages/vinext/src/check.ts:161:  "next/dist/client/components/request-async-storage": { ... }
packages/vinext/src/index.ts:969:  "next/dist/client/components/request-async-storage.external": path.join(...)
packages/vinext/src/index.ts:974:  "next/dist/client/components/request-async-storage": path.join(...)
packages/vinext/src/shims/internal/work-unit-async-storage.ts:3: * and next/dist/client/components/request-async-storage.external
packages/vinext/src/shims/internal/work-unit-async-storage.ts:56: export const requestAsyncStorage = workUnitAsyncStorage;
tests/shims.test.ts:11577:    expect(mod.requestAsyncStorage).toBeDefined();
tests/shims.test.ts:11579:    expect(mod.workUnitAsyncStorage).toBe(mod.requestAsyncStorage);

The shim file is the resolution target for Next.js's legacy next/dist/client/components/request-async-storage.external module path (mapped in index.ts/check.ts). The shim's JSDoc explicitly states @sentry/nextjs runtime-resolves request context via this name, and tests/shims.test.ts asserts the alias is exported. Deleting it would break the Sentry integration path on Next.js 13.x/14.x-style imports.

Test plan

  • pnpm vp test run tests/app-router.test.ts tests/pages-router.test.ts — 508 tests pass (one unrelated afterAll cleanup hook timed out tearing down tmpDir; pre-existing infra flake, no test assertions failed).
  • pnpm fmt --write — clean.
  • pnpm knip — clean.
  • CI green on this PR.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/1082 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 5/5/2026 **Status:** ✅ Merged **Merged:** 5/5/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `chore/delete-dead-shim-exports` --- ### 📝 Commits (1) - [`7b8b734`](https://github.com/cloudflare/vinext/commit/7b8b7344b34d812486e789b81bf9a0e71a644ab5) chore(shims): delete unused deprecated toRscUrl export ### 📊 Changes **3 files changed** (+3 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/server/app-browser-entry.ts` (+3 -3) 📝 `packages/vinext/src/shims/navigation.ts` (+0 -19) 📝 `packages/vinext/src/shims/next-shims.d.ts` (+0 -5) </details> ### 📄 Description ## Summary Deletes the deprecated `toRscUrl` export from the navigation shim and its matching ambient declaration. All internal callers already use `createRscRequestUrl`, which appends RSC cache-busting params for variant headers. The originally-proposed `requestAsyncStorage` deletion was **not** performed — see "Verification" below for the reason. ## What changed - `packages/vinext/src/shims/navigation.ts` — remove `toRscUrl(href)` function (deprecated, zero internal callers). - `packages/vinext/src/shims/next-shims.d.ts` — remove the matching ambient `export function toRscUrl(href: string): string` declaration so the public type surface no longer advertises it. - `packages/vinext/src/server/app-browser-entry.ts` — update a stale code comment that named `toRscUrl` to instead reference `createRscRequestUrl` (the actual current call site). ## Verification ### `toRscUrl` — safe to delete ``` $ grep -rn "toRscUrl" packages/ tests/ examples/ packages/vinext/src/server/app-browser-entry.ts:1082: // toRscUrl strips trailing slash before appending .rsc, so the packages/vinext/src/shims/navigation.ts:306:export function toRscUrl(href: string): string { packages/vinext/src/shims/next-shims.d.ts:125: export function toRscUrl(href: string): string; ``` Three hits: the function definition, the ambient type declaration, and one stale code comment. No call sites. After this PR: ``` $ grep -rn "toRscUrl" packages/ tests/ examples/ (no matches) ``` ### `requestAsyncStorage` — kept (load-bearing) The task originally also proposed deleting the `requestAsyncStorage` legacy alias in `shims/internal/work-unit-async-storage.ts`. Verification turned up multiple production-relevant uses, so it was left in place: ``` $ grep -rn "request-async-storage\|requestAsyncStorage" packages/ tests/ examples/ packages/vinext/src/check.ts:157: "next/dist/client/components/request-async-storage.external": { ... } packages/vinext/src/check.ts:161: "next/dist/client/components/request-async-storage": { ... } packages/vinext/src/index.ts:969: "next/dist/client/components/request-async-storage.external": path.join(...) packages/vinext/src/index.ts:974: "next/dist/client/components/request-async-storage": path.join(...) packages/vinext/src/shims/internal/work-unit-async-storage.ts:3: * and next/dist/client/components/request-async-storage.external packages/vinext/src/shims/internal/work-unit-async-storage.ts:56: export const requestAsyncStorage = workUnitAsyncStorage; tests/shims.test.ts:11577: expect(mod.requestAsyncStorage).toBeDefined(); tests/shims.test.ts:11579: expect(mod.workUnitAsyncStorage).toBe(mod.requestAsyncStorage); ``` The shim file is the resolution target for Next.js's legacy `next/dist/client/components/request-async-storage.external` module path (mapped in `index.ts`/`check.ts`). The shim's JSDoc explicitly states `@sentry/nextjs` runtime-resolves request context via this name, and `tests/shims.test.ts` asserts the alias is exported. Deleting it would break the Sentry integration path on Next.js 13.x/14.x-style imports. ## Test plan - [x] `pnpm vp test run tests/app-router.test.ts tests/pages-router.test.ts` — 508 tests pass (one unrelated `afterAll` cleanup hook timed out tearing down `tmpDir`; pre-existing infra flake, no test assertions failed). - [x] `pnpm fmt --write` — clean. - [x] `pnpm knip` — clean. - [ ] CI green on this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:52 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#1079
No description provided.