Skip to content

chore(vite): Use vite plugin for context wrapping#2058

Merged
Tobbe merged 2 commits into
mainfrom
tobbe-vite-context-wrapping-plugin-use
Jul 8, 2026
Merged

chore(vite): Use vite plugin for context wrapping#2058
Tobbe merged 2 commits into
mainfrom
tobbe-vite-context-wrapping-plugin-use

Conversation

@Tobbe

@Tobbe Tobbe commented Jul 8, 2026

Copy link
Copy Markdown
Member

Replacing the older Babel plugin approach

This is continuation of the work started in #2051

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 4a5a537
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6a4e510b60e71600099424ca

@github-actions github-actions Bot added this to the chore milestone Jul 8, 2026
@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves API context wrapping from Babel into Vite and build pipeline helpers. The main changes are:

  • Context wrapping is now Jest-only in the API Babel config.
  • Standalone API builds apply wrapping directly after Babel transforms.
  • Unified Vite builds register the context-wrapping plugin for API workspaces.
  • The Vite package exports the wrapping plugin and helper.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
packages/babel-config/src/api.ts API Babel overrides now keep context wrapping enabled only for Jest callers.
packages/internal/src/build/api.ts Standalone API build paths now apply context wrapping to function files after Babel transforms.
packages/internal/src/build/esbuild-plugin-cedar-context-wrapping.ts A standalone context-wrapping helper was added for internal API build paths.
packages/testing/src/config/jest/api/apiBabelConfig.ts Jest API Babel config now opts into context wrapping explicitly.
packages/testing/src/config/jest/api/jest-preset.ts The Jest preset now requests the Jest-specific API Babel behavior.
packages/vite/src/buildApp.ts Unified Vite builds now add the API context-wrapping plugin whenever the API workspace is included.
packages/vite/src/index.ts The Vite package now re-exports the context-wrapping plugin and helper.
packages/vite/src/plugins/vite-plugin-cedar-context-wrapping.ts The Vite context-wrapping plugin now delegates to an exported wrapping helper.

Reviews (2): Last reviewed commit: "esbuild plugin" | Re-trigger Greptile

Comment thread packages/babel-config/src/api.ts
@nx-cloud

nx-cloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 4a5a537

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 1s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 2m 25s View ↗
nx run-many -t build ✅ Succeeded 1m 22s View ↗
nx run-many -t test:types ✅ Succeeded 10s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-08 13:46:07 UTC

@nx-cloud

nx-cloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 8a0ce51

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 2m 46s View ↗
nx run-many -t build ✅ Succeeded 1m 22s View ↗
nx run-many -t test:types ✅ Succeeded 11s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-08 06:42:38 UTC

@Tobbe Tobbe merged commit add61e6 into main Jul 8, 2026
51 checks passed
@Tobbe Tobbe deleted the tobbe-vite-context-wrapping-plugin-use branch July 8, 2026 13:52
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The changes in this PR are now available on npm.

Try them out by running yarn cedar upgrade -t 5.0.0-canary.2604

Or try it in a new app with yarn dlx create-cedar-app@5.0.0-canary.2604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant