mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #586] [MERGED] feat: support next/dist/* internal imports and auto-generate .js shim aliases #689
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#689
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/586
Author: @james-elicx
Created: 3/19/2026
Status: ✅ Merged
Merged: 3/19/2026
Merged by: @james-elicx
Base:
main← Head:feat/router-context-bare-alias📝 Commits (6)
d39e06bfeat: add bare next/dist/shared/lib/router-context alias and strengthen test7acbdcefeat: add next/dist/shared/lib/router-context to IMPORT_SUPPORT check map0e705aefix: remove bare router-context alias, only .shared-runtime exists in Next.jsdcc7e28feat: add all shimmed next/dist/* paths to IMPORT_SUPPORT check mapc7fed41refactor: auto-generate .js alias variants via flatMap in nextShimMapcae78cblimit .js map to next/📊 Changes
4 files changed (+191 additions, -110 deletions)
View changed files
📝
packages/vinext/src/check.ts(+53 -0)📝
packages/vinext/src/index.ts(+98 -109)📝
tests/check.test.ts(+36 -0)📝
tests/shims.test.ts(+4 -1)📄 Description
Summary
"next/link"+"next/link.js"pairs innextShimMapwith aflatMapthat auto-generates the.jsvariant for every entry, removing ~50 lines of repetition and ensuring new shims automatically get their.jsaliasnext/dist/shared/lib/router-context.shared-runtimeand all other shimmednext/dist/*internal paths to theIMPORT_SUPPORTmap incheck.ts, sovinext checkreports them as supported rather than "not recognized by vinext":next/dist/shared/lib/router-context.shared-runtimenext/dist/shared/lib/app-router-context.shared-runtimenext/dist/shared/lib/app-router-contextnext/dist/shared/lib/utilsnext/dist/server/api-utilsnext/dist/server/web/spec-extension/cookiesnext/dist/compiled/@edge-runtime/cookiesnext/dist/server/app-render/work-unit-async-storage.externalnext/dist/client/components/work-unit-async-storage.externalnext/dist/client/components/request-async-storage.externalnext/dist/client/components/request-async-storagenext/dist/client/components/navigationnext/dist/server/config-sharedrouter-contextshim test to assertProviderandConsumerare presentcheck.test.tsfor all newIMPORT_SUPPORTentries🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.