15 Commits

Author SHA1 Message Date
Divanshu Chauhan (divkix) 155be501e1 fix: accept experimental.swcEnvOptions config without erroring (#977)
* fix: accept experimental.swcEnvOptions config without erroring (#774)

Next.js added experimental.swcEnvOptions for SWC preset-env polyfill injection.
vinext uses Vite for transforms, so polyfill injection is not applicable, but
the config key should be accepted without errors. Add:
- CONFIG_SUPPORT entry in check.ts (unsupported with detail)
- Warning during config resolution in next-config.ts
- Tests for analyzeConfig detection and dot-notation matching

* refactor: align swcEnvOptions messaging and add test coverage

- Change runtime warning from "not yet supported" to "not applicable"

- Update CONFIG_SUPPORT detail for consistent messaging

- Add test coverage for swcEnvOptions warning in next-config.test.ts

* fix(check): update test assertion for swcEnvOptions message

The CONFIG_SUPPORT message for experimental.swcEnvOptions was updated
to indicate it's not applicable since vinext uses Vite instead of SWC.
This updates the corresponding test assertion to match the new message.

Fixes CI failure in tests/check.test.ts
2026-04-30 08:53:58 +01:00
James Anderson c5da1db4ff refactor: share config support list across checks (#971)
* refactor: share config support list across checks

* fmt
2026-04-29 20:17:07 +00:00
Divanshu Chauhan (divkix) cc0001e5ea fix: add experimental.prefetchInlining to compatibility check (#949)
* fix: add experimental.prefetchInlining to compatibility check (#860)

Next.js flipped experimental.prefetchInlining from false to true by default
in PR #92863. vinext does not implement per-segment prefetch inlining — it
uses unified RSC navigation payloads — so no behavioral change is needed.
This adds the config option to the compatibility scanner so vinext check
correctly reports it as supported.

* fix: mark experimental.prefetchInlining as partial, add test

- Change status from supported to partial (per review feedback —
  option is recognized but underlying behavior is not implemented)
- Add test case in tests/check.test.ts matching existing
  experimental.* config patterns
2026-04-29 18:30:20 +01:00
yyh e81820279e fix: preserve console output for caught app errors in dev (#862)
* fix: preserve console output for caught app errors in dev

* address bonk review comments on PR 862

---------

Co-authored-by: James <james@eli.cx>
2026-04-20 08:20:59 +01:00
Shorebirdmgmt e854f77bd4 Update @clerk/nextjs compatibility: unsupported → partial (#803)
Tested against @clerk/nextjs v7.0.12 with vinext 0.0.40. Runtime-verified
that clerkMiddleware, auth.protect, frontendApiProxy, ClerkProvider, and
client hooks all work through vinext's middleware runtime.

What works:
- clerkMiddleware() — runs correctly, authenticates requests
- auth.protect() — redirects unauthenticated page requests to sign-in
- frontendApiProxy — proxies Clerk Frontend API through the app domain
- ClerkProvider — renders with Clerk JS SDK and publishable key
- x-clerk-auth-* headers — propagated correctly on responses
- Clerk handshake flow — 307 redirect with correct handshake URL

What's still WIP:
- auth() in Server Components (requires next/headers shim)

Closes #800

Co-authored-by: Sam Hill <samhill7738@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:18:00 +01:00
James Anderson 7f30707e98 feat(check): flag __dirname/__filename and suggest ESM path APIs (#590)
* feat(check): flag __dirname/__filename and suggest ESM path APIs

Closes #583

Scan server source files for free uses of the CJS globals __dirname and
__filename and report them as a partial compatibility issue in the
vinext check output.

Uses a single-pass alternation regex that skips string literals,
template literals, and comments in one pass, so identifiers inside
those tokens are never matched.

* refactor(check): merge ViewTransition and __dirname scans into one file loop

* Regex misses `__dirname` in template expressions.

Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>

* fix(check): expose __dirname inside template expressions to identifier match

The previous template literal skip branch consumed `${...}` bodies as
literal content, so __dirname in e.g. `${__dirname}/views` was silently
skipped.

Change the template branch to stop at ${ boundaries by excluding $ from
the non-interpolation character class: [^`\\$]. A bare $ not followed
by { is still allowed via |$(?!\{). This means the ${...} body is never
consumed by the skip branch and __dirname inside template expressions is
correctly caught by the identifier branch.

Adds two new tests: one verifying plain template content (no interpolation)
is still ignored, one verifying __dirname inside ${} is detected.

* fix(check): use unsupported status for __dirname/__filename; show files in issues section

There is no vinext shim for __dirname/__filename in user app code — it
is a hard runtime failure, so partial was wrong. Changed to unsupported.

Also fixed formatReport to list affected files under each unsupported
item in the 'Issues to address' section. Previously files were only
shown in the per-section detail view (imports), leaving the summary
section without the context needed to actually fix the issue.

Adds a test verifying the file path appears in the formatted report.

* remove files

---------

Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>
2026-03-19 16:23:10 +00:00
James Anderson 337b65dfb7 feat: support next/dist/* internal imports and auto-generate .js shim aliases (#586)
* feat: add bare next/dist/shared/lib/router-context alias and strengthen test

* feat: add next/dist/shared/lib/router-context to IMPORT_SUPPORT check map

* fix: remove bare router-context alias, only .shared-runtime exists in Next.js

* feat: add all shimmed next/dist/* paths to IMPORT_SUPPORT check map

* refactor: auto-generate .js alias variants via flatMap in nextShimMap

* limit .js map to next/
2026-03-19 09:19:38 +00:00
James Anderson a86b67dff4 feat: full next/compat/router support and fix vinext check scanner for shimmed modules (#584)
* feat: full next/compat/router support and fix check scanner for shimmed modules

- Export NextRouter interface from shims/router.ts so compat-router.ts can use it
- Add NextRouter | null return type to useRouter() in shims/compat-router.ts
- Add next/compat/router, next/form, next/web-vitals, next/constants to IMPORT_SUPPORT in check.ts so vinext check no longer flags them as unsupported
- Add integration fixture pages and components for next/compat/router in both pages-basic and app-basic fixtures
- Add integration tests in tests/pages-router.test.ts and tests/nextjs-compat/hooks.test.ts
- Add unit tests in tests/check.test.ts covering all four newly-registered imports

* test: update entry-templates snapshots for compat-router-test fixture page

* remove type assertion

* fix: add declare module for next/compat/router to fixture next-shims.d.ts files

* fix: add declare module for next/compat/router to internal next-shims.d.ts

* pin to vp setup 1.0.0
2026-03-19 08:47:40 +00:00
Stephen Zhou c17d6941be chore: migrate to vite plus (#535)
* chore: migrate to vite plus

* Disable typeAware and typeCheck

* Update CI

* Fix CI

* Fix test

* Clean

* Run test with vp

* Try revert

* react: false In test

* Fix test

* Revert "Try revert"

This reverts commit 009da10473.

* Update

* Update

* Try revert ci changes

* revert

* Run vp migrate

* Disable typeAware and typeCheck for now

* Better resolve for test

* Use vp dev instead of vite

* Update expect

* Fix NormalizeManifestModuleId

* Try increase timeout

* Update to use vp

* Try new check

* Bring back npx vp

* Migrate CI

* Make next-intl resolvable

* Update

* Update

* Update
2026-03-15 10:50:13 +00:00
Stephen Zhou 21558f3092 feat: support @vitejs/plugin-react v6 as peer (#525)
* feat: support @vitejs/plugin-react v6 as peer

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update
2026-03-13 15:35:36 +00:00
Nathan Nguyen 38dc409a43 feat: Add Pages Router i18n domain routing (#471)
* Add Pages Router domain locale routing

* Add coverage for Pages Router domain locale behavior

* Format Pages Router i18n domain routing changes

* Handle basePath in Pages Router i18n domains

* Refactor Pages Router i18n domain fixtures

* Update Pages Router entry snapshot after rebase

* Align domain locale redirects with Next.js

* Clarify Pages Router domain locale helpers

* Fix case-insensitive locale prefixes

* Simplify same-domain locale URL handling

* Cover same-domain locale alias redirects

* Document Pages Router i18n invariants

* Guard preferred locale in domain redirects
2026-03-12 13:49:59 +00:00
James Anderson 764a496ce7 add oxfmt formatter (#380)
* add oxfmt formatter: config, scripts, CI, editor setup, docs

* rebuild lockfile

* fix: add Format to required checks list, remove dead ignore pattern

* run fmt

* add format to agents.md again
2026-03-09 14:56:14 +00:00
Nathan Nguyen 2b51ca7a85 fix: update stale compat scanner entries (#370)
next/font/local variable mode works (className and variable both
supported) — the scanner still said it was broken.

styled-components and @emotion/react work via useServerInsertedHTML —
the scanner still said the hook wasn't implemented.

Updated both entries from partial to supported with accurate details,
and updated corresponding test assertions.
2026-03-09 09:57:06 +00:00
Jared Stowell 49689537d0 Fix and fully implement allowedDevOrigins (#337) 2026-03-08 08:56:15 +00:00
Steve Faulkner 12fea722b6 Initial public release of vinext 2026-02-24 09:29:39 -06:00