Skip to content

next integration turbopack compat#393

Merged
theoephraim merged 4 commits intomainfrom
feature/nextjs-turbopack
Mar 17, 2026
Merged

next integration turbopack compat#393
theoephraim merged 4 commits intomainfrom
feature/nextjs-turbopack

Conversation

@theoephraim
Copy link
Copy Markdown
Member

@theoephraim theoephraim commented Mar 12, 2026

Reworked the nextjs integration. Now adds full turbopack support, and fixes edge runtime issues with webpack.

The matrix of cases to support (next version, webpack/turbopack, edge runtime, output mode, etc) is massive - so may need more work, but this should be a huge improvement.

closes #412

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: 5b3faed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@varlock/nextjs-integration Minor
varlock Patch
@varlock/astro-integration Patch
@varlock/vite-integration Patch
@varlock/1password-plugin Patch
@varlock/aws-secrets-plugin Patch
@varlock/azure-key-vault-plugin Patch
@varlock/bitwarden-plugin Patch
@varlock/google-secret-manager-plugin Patch
@varlock/infisical-plugin Patch
@varlock/pass-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 12, 2026

Open in StackBlitz

npm i https://pkg.pr.new/varlock@393
npm i https://pkg.pr.new/@varlock/nextjs-integration@393
npm i https://pkg.pr.new/@varlock/1password-plugin@393
npm i https://pkg.pr.new/@varlock/google-secret-manager-plugin@393

commit: 5b3faed

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Mar 12, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@theoephraim theoephraim force-pushed the feature/nextjs-turbopack branch 2 times, most recently from b9cba30 to 82e3cd8 Compare March 12, 2026 23:56
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
@theoephraim theoephraim force-pushed the feature/nextjs-turbopack branch from b23429d to 2273c86 Compare March 14, 2026 06:53
Comment thread packages/integrations/nextjs/src/turbopack-loader.ts Fixed
Comment thread packages/integrations/nextjs/src/turbopack-loader.ts Fixed
@theoephraim theoephraim force-pushed the feature/nextjs-turbopack branch from f00f806 to 9784696 Compare March 15, 2026 01:11
@theoephraim theoephraim force-pushed the feature/nextjs-turbopack branch 5 times, most recently from 7b27f68 to 5629b48 Compare March 16, 2026 09:57
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Mar 17, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednext@​16.1.76299919770
Addedvitest@​3.2.4961007999100

View full report

Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Comment thread packages/integrations/nextjs/src/loader.ts Fixed
Adds complete Next.js integration supporting both Turbopack and Webpack bundlers,
with runtime secret leak protection, console redaction, sourcemap scrubbing, and
post-build output scanning.

Key changes:
- Dual bundler support: Turbopack (loader + runtime injection) and Webpack
  (DefinePlugin proxy + processAssets hooks)
- Self-contained init bundles (init-server, init-edge) injected into runtime files
- Per-file loader with init guards for pre-rendering workers
- Shared redaction state via globalThis for cross-bundle-instance consistency
- File watchers for all varlock sources (not just Next.js's fixed .env set)
- Post-build leak scanning of static chunks, HTML, and sourcemap scrubbing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@theoephraim theoephraim force-pushed the feature/nextjs-turbopack branch from f0af418 to 83b29fc Compare March 17, 2026 06:22
Comment thread framework-tests/harness/pack.ts Dismissed
@theoephraim theoephraim changed the title next integration turbopack compat [wip] next integration turbopack compat Mar 17, 2026
Copy link
Copy Markdown
Member

@philmillman philmillman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nicely done 🚢

@theoephraim theoephraim merged commit 1e8bca6 into main Mar 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Next.js config plugin crashes middleware (edge runtime)

3 participants