form icon indicating copy to clipboard operation
form copied to clipboard

fix(form-core): Fix memory leaks from EventClient

Open LeCarbonator opened this issue 3 months ago • 6 comments

🎯 Changes

The PR addresses two memory leaks related to the EventClient:

  • [x] Unsubscribe from event listeners on cleanup
  • [ ] Fix queuedEvents from piling up FormApi references

🚀 Release Impact

  • [x] This change affects published code, and I have generated a changeset.
  • [ ] This change is docs/CI/dev-only (no release).

LeCarbonator avatar Nov 20 '25 08:11 LeCarbonator

⚠️ No Changeset found

Latest commit: e7f81f1cd0ba3693de187cc8a57df9bd9fab3815

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

changeset-bot[bot] avatar Nov 20 '25 08:11 changeset-bot[bot]

View your CI Pipeline Execution ↗ for commit e7f81f1cd0ba3693de187cc8a57df9bd9fab3815

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

☁️ Nx Cloud last updated this comment at 2025-12-11 10:16:50 UTC

nx-cloud[bot] avatar Nov 20 '25 08:11 nx-cloud[bot]

More templates

@tanstack/angular-form

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

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

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

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

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

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

npm i https://pkg.pr.new/@tanstack/react-form-nextjs@1866
@tanstack/react-form-remix

npm i https://pkg.pr.new/@tanstack/react-form-remix@1866
@tanstack/react-form-start

npm i https://pkg.pr.new/@tanstack/react-form-start@1866
@tanstack/solid-form

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

npm i https://pkg.pr.new/@tanstack/solid-form-devtools@1866
@tanstack/svelte-form

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

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

commit: e7f81f1

pkg-pr-new[bot] avatar Nov 20 '25 08:11 pkg-pr-new[bot]

Codecov Report

:x: Patch coverage is 25.00000% with 15 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 89.40%. Comparing base (6892ed0) to head (e7f81f1). :warning: Report is 94 commits behind head on main.

Files with missing lines Patch % Lines
packages/form-core/src/FormApi.ts 25.00% 12 Missing and 3 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1866      +/-   ##
==========================================
- Coverage   90.35%   89.40%   -0.96%     
==========================================
  Files          38       48      +10     
  Lines        1752     1934     +182     
  Branches      444      479      +35     
==========================================
+ Hits         1583     1729     +146     
- Misses        149      184      +35     
- Partials       20       21       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Nov 20 '25 08:11 codecov[bot]

Related PR: https://github.com/TanStack/devtools/pull/272

LeCarbonator avatar Nov 26 '25 15:11 LeCarbonator

Also experiencing this, I made the forms client only to temporarily mitigate the issue.

martinliptak avatar Dec 04 '25 16:12 martinliptak