Skip to content

Conversation

LeCarbonator
Copy link
Contributor

@LeCarbonator LeCarbonator commented Sep 13, 2025

Closes #1614
Closes #1561
Closes #1577 , though it's not clear if it unintentionally broke something else solid-form-related.
Affects #1289 , though I have not confirmed that it fixes deleteField yet. Feedback from author is appreciated
Might close #1638 , feedback from author is needed

Fixes:

  • field.handleChange(undefined) no longer sets the value to the default value
  • form.reset() and array methods no longer break controlled input when non-index keys are used
  • field values in arrays no longer temporarily become undefined (breaking controlled -> uncontrolled -> controlled)

Todos:

  • Test at workplace (known location where previous implementation crashed due to dnd)
  • Test performance (what does the rerendering look like now?)
    • children callback
    • Form Composition
  • Check other frameworks
    • Solid
    • Angular
    • Vue
    • Svelte
    • Lit

Copy link

nx-cloud bot commented Sep 13, 2025

View your CI Pipeline Execution ↗ for commit 97a9877

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 35s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-02 19:37:39 UTC

Copy link

pkg-pr-new bot commented Sep 13, 2025

More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@1729

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@1729

@tanstack/form-devtools

npm i https://pkg.pr.new/@tanstack/form-devtools@1729

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@1729

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@1729

@tanstack/react-form-devtools

npm i https://pkg.pr.new/@tanstack/react-form-devtools@1729

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@1729

@tanstack/svelte-form

npm i https://pkg.pr.new/@tanstack/svelte-form@1729

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@1729

commit: 97a9877

Copy link

codecov bot commented Sep 13, 2025

Codecov Report

❌ Patch coverage is 98.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.59%. Comparing base (6892ed0) to head (97a9877).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
packages/form-core/src/metaHelper.ts 98.21% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1729      +/-   ##
==========================================
+ Coverage   90.35%   90.59%   +0.24%     
==========================================
  Files          38       38              
  Lines        1752     1787      +35     
  Branches      444      446       +2     
==========================================
+ Hits         1583     1619      +36     
  Misses        149      149              
+ Partials       20       19       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeCarbonator
Copy link
Contributor Author

Notes to self:

Swapping, deletion and basic reset seems to work. However, there's conflicts with the reset that need further investigating.

Copy link

changeset-bot bot commented Sep 24, 2025

⚠️ No Changeset found

Latest commit: 97a9877

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@LeCarbonator
Copy link
Contributor Author

form.reset() still has the issue if the array field's size changes.

swapValues, moveValues and removeValue seem to be fixed.

@LeCarbonator LeCarbonator force-pushed the undefined-default-value branch from 93e3caa to 60e4c68 Compare September 26, 2025 07:09
@LeCarbonator
Copy link
Contributor Author

LeCarbonator commented Sep 29, 2025

form.reset() and array methods are all fixed.

Todos:

  • Test at workplace (known location where previous implementation crashed due to dnd)
  • Test performance (what does the rerendering look like now?)
    • children callback
    • Form Composition
  • Check other frameworks
    • Solid
    • Angular
    • Vue
    • Svelte
    • Lit

@LeCarbonator LeCarbonator changed the title Draft: Investigate FieldApi.update Draft: Fix array fields being stale on array change Sep 29, 2025
@LeCarbonator
Copy link
Contributor Author

Solid appears to be struggling with this implementation still. I'll look into what can be done to fix it.

@LeCarbonator LeCarbonator changed the title Draft: Fix array fields being stale on array change fix(form-core): Fix array fields being stale on array change Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment