Skip to content

fix(conform-react): support resolveSubmission on server - #1334

Open
edmundhung wants to merge 1 commit into
mainfrom
edmundhung/fix-resolve-submission-server
Open

edmundhung wants to merge 1 commit into
mainfrom
edmundhung/fix-resolve-submission-server

Conversation

@edmundhung

@edmundhung edmundhung commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a server-safe resolver factory to the existing intent module
  • use the same factory for both the default export and configureForms
  • run the existing resolveSubmission coverage in both Node and browser test projects

Fixes the issue reported in #954 (comment).

Verification

  • pnpm --filter @conform-to/react typecheck
  • pnpm --filter @conform-to/react build
  • pnpm --filter @conform-to/react exec vitest --project 'conform-react (node)' --run --typecheck.enabled=false
Generated Summary
  • Added createSubmissionResolver for server-safe resolveSubmission support.
  • Reused the resolver factory for default exports and configured forms.
  • Moved resolveSubmission exports to intent.
  • Added Node and browser coverage for intent resolution cases.
  • Added a patch changeset for @conform-to/react.

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 680b4f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@conform-to/react Patch
@conform-to/dom Patch
@conform-to/valibot Patch
@conform-to/yup Patch
@conform-to/zod Patch

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

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 50e3d706-52bb-426b-a5a4-fcbbfb631ed1

📥 Commits

Reviewing files that changed from the base of the PR and between b1af2a5 and 680b4f4.

📒 Files selected for processing (4)
  • packages/conform-react/future/forms.tsx
  • packages/conform-react/future/index.ts
  • packages/conform-react/future/intent.ts
  • packages/conform-react/tests/resolveSubmission.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: Validate Preview / Examples
  • GitHub Check: E2E Tests (windows-latest, chromium, 22)
  • GitHub Check: E2E Tests (macos-latest, webkit, 22)
  • GitHub Check: Future API Tests (windows-latest, chromium, 22)
  • GitHub Check: E2E Tests (ubuntu-latest, webkit, 22)
  • GitHub Check: Future API Tests (macos-latest, webkit, 22)
  • GitHub Check: Future API Tests (macos-latest, chromium, 22)
  • GitHub Check: E2E Tests (macos-latest, chromium, 22)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
packages/conform-react/future/intent.ts (1)

564-596: LGTM!

Also applies to: 603-605

packages/conform-react/tests/resolveSubmission.test.ts (1)

1-98: LGTM!

packages/conform-react/future/forms.tsx (1)

2-2: LGTM!

Also applies to: 43-43, 80-80

packages/conform-react/future/index.ts (1)

46-46: LGTM!


📝 Walkthrough

Walkthrough

The PR moves resolveSubmission into a shared submission module, re-exports it from the future API, updates the login action to use targetValue, and adds tests for supported and unknown intents.

Changes

Submission resolution API

Layer / File(s) Summary
Submission resolution functions
packages/conform-react/future/submission.ts
Adds resolveSubmissionWithHandlers and resolveSubmission. The functions parse intents, resolve target values, and merge default and custom handlers.
Forms integration and public export
packages/conform-react/future/forms.tsx, packages/conform-react/future/index.ts
Updates forms processing to use the shared resolver and re-exports resolveSubmission from submission.ts.
Consumer validation and release metadata
examples/nextjs/app/login/_action.ts, packages/conform-react/tests/resolveSubmission.node.test.ts, .changeset/calm-forms-resolve.md
Updates login validation to use targetValue, adds resolution-path tests, and declares a patch release.

Priority: ⬇️ Low — Defer the server-side submission resolver change because it is a focused @conform-to/react API update without elevated external urgency.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 680b4

This change makes submission resolution available through the server-safe intent API while preserving configured form handlers and existing resolution behavior. No concrete current-head merge risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant LoginAction
  participant resolveSubmission
  participant IntentHandlers
  participant Validation
  LoginAction->>resolveSubmission: resolve submission
  resolveSubmission->>IntentHandlers: parse and resolve intent
  IntentHandlers-->>resolveSubmission: return intent and targetValue
  resolveSubmission-->>LoginAction: return resolved submission data
  LoginAction->>Validation: validate targetValue or empty object
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling resolveSubmission for server-side use in conform-react.

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

A rabbit hops through forms so bright
Resolving intents left and right
Payloads rest in fields anew
Tests watch each pathway through
Server components join the play
And patches mark the launch today

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploying conform with  Cloudflare Pages  Cloudflare Pages

Latest commit: 680b4f4
Status: ✅  Deploy successful!
Preview URL: https://7a69546a.conform.pages.dev
Branch Preview URL: https://edmundhung-fix-resolve-submi.conform.pages.dev

View logs

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2026

Copy link
Copy Markdown
More templates

@conform-to/dom

npm i https://pkg.pr.new/@conform-to/dom@1334

@conform-to/react

npm i https://pkg.pr.new/@conform-to/react@1334

@conform-to/valibot

npm i https://pkg.pr.new/@conform-to/valibot@1334

@conform-to/validitystate

npm i https://pkg.pr.new/@conform-to/validitystate@1334

@conform-to/yup

npm i https://pkg.pr.new/@conform-to/yup@1334

@conform-to/zod

npm i https://pkg.pr.new/@conform-to/zod@1334

commit: 680b4f4

@edmundhung
edmundhung force-pushed the edmundhung/fix-resolve-submission-server branch 3 times, most recently from 1145714 to 1d094e3 Compare September 8, 2026 12:44
@edmundhung
edmundhung force-pushed the edmundhung/fix-resolve-submission-server branch from 1d094e3 to 680b4f4 Compare September 8, 2026 12:45
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