Skip to content

Fixed isEqual register initalization#480

Merged
erikras merged 1 commit into
final-form:mainfrom
mjchang:bug/is-equal-initialization
Feb 10, 2026
Merged

Fixed isEqual register initalization#480
erikras merged 1 commit into
final-form:mainfrom
mjchang:bug/is-equal-initialization

Conversation

@mjchang

@mjchang mjchang commented May 20, 2023

Copy link
Copy Markdown
Contributor

Fix final-form/react-final-form#1032 by updating the field isEqual every time registerField is called. This is in conjunction with final-form/react-final-form#1033 that so that isEqual is passed only when defined.

@erikras
erikras merged commit 6075ec3 into final-form:main Feb 10, 2026
erikras-dinesh-agent pushed a commit that referenced this pull request Feb 10, 2026
The field object literal was missing the isEqual property in its
initial definition, causing TypeScript to fail when it was assigned later.

Add isEqual: tripleEquals to the initial field object to match the
InternalFieldState type.

Fixes TypeScript compilation broken by #480.
erikras-richard-agent pushed a commit that referenced this pull request Feb 10, 2026
The field object literal was missing the isEqual property in its
initial definition, causing TypeScript to fail when it was assigned later.

Add isEqual: tripleEquals to the initial field object to match the
InternalFieldState type.

Fixes TypeScript compilation broken by #480.
@mjchang
mjchang deleted the bug/is-equal-initialization branch February 10, 2026 17:27
erikras pushed a commit that referenced this pull request Feb 11, 2026
The field object literal was missing the isEqual property in its
initial definition, causing TypeScript to fail when it was assigned later.

Add isEqual: tripleEquals to the initial field object to match the
InternalFieldState type.

Fixes TypeScript compilation broken by #480.

Co-authored-by: Erik Rasmussen <[email protected]>
erikras-dinesh-agent pushed a commit to erikras-gilfoyle-agent/final-form that referenced this pull request Feb 11, 2026
Integrated upstream changes:
- PR final-form#480: Improved isEqual register initialization
- PR final-form#517: Fixed TypeScript isEqual errors

Preserved async validation tracking:
- instanceId for stable field instance tracking
- asyncValidationCount and asyncValidationKey

The merge keeps the upstream's robust isEqual initialization logic
while maintaining the per-field async validation tracking needed
to prevent race conditions.
erikras pushed a commit that referenced this pull request Feb 11, 2026
* Migrate from bundlesize to size-limit

Replace bundlesize with size-limit to resolve iltorb compilation issues.

- Remove: bundlesize (depends on unmaintained iltorb)
- Add: @size-limit/preset-small-lib and size-limit
- Configure: Track 4 build outputs (umd.min, umd, es, cjs) with 3kB limits

This follows the same pattern as react-final-form #1056.

Part of OSS-28: Migrate all libraries from bundlesize to size-limit

* Address CodeRabbit feedback

1. Update Node version requirement to >=18 (size-limit requires ^18.0.0 || >=20.0.0)
2. Add size-limit check to CI workflow
   - New 'size' job that builds and runs size-limit
   - Ensures bundle size limits are enforced in CI

* Update yarn.lock for size-limit dependencies

* Fix TypeScript error in isEqual initialization

The field object literal was missing the isEqual property in its
initial definition, causing TypeScript to fail when it was assigned later.

Add isEqual: tripleEquals to the initial field object to match the
InternalFieldState type.

Fixes TypeScript compilation broken by #480.

* Adjust size-limit thresholds to match actual bundle sizes

Current bundle sizes (brotli compressed):
- umd.min: ~6 kB (limit: 7kB with headroom)
- umd: ~6 kB (limit: 7kB with headroom)
- es: ~5.5 kB (limit: 6kB with headroom)
- cjs: ~5.75 kB (limit: 6kB with headroom)

Limits set with ~1kB headroom to catch regressions.

---------

Co-authored-by: Erik Rasmussen <[email protected]>
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.

isEqual is initialized by the first field registered instance

2 participants