Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a public helpers export in openapi-client that re-exports parseFormData and getIssueMessage from the standard adapter, adds documentation (new Form Data page and sidebar entry), updates server-action docs to reference the re-exported helpers, and fixes a duplicated trailing fragment in the bracket-notation docs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as App/Developer
participant Package as @orpc/openapi-client
participant Helpers as package helpers index
participant Std as adapters/standard
Dev->>Package: import { parseFormData, getIssueMessage } from "@orpc/openapi-client/helpers"
Note over Package,Helpers: New public export path "./helpers"
Package->>Helpers: resolve helpers entry -> re-exported symbols
Helpers->>Std: re-exports parseFormData & getIssueMessage
Std-->>Dev: functions available for use
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Summary of Changes
Hello @unnoq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces new helper utilities for efficiently handling HTML form data and validation errors, specifically focusing on parsing complex nested structures using bracket notation. It includes comprehensive documentation for these new features and integrates them into the existing documentation structure, enhancing the developer experience for form processing.
Highlights
- New Form Data Helpers Documentation: Introduced a new documentation page for
parseFormDataandgetIssueMessageutilities, detailing their functionality and usage with examples. parseFormDataUtility: AddedparseFormDatato deserialize complex nested objects and arrays from HTML form data using bracket notation.getIssueMessageUtility: ImplementedgetIssueMessageto extract validation error messages from standard schema issues based on bracket notation paths.- Package Export Update: The
openapi-clientpackage now exports these new form data helper utilities via a dedicated entry point (./helpers). - Documentation Cross-Referencing: Updated existing documentation to link to the new Form Data Helpers page and removed redundant explanations.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request introduces a new, more semantic export path @orpc/openapi-client/helpers for the existing parseFormData and getIssueMessage utilities. It also adds a dedicated documentation page for these helpers and updates other documentation to reference it. The changes are well-structured and improve the developer experience. I've found a couple of issues in the code examples in the new documentation file that should be addressed to ensure they are correct and runnable. My feedback is in the review comments.
More templates
@orpc/arktype
@orpc/client
@orpc/contract
@orpc/experimental-durable-event-iterator
@orpc/hey-api
@orpc/interop
@orpc/json-schema
@orpc/nest
@orpc/openapi
@orpc/openapi-client
@orpc/otel
@orpc/react
@orpc/react-query
@orpc/experimental-react-swr
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-aws-lambda
@orpc/standard-server-fetch
@orpc/standard-server-node
@orpc/standard-server-peer
@orpc/svelte-query
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/vue-colada
@orpc/vue-query
@orpc/zod
commit: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/openapi-client/package.json (1)
40-45: Top-level TS export wiring is correct; consider a minor version bumpAdding a new public subpath export is a feature; plan a minor version bump (via your changeset flow) before publishing.
If you use Changesets, do you want me to draft the changeset note for this package?
apps/content/docs/helpers/form-data.md (2)
14-32: Add a short note on types returned by parseFormDataClarify that values are strings or File/File[]; no automatic number/boolean coercion (use schema coercion).
Proposed addition after the example:
+::: note +`parseFormData` preserves raw types: text fields become `string`, file fields become `File` or `File[]`. It does not coerce types (e.g., numbers/booleans) — use your schema (e.g., `z.coerce.number()`). +:::
68-96: Optional: include a small file-input exampleSince many forms include files, a brief snippet showing
images[]->File[]would help readers connect with the Server Action example.Proposed addition:
+#### File inputs +```ts +const form = new FormData() +form.append('images[]', new File(['a'], 'a.txt')) +form.append('images[]', new File(['b'], 'b.txt')) +const data = parseFormData(form) +// data.images is File[] +```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
apps/content/.vitepress/config.ts(1 hunks)apps/content/docs/helpers/form-data.md(1 hunks)apps/content/docs/openapi/bracket-notation.md(0 hunks)apps/content/docs/server-action.md(1 hunks)packages/openapi-client/package.json(2 hunks)packages/openapi-client/src/helpers/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- apps/content/docs/openapi/bracket-notation.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: publish-commit
- GitHub Check: test
- GitHub Check: lint
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
apps/content/.vitepress/config.ts (1)
151-159: Form Data sidebar entry verified
apps/content/docs/helpers/form-data.md exists and matches the link/docs/helpers/form-datain config.ts; route will build correctly.packages/openapi-client/src/helpers/index.ts (1)
1-1: Approve: exports verified and accurately re-exported
Verified thatgetIssueMessageandparseFormDataare exported from the standard adapter and correctly re-exported by the React package.packages/openapi-client/package.json (1)
23-27: Export map for ./helpers is correct and matches dist layoutThe
publishConfig.exports["./helpers"]entries align with Unbuild output conventions.apps/content/docs/server-action.md (1)
276-312: Docs claim@orpc/reactre-exports helpers — verify import pathIf
@orpc/reactdoesn’t currently re-exportgetIssueMessageandparseFormData, switch the import to@orpc/openapi-client/helpersor add the re-export.Apply this fallback if needed:
-import { getIssueMessage, parseFormData } from '@orpc/react' +import { getIssueMessage, parseFormData } from '@orpc/openapi-client/helpers'apps/content/docs/helpers/form-data.md (2)
36-60: Good coverage of bracket-notation pathsExamples read well; wildcard array selector note is helpful.
62-64: Warning is accurate; link targets are correctNice guardrails about the expected issue format.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/openapi-client/src/helpers/index.test.ts (1)
1-3: Strengthen the test: assert both helpers and their typesAlso validate
parseFormDataand ensure both exports are functions. Rename the test to be descriptive.Apply this diff:
-it('exports something', async () => { - expect(await import('./index')).toHaveProperty('getIssueMessage') -}) +it('re-exports helpers: getIssueMessage and parseFormData', async () => { + const mod = await import('./index') + expect(typeof mod.getIssueMessage).toBe('function') + expect(typeof mod.parseFormData).toBe('function') +})
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/openapi-client/src/helpers/index.test.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: publish-commit
- GitHub Check: test
- GitHub Check: lint
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
packages/openapi-client/src/helpers/index.test.ts (2)
1-3: LGTM: minimal smoke test for the new helpers surfaceThe async dynamic import + property check is a reasonable smoke test for the public re-export.
1-3: Exports correctly configured for ./helpers
Foundexports["./helpers"]in package.json and bothgetIssueMessageandparseFormDataare re-exported inpackages/openapi-client/src/helpers/index.ts.
Summary by CodeRabbit
New Features
Documentation
Tests