Skip to content

feat: vite 8 support#560

Merged
Brentlok merged 3 commits into
mainfrom
vite-8
Jun 1, 2026
Merged

feat: vite 8 support#560
Brentlok merged 3 commits into
mainfrom
vite-8

Conversation

@Brentlok

@Brentlok Brentlok commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

fixes #554

Summary by CodeRabbit

  • Chores

    • Updated dependencies: Tailwind CSS, Vite, TypeScript types, and build tools across the monorepo.
    • Switched E2E test setup to use Bun instead of esbuild.
  • Bug Fixes

    • Fixed null value handling in CSS rule serialization.
  • New Features

    • Vite adapter now detects and configures automatically for Vite 8 and Vite 7.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR upgrades the monorepo to Vite 8.0.14 while maintaining backward compatibility with Vite 7, fixes a Lightning CSS serialization issue with null values in class rules, and updates dependencies including Tailwind CSS to 4.3.0. It also migrates e2e test bundling from esbuild to Bun.

Changes

Vite 8 Compatibility and Lightning CSS Fixes

Layer / File(s) Summary
Dependency version updates across monorepo
package.json, apps/vite-example/package.json, packages/uniwind/package.json
Vite catalog bumped to 8.0.14, Tailwind CSS and related packages updated to 4.3.0, esbuild removed from devDependencies, and test:e2e script updated to use Bun for Playwright.
Vite 8 adapter with dual-version configuration
packages/uniwind/src/bundler/adapters/vite/vite.ts
Runtime detection of installed Vite major version. Separate optimizeDeps and resolve.alias configurations for Vite 8 (rolldown-based) vs Vite 7 (esbuild-based), with conditional routing in plugin config. Shared resolveOrderedCSSStyleSheet resolver handles module resolution for both versions.
Lightning CSS null-value serialization fix
packages/uniwind/src/bundler/css-visitor/rule-visitor.ts
processClassStyle method wraps returned rule object with removeNulls() to strip null values from nested structure before serialization, preventing Lightning CSS deserialization errors.
E2E test bundler migration to Bun
packages/uniwind/tests/e2e/global-setup.ts
Replaces esbuild invocation with Bun.build for bundling getWebStyles.ts to IIFE. Adds explicit success check and error handling that concatenates bundle.logs on failure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • uni-stack/uniwind#437: E2E test setup updates to Bun.build share identical bundler migration logic in global-setup.ts.
  • uni-stack/uniwind#368: Both PRs modify the Vite plugin's resolveId routing for createOrderedCSSStyleSheet imports to apply RNW stylesheet patches.

Poem

🐰 A Vite 8 dawn breaks over Uniwind's shore,
Where rolldown dances where esbuild was before,
Lightning CSS nulls no longer cause dismay,
And Bun bundles tests in a swifter way!
Dark prefixes bloom—the bug's now gone,
Compatibility shines from dusk to dawn. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: vite 8 support' accurately describes the main change—adding Vite 8 compatibility to the codebase.
Linked Issues check ✅ Passed The PR addresses issue #554 by implementing Vite version detection and conditional configuration for Vite 8 vs 7, removing null values from CSS AST to fix Lightning CSS serialization, and updating dependencies.
Out of Scope Changes check ✅ Passed All changes are scoped to supporting Vite 8: dependency updates, Vite version detection, conditional config routing, null value removal in CSS AST, and build tooling migration from esbuild to Bun.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vite-8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/uniwind/tests/e2e/global-setup.ts`:
- Around line 38-51: Bun.build currently throws on failure so the if
(!bundle.success) branch is never reached; update the call to Bun.build (used in
the test setup around entryPath/GENERATED_DIR) to use throw: false (or wrap the
Bun.build call in try/catch) so a failed build returns a bundle object with
bundle.success === false and you can format and throw
bundle.logs.map(...).join('\n') as intended; ensure you reference bundle.success
and bundle.logs in the failure path (or handle the caught error to produce the
same formatted message).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a097ce5f-6a20-4d4e-9a73-cf35c32f9dd6

📥 Commits

Reviewing files that changed from the base of the PR and between 531b3c0 and 564dd89.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • apps/vite-example/package.json
  • package.json
  • packages/uniwind/package.json
  • packages/uniwind/src/bundler/adapters/vite/vite.ts
  • packages/uniwind/src/bundler/css-visitor/rule-visitor.ts
  • packages/uniwind/tests/e2e/global-setup.ts

Comment thread packages/uniwind/tests/e2e/global-setup.ts
@Brentlok Brentlok merged commit 1cad2cb into main Jun 1, 2026
2 checks passed
@Brentlok Brentlok deleted the vite-8 branch June 1, 2026 09:00
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🚀 This pull request is included in v1.8.0. See Release v1.8.0 for release notes.

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.

Vite + Uniwind breaks dark: prefixes

1 participant