Add getDirtyInput, getDirtyPaths and pickDirty method#98
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR adds a dirty-field extraction system: a core getDirtyFieldInput utility and three public methods—getDirtyInput, getDirtyPaths, and pickDirty—plus tests, package re-exports, API MDX pages and properties metadata, and framework-specific "Dirty fields" guides and menu updates across React, Vue, Svelte, Solid, Qwik, and Preact. The implementation treats arrays as atomic, recurses objects selectively, and returns undefined when no dirty descendants exist. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
3 issues found across 50 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="website/src/routes/(docs)/methods/api/(methods)/pickDirty/index.mdx">
<violation number="1" location="website/src/routes/(docs)/methods/api/(methods)/pickDirty/index.mdx:14">
P2: This description overstates the `undefined` case. Shape mismatch is handled per-branch, so `pickDirty` can still return a partial object when some dirty branches align.</violation>
</file>
<file name="website/src/routes/(docs)/methods/api/(methods)/getDirtyPaths/properties.ts">
<violation number="1" location="website/src/routes/(docs)/methods/api/(methods)/getDirtyPaths/properties.ts:19">
P2: The documented return item type is too narrow: `getDirtyPaths` returns `Path[]`, not `RequiredPath[]`, so this excludes valid empty-root paths.</violation>
</file>
<file name="website/src/routes/(docs)/methods/api/(methods)/getDirtyInput/properties.ts">
<violation number="1" location="website/src/routes/(docs)/methods/api/(methods)/getDirtyInput/properties.ts:79">
P2: The documented `result` type omits the `TFieldPath extends RequiredPath ? ... : ...` conditional, so it misrepresents the return type for form-level calls without a field path.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18433f535c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds three new dirty-state extraction methods to Formisch (getDirtyInput, getDirtyPaths, pickDirty) plus a supporting core helper getDirtyFieldInput. Each method walks the form's tree, prunes clean subtrees, and treats arrays as atomic. The PR also adds per-framework guides and full API reference pages for the new methods and their config types, plus tests and changelog entries.
Changes:
- New methods in
packages/methods(getDirtyInput,getDirtyPaths,pickDirty) with tests and barrel exports. - New core helper
getDirtyFieldInput(shared engine forgetDirtyInput) with tests. - New documentation: per-framework
dirty-fieldsguides, API pages for the three methods and their config types, and menu links acrosspreact/qwik/react/solid/svelte/vue.
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/field/getDirtyFieldInput/{getDirtyFieldInput.ts,index.ts,test} | New core helper that extracts dirty input from a field store, plus tests |
| packages/core/src/field/index.ts | Re-export the new helper |
| packages/core/CHANGELOG.md | Changelog entry for the new core helper (placeholder version) |
| packages/methods/src/getDirtyInput/* | New method wrapping getDirtyFieldInput with form/field overloads and tests |
| packages/methods/src/getDirtyPaths/* | New method that collects paths to dirty fields (arrays atomic) and tests |
| packages/methods/src/pickDirty/* | New method filtering an external value down to its dirty parts, plus tests |
| packages/methods/src/index.ts | Re-export the three new methods |
| packages/methods/CHANGELOG.md | Changelog entries for the three new methods (placeholder version) |
| website/.../methods/api/(methods)/{getDirtyInput,getDirtyPaths,pickDirty}/* | API reference pages and property metadata |
| website/.../methods/api/(types)/{GetField,GetForm}{DirtyInput,DirtyPaths}Config/, PickDirtyConfig/ | Config type reference pages |
| website/.../{preact,qwik,react,solid,svelte,vue}/api/menu.md | Menu entries for the new methods and config types |
| website/.../{preact,qwik,react,solid,svelte,vue}/guides/menu.md | Menu entry for the new "Dirty fields" guide |
| website/.../{preact,qwik,react,solid,svelte,vue}/guides/(advanced-guides)/dirty-fields/index.mdx | New per-framework "Dirty fields" guide |
Comments suppressed due to low confidence (1)
website/src/routes/(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdx:183
- The performance note states that the cost "degrades toward
O(N²)for deeply nested trees with few siblings at each level". This characterization is misleading: walking a tree where each parent has few children (say, a chain) is stillO(N)total work via DFS. The reason these methods are slower than a single DFS is that each level callsgetFieldBoolrecursively to decide whether to descend, which on a chain of depthDcostsO(D)per level, givingO(D²)— that'sO(N²)only becauseD ≈ Nin this degenerate case. Worth rewording as "degenerate chain-like nesting" or just dropping the qualifier, otherwise readers may misinterpret "few siblings" alone as the slow case. Same wording appears in the per-method index.mdx files (getDirtyInput,getDirtyPaths,pickDirty) and all five framework guides.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (19)
website/src/routes/(docs)/methods/api/(methods)/getDirtyInput/index.mdx (1)
1-53:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winResolve formatting issues before merge.
CI currently fails
prettier --checkin the website package, so this docs batch needs a Prettier pass before merge.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(methods)/getDirtyInput/index.mdx around lines 1 - 53, The MDX file for the getDirtyInput docs failed Prettier; run a Prettier pass to fix formatting and commit the changes (e.g. run prettier --write for the website package or target this MDX file), then push the formatted file so CI `prettier --check` passes; locate the file by the document title/header "getDirtyInput" or the import lines (import { ApiList, Property } from '~/components'; and source: /packages/methods/src/getDirtyInput/getDirtyInput.ts) and ensure only formatting changes are included in the fix.website/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/index.mdx (1)
31-31:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
<ApiList items={[{ text: 'getDirtyPaths', href: '../getDirtyPaths/' }]} /> +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/index.mdx at line 31, Add a single trailing newline at the end of the MDX file for GetFieldDirtyPathsConfig to satisfy Prettier: open website/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/index.mdx, move the cursor to the end of the file and insert one newline character so the file ends with a newline.website/src/routes/(docs)/methods/api/(methods)/getDirtyPaths/properties.ts (1)
79-79:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
}, }; +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(methods)/getDirtyPaths/properties.ts at line 79, The file properties.ts for the getDirtyPaths API is missing a trailing newline which breaks Prettier; open that file (module properties.ts / the exported properties definitions at the end of the file) and add a single newline character at the end of the file so the file ends with a blank line, then save and re-run Prettier/CI.website/src/routes/(docs)/methods/api/(types)/PickDirtyConfig/properties.ts (1)
17-17:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
}, }; +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(types)/PickDirtyConfig/properties.ts at line 17, Add a single trailing newline at the end of the file website/src/routes/(docs)/methods/api/(types)/PickDirtyConfig/properties.ts to satisfy Prettier; simply open properties.ts and ensure there is a blank line (newline character) after the last character so the file ends with a newline.website/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/properties.ts (1)
45-45:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
}, }; +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/properties.ts at line 45, Add a trailing newline at the end of website/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/properties.ts to satisfy Prettier; open the file (properties.ts) and ensure the final line ends with a newline character (no other edits).website/src/routes/(docs)/methods/api/(methods)/pickDirty/index.mdx (1)
51-51:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
]} /> +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(methods)/pickDirty/index.mdx at line 51, The file website/src/routes/(docs)/methods/api/(methods)/pickDirty/index.mdx is missing a trailing newline which breaks the Prettier check; fix it by editing index.mdx and adding a single newline character at the end of the file (ensure the file ends with a blank line), then save and re-run the formatter/CI to confirm Prettier passes.website/src/routes/(docs)/methods/api/(methods)/getDirtyPaths/index.mdx (1)
52-52:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
]} /> +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(methods)/getDirtyPaths/index.mdx at line 52, The MDX file for getDirtyPaths is missing a trailing newline which breaks Prettier; open the getDirtyPaths index.mdx file and add a single newline character at the end of the file (ensure the file ends with an empty line) so the Prettier/CI check passes.website/src/routes/(docs)/methods/api/(methods)/pickDirty/properties.ts (1)
64-64:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
}, }; +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(methods)/pickDirty/properties.ts at line 64, The file website/src/routes/(docs)/methods/api/(methods)/pickDirty/properties.ts is missing a trailing newline which breaks Prettier/CI; open properties.ts and add a single newline character at the end of the file (ensure the file ends with a final blank line), then save and re-run the formatter/CI to confirm the Prettier check passes.website/src/routes/(docs)/methods/api/(types)/PickDirtyConfig/index.mdx (1)
30-30:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd trailing newline to fix Prettier check.
The file is missing a trailing newline, causing the CI Prettier check to fail. Add a newline at the end of the file.
✨ Proposed fix
<ApiList items={[{ text: 'pickDirty', href: '../pickDirty/' }]} /> +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/methods/api/(types)/PickDirtyConfig/index.mdx at line 30, The MDX file for PickDirtyConfig is missing a trailing newline which breaks Prettier; open the PickDirtyConfig index.mdx content and add a single newline character at the end of the file (ensure the file ends with '\n') so the Prettier check passes.website/src/routes/(docs)/react/guides/(advanced-guides)/dirty-fields/index.mdx (1)
1-197:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/react/guides/(advanced-guides)/dirty-fields/index.mdx around lines 1 - 197, This MDX file ("Dirty fields" guide that imports Link and documents getDirtyInput/getDirtyPaths/pickDirty) has Prettier formatting violations; fix by running the formatter and committing the result: run prettier --write . from the website directory, re-check CI, and commit the updated file so the frontmatter, import line (import { Link } from '~/components';) and the code blocks for getDirtyInput/getDirtyPaths/pickDirty are consistently formatted.website/src/routes/(docs)/svelte/guides/(advanced-guides)/dirty-fields/index.mdx (1)
1-190:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/svelte/guides/(advanced-guides)/dirty-fields/index.mdx around lines 1 - 190, This MDX file ("Dirty fields", starting with "import { Link }") fails Prettier formatting; fix by running Prettier over the website content (from the website directory run: prettier --write .), then stage/commit the updated file so CI passes; ensure code fences and inline imports like "import { Link }", and examples referencing getDirtyInput/getDirtyPaths/pickDirty remain syntactically unchanged except for formatting.website/src/routes/(docs)/vue/guides/menu.md (1)
1-26:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/vue/guides/menu.md around lines 1 - 26, CI flagged Prettier formatting issues in the menu markdown (headings like "Guides", "## Get started" and the list items such as "[Introduction](/vue/guides/introduction/)"); fix by running the formatter (prettier --write . from the website directory), verify the markdown list/heading spacing is normalized, re-stage the updated menu.md and commit the formatted file so CI passes.website/src/routes/(docs)/react/api/menu.md (1)
1-78:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/react/api/menu.md around lines 1 - 78, The markdown under the "API reference" heading (sections like "Hooks", "Components", "Methods", "Types" and entries such as "useForm", "Form", "focus", "DeepPartial", etc.) has Prettier formatting violations; run Prettier (e.g. from the website directory run prettier --write . or run Prettier on this file) to reformat the file, verify the lists and headings remain intact, then stage and commit the formatted file.website/src/routes/(docs)/svelte/api/menu.md (1)
1-79:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/svelte/api/menu.md around lines 1 - 79, The file menu.md has Prettier formatting violations; run Prettier to reformat it (e.g., from the website directory run `prettier --write .`) which will normalize headings and list spacing (see "API reference", "Runes", "Components", and the Methods/Types lists), then stage and commit the updated menu.md so CI passes; if your repo uses a package script (e.g., npm/yarn format), run that instead and ensure the commit contains only the formatting changes.website/src/routes/(docs)/react/guides/menu.md (1)
1-26:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/react/guides/menu.md around lines 1 - 26, This file has Prettier formatting violations; run the formatter and commit the fixed file: run prettier --write targeting the affected markdown (menu.md) from the website project, save the updated file, verify the headings/links under "Guides" / "Get started" / "Main concepts" remain unchanged, and re-run CI to ensure the formatting issues are resolved before merging.website/src/routes/(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdx (1)
1-186:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdx around lines 1 - 186, CI reports Prettier formatting violations in the "Dirty fields" MDX (frontmatter title: "Dirty fields") — run the formatter (e.g. execute prettier --write . from the website directory), review and stage the resulting changes for this file (index.mdx under the dirty-fields guide), then amend your PR with the formatted file so the CI formatting check passes.website/src/routes/(docs)/vue/api/menu.md (1)
1-78:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting issues before merge.
The CI pipeline reports formatting violations in this file. Run
prettier --write .from the website directory to fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/vue/api/menu.md around lines 1 - 78, The file menu.md has Prettier formatting violations—run Prettier to reformat this file (e.g., run prettier --write on menu.md or the documentation sources), stage and commit the updated menu.md, and push the changes so CI can re-run; confirm that headings like "API reference" and the lists of Composables/Components/Methods/Types in menu.md are preserved after formatting.website/src/routes/(docs)/qwik/guides/(advanced-guides)/dirty-fields/index.mdx (1)
1-197:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winRun Prettier to fix formatting issues.
This file has Prettier formatting violations that are causing the CI pipeline to fail. The error indicates that 4 files in the PR need formatting.
Run the following command to fix formatting issues across all affected files:
prettier --write .🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/qwik/guides/(advanced-guides)/dirty-fields/index.mdx around lines 1 - 197, The MDX doc titled "Dirty fields" (uses the Link import and contains headings like "Dirty fields" and "The three methods") has Prettier formatting violations; run the formatter (prettier --write .) to reformat the file(s), review the changed MDX to ensure imports/JSX stayed valid, stage and commit the reformatted files, and push the commit so CI picks up the fixed formatting.website/src/routes/(docs)/preact/guides/(advanced-guides)/dirty-fields/index.mdx (1)
1-197:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRun Prettier on this file to unblock CI.
The pipeline reports this file failing
prettier --check; please format it (and related docs files) before merge.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/`(docs)/preact/guides/(advanced-guides)/dirty-fields/index.mdx around lines 1 - 197, The CI failed Prettier for the "Dirty fields" MDX guide (the doc containing the getDirtyInput/getDirtyPaths/pickDirty examples and the frontmatter title "Dirty fields"); fix it by running the project's formatter (e.g., prettier --write) on that MDX file and any related docs that Prettier flags, re-running the prettier/lint check locally to confirm, and committing the formatted files so the pipeline passes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/methods/src/pickDirty/pickDirty.test.ts`:
- Around line 1-124: The test file containing describe('pickDirty') and imports
of pickDirty has formatting issues causing CI failures; run the project's
formatter (Prettier) across the repo or use the project's format script (e.g.,
pnpm prettier --write or npm run format), reformat the file containing the
pickDirty tests, and commit the updated formatting so CI passes.
In `@packages/methods/src/pickDirty/pickDirty.ts`:
- Around line 67-74: The branch in pickDirty.ts that handles
internalFieldStore.kind === 'object' incorrectly returns SKIP for nullable
clears (null/undefined); change the guard so null and undefined are treated as
valid clears instead of shape divergence. Concretely, update the condition that
currently returns SKIP (the check using value === null || typeof value !==
'object' || Array.isArray(value)) to only return SKIP when value is neither null
nor undefined AND is not an object or is an array (e.g. if (value !== null &&
value !== undefined && (typeof value !== 'object' || Array.isArray(value)))
return SKIP). Keep references to SKIP and internalFieldStore.kind === 'object'
so the rest of pickDirty logic can handle nullable clears.
In
`@website/src/routes/`(docs)/qwik/guides/(advanced-guides)/dirty-fields/index.mdx:
- Line 112: Replace the inconsistent phrase "input form" with "form input" in
the explanatory sentence that mentions getDirtyInput (the sentence starting
"After validation, `output.name`... `getDirtyInput` would give you the raw
strings..."), so it reads that the dirty state is bound to the "form input"
rather than the "input form" to match the terminology used elsewhere in this
guide and preserve consistency with references like `getDirtyInput`.
In
`@website/src/routes/`(docs)/react/guides/(advanced-guides)/dirty-fields/index.mdx:
- Line 112: Change the phrase "dirty state is bound to the input form" to "dirty
state is bound to the form input" in the sentence that references output.name,
output.age and <Link href="/methods/api/getDirtyInput/">getDirtyInput</Link> so
the text reads: "the dirty state is bound to the form input — not to the
validated output." This affects the sentence containing "After validation,
`output.name`... `getDirtyInput` would give you the raw strings..."—update that
text accordingly.
In
`@website/src/routes/`(docs)/solid/guides/(advanced-guides)/dirty-fields/index.mdx:
- Line 112: Replace the inconsistent phrase "input form" with "form input" in
the sentence starting "After validation, `output.name` has whitespace trimmed
and `output.age` is a number. `getDirtyInput` would give you the raw strings,
because the dirty state is bound to the input form — not to the validated
output." so it reads "...bound to the form input — not to the validated output."
This keeps terminology consistent with earlier usage like "form input" (see the
earlier line referencing "form input") and only requires editing that one
occurrence in the MDX content.
In
`@website/src/routes/`(docs)/svelte/guides/(advanced-guides)/dirty-fields/index.mdx:
- Line 105: Replace the phrase "input form" with "form input" in the sentence
that reads "the dirty state is bound to the input form — not to the validated
output" (the line referencing `getDirtyInput` and `output.name`/`output.age`) so
it reads "the dirty state is bound to the form input — not to the validated
output" for clarity and consistency.
In
`@website/src/routes/`(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdx:
- Line 101: Change the phrasing "dirty state is bound to the input form" to
"dirty state is bound to the form input" in the sentence that mentions
output.name, output.age and <Link
href="/methods/api/getDirtyInput/">`getDirtyInput`</Link>, so the line reads
that the dirty state is bound to the form input (keeping the same surrounding
context about trimmed whitespace and numeric conversion for output.name and
output.age and the reference to getDirtyInput).
---
Outside diff comments:
In `@website/src/routes/`(docs)/methods/api/(methods)/getDirtyInput/index.mdx:
- Around line 1-53: The MDX file for the getDirtyInput docs failed Prettier; run
a Prettier pass to fix formatting and commit the changes (e.g. run prettier
--write for the website package or target this MDX file), then push the
formatted file so CI `prettier --check` passes; locate the file by the document
title/header "getDirtyInput" or the import lines (import { ApiList, Property }
from '~/components'; and source:
/packages/methods/src/getDirtyInput/getDirtyInput.ts) and ensure only formatting
changes are included in the fix.
In `@website/src/routes/`(docs)/methods/api/(methods)/getDirtyPaths/index.mdx:
- Line 52: The MDX file for getDirtyPaths is missing a trailing newline which
breaks Prettier; open the getDirtyPaths index.mdx file and add a single newline
character at the end of the file (ensure the file ends with an empty line) so
the Prettier/CI check passes.
In `@website/src/routes/`(docs)/methods/api/(methods)/getDirtyPaths/properties.ts:
- Line 79: The file properties.ts for the getDirtyPaths API is missing a
trailing newline which breaks Prettier; open that file (module properties.ts /
the exported properties definitions at the end of the file) and add a single
newline character at the end of the file so the file ends with a blank line,
then save and re-run Prettier/CI.
In `@website/src/routes/`(docs)/methods/api/(methods)/pickDirty/index.mdx:
- Line 51: The file
website/src/routes/(docs)/methods/api/(methods)/pickDirty/index.mdx is missing a
trailing newline which breaks the Prettier check; fix it by editing index.mdx
and adding a single newline character at the end of the file (ensure the file
ends with a blank line), then save and re-run the formatter/CI to confirm
Prettier passes.
In `@website/src/routes/`(docs)/methods/api/(methods)/pickDirty/properties.ts:
- Line 64: The file
website/src/routes/(docs)/methods/api/(methods)/pickDirty/properties.ts is
missing a trailing newline which breaks Prettier/CI; open properties.ts and add
a single newline character at the end of the file (ensure the file ends with a
final blank line), then save and re-run the formatter/CI to confirm the Prettier
check passes.
In
`@website/src/routes/`(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/index.mdx:
- Line 31: Add a single trailing newline at the end of the MDX file for
GetFieldDirtyPathsConfig to satisfy Prettier: open
website/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/index.mdx,
move the cursor to the end of the file and insert one newline character so the
file ends with a newline.
In
`@website/src/routes/`(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/properties.ts:
- Line 45: Add a trailing newline at the end of
website/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/properties.ts
to satisfy Prettier; open the file (properties.ts) and ensure the final line
ends with a newline character (no other edits).
In `@website/src/routes/`(docs)/methods/api/(types)/PickDirtyConfig/index.mdx:
- Line 30: The MDX file for PickDirtyConfig is missing a trailing newline which
breaks Prettier; open the PickDirtyConfig index.mdx content and add a single
newline character at the end of the file (ensure the file ends with '\n') so the
Prettier check passes.
In `@website/src/routes/`(docs)/methods/api/(types)/PickDirtyConfig/properties.ts:
- Line 17: Add a single trailing newline at the end of the file
website/src/routes/(docs)/methods/api/(types)/PickDirtyConfig/properties.ts to
satisfy Prettier; simply open properties.ts and ensure there is a blank line
(newline character) after the last character so the file ends with a newline.
In
`@website/src/routes/`(docs)/preact/guides/(advanced-guides)/dirty-fields/index.mdx:
- Around line 1-197: The CI failed Prettier for the "Dirty fields" MDX guide
(the doc containing the getDirtyInput/getDirtyPaths/pickDirty examples and the
frontmatter title "Dirty fields"); fix it by running the project's formatter
(e.g., prettier --write) on that MDX file and any related docs that Prettier
flags, re-running the prettier/lint check locally to confirm, and committing the
formatted files so the pipeline passes.
In
`@website/src/routes/`(docs)/qwik/guides/(advanced-guides)/dirty-fields/index.mdx:
- Around line 1-197: The MDX doc titled "Dirty fields" (uses the Link import and
contains headings like "Dirty fields" and "The three methods") has Prettier
formatting violations; run the formatter (prettier --write .) to reformat the
file(s), review the changed MDX to ensure imports/JSX stayed valid, stage and
commit the reformatted files, and push the commit so CI picks up the fixed
formatting.
In `@website/src/routes/`(docs)/react/api/menu.md:
- Around line 1-78: The markdown under the "API reference" heading (sections
like "Hooks", "Components", "Methods", "Types" and entries such as "useForm",
"Form", "focus", "DeepPartial", etc.) has Prettier formatting violations; run
Prettier (e.g. from the website directory run prettier --write . or run Prettier
on this file) to reformat the file, verify the lists and headings remain intact,
then stage and commit the formatted file.
In
`@website/src/routes/`(docs)/react/guides/(advanced-guides)/dirty-fields/index.mdx:
- Around line 1-197: This MDX file ("Dirty fields" guide that imports Link and
documents getDirtyInput/getDirtyPaths/pickDirty) has Prettier formatting
violations; fix by running the formatter and committing the result: run prettier
--write . from the website directory, re-check CI, and commit the updated file
so the frontmatter, import line (import { Link } from '~/components';) and the
code blocks for getDirtyInput/getDirtyPaths/pickDirty are consistently
formatted.
In `@website/src/routes/`(docs)/react/guides/menu.md:
- Around line 1-26: This file has Prettier formatting violations; run the
formatter and commit the fixed file: run prettier --write targeting the affected
markdown (menu.md) from the website project, save the updated file, verify the
headings/links under "Guides" / "Get started" / "Main concepts" remain
unchanged, and re-run CI to ensure the formatting issues are resolved before
merging.
In `@website/src/routes/`(docs)/svelte/api/menu.md:
- Around line 1-79: The file menu.md has Prettier formatting violations; run
Prettier to reformat it (e.g., from the website directory run `prettier --write
.`) which will normalize headings and list spacing (see "API reference",
"Runes", "Components", and the Methods/Types lists), then stage and commit the
updated menu.md so CI passes; if your repo uses a package script (e.g., npm/yarn
format), run that instead and ensure the commit contains only the formatting
changes.
In
`@website/src/routes/`(docs)/svelte/guides/(advanced-guides)/dirty-fields/index.mdx:
- Around line 1-190: This MDX file ("Dirty fields", starting with "import { Link
}") fails Prettier formatting; fix by running Prettier over the website content
(from the website directory run: prettier --write .), then stage/commit the
updated file so CI passes; ensure code fences and inline imports like "import {
Link }", and examples referencing getDirtyInput/getDirtyPaths/pickDirty remain
syntactically unchanged except for formatting.
In `@website/src/routes/`(docs)/vue/api/menu.md:
- Around line 1-78: The file menu.md has Prettier formatting violations—run
Prettier to reformat this file (e.g., run prettier --write on menu.md or the
documentation sources), stage and commit the updated menu.md, and push the
changes so CI can re-run; confirm that headings like "API reference" and the
lists of Composables/Components/Methods/Types in menu.md are preserved after
formatting.
In
`@website/src/routes/`(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdx:
- Around line 1-186: CI reports Prettier formatting violations in the "Dirty
fields" MDX (frontmatter title: "Dirty fields") — run the formatter (e.g.
execute prettier --write . from the website directory), review and stage the
resulting changes for this file (index.mdx under the dirty-fields guide), then
amend your PR with the formatted file so the CI formatting check passes.
In `@website/src/routes/`(docs)/vue/guides/menu.md:
- Around line 1-26: CI flagged Prettier formatting issues in the menu markdown
(headings like "Guides", "## Get started" and the list items such as
"[Introduction](/vue/guides/introduction/)"); fix by running the formatter
(prettier --write . from the website directory), verify the markdown
list/heading spacing is normalized, re-stage the updated menu.md and commit the
formatted file so CI passes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 01de81e2-b58f-4000-a281-4dc9a8a9095b
📒 Files selected for processing (50)
packages/core/CHANGELOG.mdpackages/core/src/field/getDirtyFieldInput/getDirtyFieldInput.test.tspackages/core/src/field/getDirtyFieldInput/getDirtyFieldInput.tspackages/core/src/field/getDirtyFieldInput/index.tspackages/core/src/field/index.tspackages/methods/CHANGELOG.mdpackages/methods/src/getDirtyInput/getDirtyInput.test.tspackages/methods/src/getDirtyInput/getDirtyInput.tspackages/methods/src/getDirtyInput/index.tspackages/methods/src/getDirtyPaths/getDirtyPaths.test.tspackages/methods/src/getDirtyPaths/getDirtyPaths.tspackages/methods/src/getDirtyPaths/index.tspackages/methods/src/index.tspackages/methods/src/pickDirty/index.tspackages/methods/src/pickDirty/pickDirty.test.tspackages/methods/src/pickDirty/pickDirty.tswebsite/src/routes/(docs)/methods/api/(methods)/getDirtyInput/index.mdxwebsite/src/routes/(docs)/methods/api/(methods)/getDirtyInput/properties.tswebsite/src/routes/(docs)/methods/api/(methods)/getDirtyPaths/index.mdxwebsite/src/routes/(docs)/methods/api/(methods)/getDirtyPaths/properties.tswebsite/src/routes/(docs)/methods/api/(methods)/pickDirty/index.mdxwebsite/src/routes/(docs)/methods/api/(methods)/pickDirty/properties.tswebsite/src/routes/(docs)/methods/api/(types)/GetFieldDirtyInputConfig/index.mdxwebsite/src/routes/(docs)/methods/api/(types)/GetFieldDirtyInputConfig/properties.tswebsite/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/index.mdxwebsite/src/routes/(docs)/methods/api/(types)/GetFieldDirtyPathsConfig/properties.tswebsite/src/routes/(docs)/methods/api/(types)/GetFormDirtyInputConfig/index.mdxwebsite/src/routes/(docs)/methods/api/(types)/GetFormDirtyInputConfig/properties.tswebsite/src/routes/(docs)/methods/api/(types)/GetFormDirtyPathsConfig/index.mdxwebsite/src/routes/(docs)/methods/api/(types)/GetFormDirtyPathsConfig/properties.tswebsite/src/routes/(docs)/methods/api/(types)/PickDirtyConfig/index.mdxwebsite/src/routes/(docs)/methods/api/(types)/PickDirtyConfig/properties.tswebsite/src/routes/(docs)/preact/api/menu.mdwebsite/src/routes/(docs)/preact/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/preact/guides/menu.mdwebsite/src/routes/(docs)/qwik/api/menu.mdwebsite/src/routes/(docs)/qwik/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/qwik/guides/menu.mdwebsite/src/routes/(docs)/react/api/menu.mdwebsite/src/routes/(docs)/react/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/react/guides/menu.mdwebsite/src/routes/(docs)/solid/api/menu.mdwebsite/src/routes/(docs)/solid/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/solid/guides/menu.mdwebsite/src/routes/(docs)/svelte/api/menu.mdwebsite/src/routes/(docs)/svelte/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/svelte/guides/menu.mdwebsite/src/routes/(docs)/vue/api/menu.mdwebsite/src/routes/(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/vue/guides/menu.md
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@website/src/routes/`(docs)/preact/guides/(advanced-guides)/dirty-fields/index.mdx:
- Line 112: The sentence uses inconsistent phrasing "input form" — change it to
"form input" for consistency; update the line that currently reads "the dirty
state is bound to the input form — not to the validated output" to "the dirty
state is bound to the form input — not to the validated output", leaving
surrounding references to output.name, output.age, and the getDirtyInput link
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4ec22a62-b9f0-4074-8d97-7b53bf73a1e5
📒 Files selected for processing (6)
packages/methods/src/pickDirty/pickDirty.test.tspackages/methods/src/pickDirty/pickDirty.tswebsite/src/routes/(docs)/preact/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/qwik/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/react/guides/(advanced-guides)/dirty-fields/index.mdxwebsite/src/routes/(docs)/vue/guides/(advanced-guides)/dirty-fields/index.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/methods/src/pickDirty/pickDirty.test.ts
- packages/methods/src/pickDirty/pickDirty.ts
Fix #21
Summary by cubic
Adds dirty-state utilities to help submit or inspect only changed form data:
getDirtyInput,getDirtyPaths, andpickDirtyin@formisch/methods, plusgetDirtyFieldInputin@formisch/core. This enables partial updates, smaller payloads, and simpler change detection.New Features
@formisch/methodsgetDirtyInput: returns only dirty input for the whole form or a scopedpath; omits clean branches; arrays are atomic; returnsundefinedif nothing is dirty.getDirtyPaths: lists paths to dirty fields; arrays are atomic; supports scoping viapath.pickDirty: filters an external value down to the form’s dirty parts using the dirty mask; returnsDeepPartialorundefined.@formisch/coregetDirtyFieldInput: extracts a field store’s dirty input (used by methods and available for advanced use).Bug Fixes
pickDirtyAPI page.Written for commit 03677bc. Summary will update on new commits. Review in cubic