perf: bundle yaml from its ES module build #324
main fromrefs/pull/324/head·merged by LadyBluenotes(GitHub profile, opens in a new tab) 🎯 Changes#
- tsdown builds for the
nodeplatform, soyamlresolved to its CommonJS build, and rolldown bundled that build whole. This change aliasesyamlto the ES module build that the package serves under itsdefaultexport condition, the same way the config already handlesjsonc-parser. - The built package goes from 810,204 to 782,245 bytes (27,959 fewer).
- Commands that parse YAML get faster: the
stalebenchmarks by 11% to 12%, thevalidatebenchmark by 9%, and thelistscan by 4%. Theloadbenchmarks and cold start are unchanged. - The two builds gave identical results for 678 YAML inputs taken from the repository and the test suite.
- Two differences in edge cases. A YAML warning, such as an unresolved tag, is now written to stderr by
console.warnwith a stack trace; before, it went throughprocess.emitWarning, andintent listandintent staleexited before Node printed it. TheLOG_STREAMandLOG_TOKENSenvironment variables no longer make the YAML parser print its tokens to stdout. - Adds a patch changeset.
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested this code locally with
pnpm run test:pr(runpnpm build:allfirst).
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
Summary by CodeRabbit#
- Improvements
- The package bundle is smaller, which can reduce the amount of code included in applications.
- YAML warning and token logging behavior has been adjusted.
- 1
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
Note
Currently processing new changes in this PR. This may take a few minutes, please wait...
⚙️ Run configuration
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
aec27fc0-a22f-4ac5-bcbc-db71437b1c89
📥 Commits
Reviewing files that changed from the base of the PR and between 5a0ec605b6b18bac367a9aa867f3277a3eabf34d and 079b57701aaef870129eb49bf2519d994fe14129.
📒 Files selected for processing (2)
.changeset/bundle-yaml-esm.mdpackages/intent/tsdown.config.ts
______________________________________________________________________________________________________ < My code reviews are like a Tesla: fully electric, increasingly autonomous, and occasionally on fire. > ------------------------------------------------------------------------------------------------------ \ \ (\__/) (•ㅅ•) / づ✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Comment `@coderabbitai help` to get the list of available commands.View your CI Pipeline Execution ↗ for commit 079b57701aaef870129eb49bf2519d994fe14129
Command Status Duration Result nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded 41s View ↗ nx run-many --targets=build✅ Succeeded 3s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-04 22:28:37UTCMerging this PR will improve performance by 12.94%#
:warning: Different runtime environments detected
Some benchmarks with significant performance changes were compared across different runtime environments, which may affect the accuracy of the results.
⚡ 3improved benchmarks✅ 9untouched benchmarksPerformance Changes#
Benchmark BASEHEADEfficiency ⚡ reports workspace drift97.6 ms 85.9 ms +13.59% ⚡ checks a shipped skills tree154.4 ms 136.6 ms +13.05% ⚡ reports workspace drift with shared artifacts99.5 ms 88.7 ms +12.18% Tip
Curious why performance improved? Comment
@codspeedbot explain why performance improvedon this PR, or directly use the CodSpeed MCP with your agent.
Comparingperf/bundle-yaml-esm(079b577) withmain(5a0ec60)
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 079b57701aaef870129eb49bf2519d994fe14129
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
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