mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #584] [MERGED] feat: full next/compat/router support and fix vinext check scanner for shimmed modules #686
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#686
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/584
Author: @james-elicx
Created: 3/19/2026
Status: ✅ Merged
Merged: 3/19/2026
Merged by: @james-elicx
Base:
main← Head:opencode/brave-moon📝 Commits (6)
beffd1afeat: full next/compat/router support and fix check scanner for shimmed modulesb8136c5test: update entry-templates snapshots for compat-router-test fixture page04311ffremove type assertionacdf82cfix: add declare module for next/compat/router to fixture next-shims.d.ts filesfcda8d9fix: add declare module for next/compat/router to internal next-shims.d.ts26257f9pin to vp setup 1.0.0📊 Changes
16 files changed (+279 additions, -58 deletions)
View changed files
📝
.github/workflows/ci.yml(+1 -1)📝
packages/vinext/src/check.ts(+11 -0)📝
packages/vinext/src/shims/compat-router.ts(+2 -1)📝
packages/vinext/src/shims/internal/router-context.ts(+2 -1)📝
packages/vinext/src/shims/next-shims.d.ts(+6 -0)📝
packages/vinext/src/shims/router.ts(+1 -1)📝
tests/__snapshots__/entry-templates.test.ts.snap(+57 -54)📝
tests/check.test.ts(+36 -0)➕
tests/fixtures/app-basic/app/components/compat-router-widget.tsx(+27 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/compat-router/page.tsx(+10 -0)📝
tests/fixtures/app-basic/next-shims.d.ts(+29 -0)➕
tests/fixtures/pages-basic/components/compat-router-widget.tsx(+27 -0)📝
tests/fixtures/pages-basic/next-shims.d.ts(+29 -0)➕
tests/fixtures/pages-basic/pages/compat-router-test.tsx(+10 -0)📝
tests/nextjs-compat/hooks.test.ts(+18 -0)📝
tests/pages-router.test.ts(+13 -0)📄 Description
Summary
NextRouterinterface fromshims/router.ts;useRouter()inshims/compat-router.tsnow has a properNextRouter | nullreturn type instead ofany.vinext checkaccuracy: addnext/compat/router,next/form,next/web-vitals, andnext/constantstoIMPORT_SUPPORTincheck.ts— these were all shimmed and working but incorrectly flagged as unsupported/unrecognized by the scanner.CompatRouterWidgetfixture components and pages in bothpages-basicandapp-basicfixtures, with integration tests intests/pages-router.test.tsandtests/nextjs-compat/hooks.test.ts.tests/check.test.tswith four new assertions covering the newly-registered imports.Changes
packages/vinext/src/shims/router.tsNextRouterinterfacepackages/vinext/src/shims/compat-router.tsNextRouter | nullreturn type touseRouter()packages/vinext/src/check.tsnext/compat/router,next/form,next/web-vitals,next/constantstoIMPORT_SUPPORTtests/check.test.tstests/pages-router.test.tsnext/compat/routerin Pages Routertests/nextjs-compat/hooks.test.tsnext/compat/routerin App Routertests/fixtures/*/compat-router-*Testing
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.