Skip to content

Make UnoCSS compilation Worker-safe - #10

Merged
andycamara merged 1 commit into
mainfrom
fix/worker-safe-unocss
Aug 2, 2026
Merged

andycamara merged 1 commit into
mainfrom
fix/worker-safe-unocss

Conversation

@andycamara

Copy link
Copy Markdown
Contributor

Summary

  • Import the runtime compiler from @unocss/core.
  • Remove the directives transformer from published-site token compilation.
  • Add a Worker bundle guard for createRequire-based loaders.
  • Declare @unocss/core as a direct dependency.

Root cause

The broad unocss entry and directives transformer pulled a CommonJS createRequire-based css-tree loader into the Cloudflare Worker bundle.

Impact

Runtime utility CSS compilation remains available without shipping Node-only loader behavior to workerd.

Validation

  • UnoCSS configuration tests passed.
  • A fresh production build passed bundle integrity and Cloudflare Worker size checks.
  • The combined v0.5.10 series passed 4,842 tests with 1 skipped, plus runtime and package smoke.

Release plan

Part 6 of 9 for v0.5.10. This PR intentionally excludes the separate SSR optimizer configuration fix.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@andycamara, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c328c80a-d18b-4d38-ab8e-be47b68ad6d3

📥 Commits

Reviewing files that changed from the base of the PR and between a08affd and 1b26af8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • aria/lib/styles/compileUnoCSS.ts
  • aria/scripts/check-vite-bundle-integrity.ts
  • aria/tests/lib/unoUserConfig.test.ts
  • package.json
  • uno.user.config.ts

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.

@andycamara
andycamara marked this pull request as ready for review July 30, 2026 15:34
@andycamara
andycamara force-pushed the fix/worker-safe-unocss branch from 01757a4 to 1b26af8 Compare August 2, 2026 17:59
@andycamara
andycamara merged commit b5a73b0 into main Aug 2, 2026
4 checks passed
@andycamara
andycamara deleted the fix/worker-safe-unocss branch August 2, 2026 18:11
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