Skip to content

build: shim oxc-parser via rolldown/utils#4237

Merged
pi0 merged 3 commits intomainfrom
build/shim-oxc-parser
Apr 29, 2026
Merged

build: shim oxc-parser via rolldown/utils#4237
pi0 merged 3 commits intomainfrom
build/shim-oxc-parser

Conversation

@pi0
Copy link
Copy Markdown
Member

@pi0 pi0 commented Apr 29, 2026

Shim the optional oxc-parser peer dependency of unimport via a local package that re-exports parseSync from rolldown/utils.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Apr 29, 2026 0:02am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 109af068-d966-4b17-b897-a68aac158fc3

📥 Commits

Reviewing files that changed from the base of the PR and between 3af25a2 and f75cbc6.

📒 Files selected for processing (1)
  • build.config.ts

📝 Walkthrough

Walkthrough

Adds a local shim package shims/oxc-parser that re-exports parse/parseSync from rolldown/utils, wires that shim into package resolution via package.json, and updates chunk grouping logic to recognize modules under shims alongside node_modules.

Changes

Cohort / File(s) Summary
Root package configuration
package.json
Adds oxc-parser to devDependencies and a package resolution override mapping oxc-parser./shims/oxc-parser.
Local shim package
shims/oxc-parser/index.mjs, shims/oxc-parser/package.json
Creates a private ES module shim that re-exports parse and parseSync from rolldown/utils, defines exports/main, and declares rolldown as a peerDependency.
Build chunking logic
build.config.ts
Refactors output chunk grouping to detect library packages by a shared regex that matches both node_modules and shims paths and reuses the same regex for package-name extraction.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'build:' prefix and clearly describes the main change: shimming oxc-parser via rolldown/utils.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of shimming oxc-parser and how it re-exports parseSync from rolldown/utils.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 build/shim-oxc-parser

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4237

commit: 3af25a2

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shims/oxc-parser/index.mjs`:
- Line 1: The shim currently re-exports only parse and parseSync from
rolldown/utils; update the export statement that references parse and parseSync
so it also re-exports Visitor (the same exported symbol name used by oxc-parser)
to match the upstream API surface—locate the export line that reads "export {
parse, parseSync } from 'rolldown/utils'" and add Visitor to the named exports
so the module exposes parse, parseSync, and Visitor.

In `@shims/oxc-parser/package.json`:
- Around line 12-14: Update the package.json peerDependencies entry for
"rolldown" to a constrained version range that matches the version pinned in the
main package.json instead of "*"; specifically edit the "peerDependencies" ->
"rolldown" value to the same semver string used in the main package.json so the
shim that imports from "rolldown/utils" only accepts compatible versions.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 903293bb-0bd4-4fb7-bffe-49a99901066a

📥 Commits

Reviewing files that changed from the base of the PR and between f92e684 and 3af25a2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • package.json
  • shims/oxc-parser/index.mjs
  • shims/oxc-parser/package.json

Comment thread shims/oxc-parser/index.mjs
Comment thread shims/oxc-parser/package.json
@pi0 pi0 merged commit a027ae8 into main Apr 29, 2026
9 of 11 checks passed
@pi0 pi0 deleted the build/shim-oxc-parser branch April 29, 2026 12:02
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