Repository navigation
perf: reduce repeated Zod validation work - #8305
LadyBluenotes wants to merge 12 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5… |
| 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. |
| Title check | ✅ Passed | The title clearly summarizes the primary change: reducing repeated Zod validation work through performance optimizations. |
| Description check | ✅ Passed | The description follows the repository template, explains the changes and motivation, completes all checklist items, and identifies the release impact with a changeset. |
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create PR with unit tests
- Commit unit tests in branch
perf/zod-validation-fast-path
-
- Autofix · 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 16d9487
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview6 package(s) bumped directly, 17 bumped as dependents. 🟩 Patch bumps
|
Bundle Size BenchmarksThis pull request does not affect bundle size in any measured scenario. |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
572e1ad to
0a079c5
Compare
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
We've reverted the seroval/seroval-plugins bump from ^1.6.2 to ^1.6.7 that was introduced on this branch (not present on main) but never mentioned in the PR's stated intent of reducing Zod validation work. This dependency handles promise/stream serialization for SSR, and it was the only plausible source of the tanstack-solid-start-e2e-serialization-adapters:test:e2e failure, where the "stream" test hung for 30s waiting on a suspended Await boundary to resolve. Restoring 1.6.2 removes the incidental regression risk while keeping the actual Zod code-splitting/metadata compilation changes intact.
Tip
✅ We verified this fix by re-running tanstack-solid-start-e2e-serialization-adapters:test:e2e.
Warning
The suggested diff is too large to display here, but you can view it on Nx Cloud ↗
Or Apply changes locally with:
npx nx-cloud apply-locally 5Syb-JdUf
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Main upgraded to Vitest 5 (#8723), which removed the top-level `bench` export. Compare the uncompiled and compiled schemas with `bench.compare` inside a test, matching how main migrated its other benchmarks.
Zod 4.6.2 keeps `undefined` in `.prefault()` output types when the inner schema's output allows it (colinhacks/zod#6587). The Start options schemas used `.optional().prefault({})`, so every parsed config section became possibly undefined. `.prefault()` already accepts undefined input, so drop the redundant `.optional()`; input types and parsed values are unchanged.
🦋 Changeset detectedLatest commit: 16d9487 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
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 |
| ## Examples | ||
|
|
||
| ```tsx | ||
| import { z } from 'zod' |
There was a problem hiding this comment.
why were thoses imports changed?
|
please split this into separate PRs (e.g. one for zod upgrade, ...) |
🎯 Changes
Replaces #8301 with only the Zod validation work, based directly on
main.Compile the code-splitting grouping schema and check duplicates without flattening or copying arrays. Skip Zod parsing for Rspack modules without server-function metadata. Preserve grouping diagnostics and valid metadata parsing, including cloned output and unknown-key stripping.
Add behavior tests and Vitest benchmarks for grouping validation and metadata restoration.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
Performance
Bug Fixes
Documentation
Tests