Skip to content

feat(v28): Supporting Zod 4.4#3364

Merged
RobinTail merged 8 commits intomake-v28from
support-zod44
Apr 30, 2026
Merged

feat(v28): Supporting Zod 4.4#3364
RobinTail merged 8 commits intomake-v28from
support-zod44

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

adds xBrand() method to Zod Plugin instead of patching exiting one.
due to #3357

@RobinTail RobinTail added this to the v28 milestone Apr 30, 2026
@RobinTail RobinTail added enhancement New feature or request dependencies Pull requests that update a dependency file breaking Backward incompatible changes external bug it's a bug, but in a dependency labels Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9deb8bf2-bc0e-4990-b9ee-f2d57dd233ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch support-zod44

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.

@RobinTail RobinTail changed the title feat(v28): Supporting Zod 4.4, … feat(v28): Supporting Zod 4.4 Apr 30, 2026
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 30, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedzod@​4.3.6 ⏵ 4.4.1100 +1100100 +196 +8100

View full report

@coveralls-official
Copy link
Copy Markdown

coveralls-official Bot commented Apr 30, 2026

Coverage Status

coverage: 100.0%. remained the same — support-zod44 into make-v28

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Important

A few issues to address before merging.

Outside the diff (not commentable inline):

  • README.md lines 1105, 1254, 1269 still reference .brand() as the plugin's enhanced method. These should be updated to .xBrand() as part of this v28 work.
  • The zod-44-problem.md file appears to be a planning/scratch document. Consider whether it should be committed to the repo or removed before merge.
  • Zod 4.4 no longer populates jsonSchema.id from .meta({ id: "..." }), which causes the example's Feature schema to become Schema1 in the generated OpenAPI spec. The framework's documentation-helpers.ts:322-383 still reads depiction.id for naming components. This is a user-facing regression for anyone relying on .meta({ id }) for stable schema names in their docs — worth documenting in the CHANGELOG or compensating for in the framework.
Task list (5/5 completed)
  • Read the PR diff and understand the scope of changes
  • Examine high-risk areas: zod-plugin changes, runtime code
  • Examine CHANGELOG, documentation, and snapshot changes
  • Check zod-44-problem.md for context
  • Self-critique and submit review

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

Comment thread express-zod-api/tests/env.spec.ts
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md
Comment thread express-zod-api/tests/__snapshots__/documentation.spec.ts.snap Outdated
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Apr 30, 2026

Fixed the typo "distinguisable""distinguishable" in CHANGELOG.md as requested.

Pullfrog  | View workflow run | via Pullfrog | Using Claude Opus𝕏

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Apr 30, 2026

Fixed the typo ("intto""into") in express-zod-api/tests/env.spec.ts and pushed.

Task list (2/2 completed)
  • Fix typo "intto" → "into" in env.spec.ts
  • Commit, push, and reply to review comment

Pullfrog  | View workflow run | via Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

No new issues. Reviewed the following changes:

  • Added filterNaming in fixReferences to preserve user-defined schema names (from .meta({ id })) while filtering out Zod's auto-generated $defs keys (matching schema\d+$), fixing the component naming regression when depiction.id is no longer populated by Zod 4.4
  • Updated Zod from 4.3.6 to 4.4.1 and widened the peer/dev specifiers from ~4.3.4 to ^4.3.4/^4.4.1
  • Updated snapshots to reflect Zod 4.4 behavioral changes (CUID regex pattern, undefined optionality, removal of id from JSON schema output)

Prior review feedback:

  • Zod 4.4 depiction.id regression causing schema names to be lost — addressed via filterNaming fallback

Pullfrog  | View workflow run | Using Claude Opus𝕏

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Apr 30, 2026

Acknowledged the author's fix in 2d3edc3 for the CHANGELOG grammar issue. Thread resolved — no further changes needed.

Task list (2/2 completed)
  • Review author's reply to CHANGELOG grammar comment
  • Acknowledge fix - no further changes needed

Pullfrog  | View workflow run | via Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

No new issues. Reviewed the following changes:

  • Updated README.md references from .brand() to .xBrand() at all three locations (plugin method list, brand handling prose, and code example)

Prior review feedback:

  • README.md lines 1105, 1254, 1269 still reference .brand() — addressed

Pullfrog  | View workflow run | Using Claude Opus𝕏

@RobinTail
Copy link
Copy Markdown
Owner Author

@pullfrog please review. Tell me if I'm missing something.

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Reviewed — no issues found.

The changes are well-structured and handle the Zod 4.4 compatibility correctly:

  • fixReferences in documentation-helpers.ts — correctly adapts to Zod 4.4's change where .meta({ id }) no longer appears as a property in the JSON schema output but instead becomes the $defs key. The filterNaming regex correctly filters both schema0 and __schema0 auto-generated keys.
  • .brand().xBrand() rename — clean approach that avoids conflicting with Zod 4.4's native .brand() (which is now purely structural/type-level, not runtime). The simpler defineProperty with value (instead of the set/get accessor dance) is a nice cleanup.
  • No migration rule for .brand().xBrand() — this is the right call since Zod's native .brand() still exists and an automated rename could incorrectly transform legitimate native usages.
  • Snapshot changes (undefined?: undefinedundefined: undefined) — correctly reflects Zod 4's semantics where z.undefined() means "key must be present with value undefined", not "key is optional".

Re "am I missing something": I don't see anything missing. The CHANGELOG, README, plugin README, and plugin CHANGELOG are all consistent with the code changes. The diff block in CHANGELOG correctly shows only the changes covered by the automated migration tool.

Task list (4/4 completed)
  • Read the full diff to understand the scope of changes
  • Investigate high-risk areas (documentation helpers, zod-plugin changes, breaking changes)
  • Check for stale references or missing updates
  • Submit review

Pullfrog  | View workflow run | Using Claude Opus𝕏

Comment thread zod-plugin/src/augmentation.ts Outdated
Copy link
Copy Markdown
Owner Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

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

🏁

@RobinTail RobinTail added the documentation Improvements or additions to documentation label Apr 30, 2026
@RobinTail RobinTail merged commit db72038 into make-v28 Apr 30, 2026
12 checks passed
@RobinTail RobinTail deleted the support-zod44 branch April 30, 2026 15:54
RobinTail added a commit that referenced this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Backward incompatible changes dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request external bug it's a bug, but in a dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant