fix(react-form): support defaulted fields and declaration-safe exports - #224
Open
andrewzolotukhin wants to merge 1 commit into
Open
fix(react-form): support defaulted fields and declaration-safe exports#224andrewzolotukhin wants to merge 1 commit into
andrewzolotukhin wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original request
Unblock the Framework beta adoption in Xpenser PR #94, and publish the changes through PRs so they can be reviewed before the next beta is released.
What changed
THasDefaultflag. Defaulted strings, enums, booleans, numbers, dates, arrays, and nullable properties remain correctly typed throughform.useField()and typedField.TypedFormSystem<R>andTypedFieldComponent<R>exports so shared UI libraries can emit declarations for both an inferred registry and an exportedsystem.Field.@cleverbrush/react-form.Reasoning
The beta used
SchemaBuilder<any, any, any>, which implicitly fixes its fourthTHasDefaultgeneric tofalse. Real consumer schemas with defaults therefore failed even though runtime behavior was valid. Widening the bound preserves the actual property's type instead of removing defaults or requiring consumer assertions.The generic factory's anonymous return type also exposed an internal schema symbol during consumer declaration emission. Named public return/callable types retain the registry contract across package boundaries. Runtime validation, default application, and submission behavior are unchanged; the fix stays application-agnostic.
Blog post
Skipped: internal published-library type compatibility fix, not a new public product feature.
Screenshots / preview evidence
Not applicable: this PR changes TypeScript contracts and documentation, not UI rendering. The declaration-emission consumer fixture and runtime tests provide reproducible evidence. Framework has no per-PR deployment job in its CI configuration.
Xpenser preview testing will follow after this PR is merged, the corrected beta is published, and Xpenser #94 consumes that version. Neither PR is merged or released by this work.
Validation
npm run lint: passed.npm run build: passed.npm test: passed — 4,267 tests across 178 files; no type errors.npm run typecheck:schema-site: passed.npm run typecheck:docs-site: passed.git diff --check: passed..d.tsfiles. The published beta files were restored byte-for-byte afterward; no local library patch is shipped.