feat: correct cache identity and schema-form lifecycle - #223
Open
andrewzolotukhin wants to merge 1 commit into
Open
feat: correct cache identity and schema-form lifecycle#223andrewzolotukhin 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.
Description
Implement the Framework phase of the approved cache-correctness and schema-form improvements. This PR targets development. It does not change Xpenser, publish packages, or deploy anything.
Original request
Address items #1 and #2 from the consumer-experience review in Framework, keeping the APIs application-agnostic. Include a changeset, tests, and documentation. After this PR is merged and a beta version is provided, update Xpenser in a separate PR.
The approved plan explicitly selects a new cache-key format everywhere rather than a legacy-compatible mode.
What changed
ct2:key encoder shared by the server/client public helpers, response caches, and external invalidation. It sorts properties, tags value types, preserves date milliseconds, and rejects unsupported/cyclic values.handleSubmit, reactive read-onlysubmitting/error, duplicate-submit protection, explicit results, inferred success data, and opt-in exception translation. Reset/unmount suppress old callbacks without pretending to cancel network work. Existingsubmit()/validate()remain.defineFieldRenderer<Value, Props>andcreateFormSystem({ renderers })for checked variants/custom props and composable registries, retaining legacy exports/providers.Reasoning and migration
Cache identity must distinguish types and date instants consistently without parsing delimiter-joined strings. Generation guards cover the empty-cache/in-flight race and alias invalidation while preserving existing invalidation scope.
Breaking cache migration: upgrade all external writers and invalidators together and flush/expire old keys. Even property-free computed keys change; literal base invalidation names do not. There is no legacy fallback. Endpoint response identity and auth/tenant scope remain consumer-owned, and external writers need their own concurrency controls.
Forms centralize reusable mechanics only; UI kits, notifications, navigation, persistence, and expected-error classification remain application-owned. The typed factory's closed registry prevents an untyped parent provider from changing its renderer contract.
The changeset requests major server/client and minor react-form changes. Framework's existing fixed release group consequently advances its published libraries together at major level. No versions have been changed here.
See the migration guide.
Type of Change
Blog post
Skipped: internal library/API work, with package docs and a migration guide instead of an Xpenser product announcement.
Screenshots / preview evidence
Actual Chromium verification of the local docs preview at
http://127.0.0.1:3217/react-form: empty validation, mounted text/select/checkbox reset, failure with preserved inputs, disabled pending button, and successful retry with cleared controls and confirmation. No browser errors. The demo sends no data to a server.A low-contrast inherited demo background was found during browser QA and corrected with theme-aware, demo-scoped styles. Local browser/server processes were stopped afterward.
Validation
npm run lintnpm run build— 21 tasks succeedednpm run test— 4,233 tests, 173 files; no type errorsnpm run typecheck:schema-sitenpm run typecheck:docs-sitenpm run docs— generated successfully, 0 errors / 238 TypeDoc warnings about documentation links/internal typesnpx changeset status --since origin/development— valid release plan; existing websitefile:dependency warningsLint, Build & Test (Node 24)— passed on commitf7c65aeChecklist
npm run lintand fixed any issuesnpm run testand all tests pass