feat(form-generic)!: rewrite builder and renderer on SdFormGenericSchema v1 (phase 1) - #70
Merged
Merged
Conversation
…ema v1 (phase 1)
Phase 1 of form-generic-schema-v1: SdFormGenericSchema (pages -> group ->
element, no schemaVersion) replaces SdFormGeneric, and sd-form-render and
sd-form-builder move to it.
- Pure core: schema model with normalize/validate, a 3-tier layout picked
from the form width (SD_FORM_GENERIC_BREAKPOINTS), one Filter evaluator
for rules and form validations, structured value refs for catalog params
and fill, key rename that updates every structured reference, and one
source for presets, field defaults and display formats.
- sd-form-render: [schema], [(value)] model that never mutates its inputs,
[form], [variables], [viewed], [breakpoint], [labelPlacement], [keys];
validate() returns { valid, messages } and upload() resolves params;
catalog results are cached per renderer instance.
- sd-form-builder: [(schema)], Desktop | Tablet | Mobile span editing with
inherited labels, newRow, Filter rules edited with sd-query-builder, and
a preview through the real renderer.
- provideSdFormGeneric({ catalogs, templates, htmlDefinitions, validators,
breakpoints }) replaces SD_FORM_GENERIC_CONFIGURATION.
- Core form controls: labelPlacement ('float' | 'top'), sd-input type
tel/url, inputmode and autocomplete, sd-label for/labelId, textarea
minlength.
- i18n for vi/en/ko/ja/zh, sd-form-generic.md, CHANGELOG [Unreleased] and
the showcase demo.
- .sdcorejs: approved spec r2, architecture r2 and plan r3, with the
superseded revisions and drafts.
The v20, v21 and v22 mirrors follow in the next three commits.
BREAKING CHANGE: the SdFormGeneric schema, SdFeelExpression and the legacy
expression and configuration exports are removed. CHANGELOG [Unreleased]
has the before/after mapping and the full list of removed exports.
Verification (worktree tree 6f3965c, the same content as this commit
series): Karma form-generic 285/285; full v19 suite with coverage
6168/6168 (the first run had 2 SdImageEditor export timeouts under load;
that spec alone passes 114/114); lint; check:i18n; check:i18n-parity;
check:scss-hex; showcase 209/209; test:scripts; check:sync; v22 LF check;
docs and structure checks; build v19, v20, v21 and v22.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run sync from versions/v19 (cea6349): form-generic, Core form controls, i18n and SYNC-STATUS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run sync from versions/v19 (cea6349): form-generic, Core form controls, i18n and SYNC-STATUS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run sync from versions/v19 (cea6349): form-generic, Core form controls, i18n and SYNC-STATUS. Files stay LF (eol=lf): the CRLF that sync writes on this checkout was normalized before verification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Phase 1 of the
form-generic-schema-v1contract.SdFormGenericSchema(pages → group → element) replacesSdFormGeneric, andsd-form-renderandsd-form-builderare rebuilt on it.Breaking for consumers. The
SdFormGenericschema,SdFeelExpressionand the legacy expression and configuration exports are removed.CHANGELOG.md→[Unreleased]→### Changed (BREAKING for consumers)has the before/after mapping and the full list of 20 removed runtime exports.Changes
cea63493a: v19, showcase, docs and approved artifacts (336 files).SD_FORM_GENERIC_BREAKPOINTS); one Filter evaluator for rules and form validations; structured value refs for catalog params and fill; a key rename that updates every structured reference; one source for presets, field defaults and display formats.sd-form-render:[schema], a[(value)]model that never mutates its inputs,[form],[variables],[viewed],[breakpoint],[labelPlacement]and[keys].validate()returns{ valid, messages }, andupload()resolves params. Catalog results are cached per renderer instance.sd-form-builder:[(schema)], Desktop / Tablet / Mobile span editing with inherited labels,newRow, Filter rules edited withsd-query-builder, and a preview through the real renderer.provideSdFormGeneric({ catalogs, templates, htmlDefinitions, validators, breakpoints })replacesSD_FORM_GENERIC_CONFIGURATION.forms/**,assets/scss/core/form.scss), which form-generic needs:labelPlacement: 'float' | 'top', default'float';sd-inputtypetel/url, withinputmodeandautocomplete;sd-labelfor/labelId;sd-textareaminlength.sd-form-generic.md, theCHANGELOG.md[Unreleased]entry and the showcase demo..sdcorejs/: the approved spec r2, architecture r2 and plan r3, with the superseded revisions and drafts (14 files).11202efe2,29e0e2a86anda3e6d90e3:npm run syncoutput for v20, v21 and v22, 317 files each. The v22 files are normalized to LF.Against
main, the PR changes 1287 files: 306 added, 556 deleted and 425 modified (+128,368 / −66,685). About three quarters of the paths are generated mirrors.Verification
All checks below ran on the clean head
a3e6d90e, after the commits, with Node 22.22.3:ng test sdcorejs-angular --watch=false --browsers=ChromeHeadlessCI --code-coverage: 6168/6168, exit 0 (Jasmine seed 775614).npm test: 209/209.npm run test:scriptsnpm run check:synccheck:i18n,check:i18n-parityandcheck:scss-hexng build sdcorejs-angularpasses on v19, v20, v21 and v22. The v20, v21 and v22 test suites did not run locally; the CIcompatibilityjob runs them.CONVERGED, with receiptconvergence-form-generic-schema-v1(sha256:v1:14fe5e05…6f0c).READY WITH WARNINGS. The warnings are covered in the reviewer notes.An earlier full run on the same content, before the commits, had 2
SdImageEditorexport tests time out under load. That spec passes 114/114 alone, and both later full runs passed. This is the load-sensitive flake also seen in #65, and this PR does not touch the image editor.Risks and rollback
SdFormGeneric,SdFeelExpressionor the removed helpers and constants must migrate with the before/after mapping in the CHANGELOG.form.scssonly adds.sd-label-toprules. Existing forms keep their layout unless they opt in.main.Notes for reviewer
Review
cea63493a. The threechore(sync)commits are generated, andnpm run check:syncguards them.maingained docs: fix module "Related" links and the showcase library note #69 (docs only) after this branch was cut. The branch still merges cleanly.CHANGELOG.mdis the only file both sides changed, and the edits are in separate hunks.The
console.warn/console.errorcalls in the renderer are intentional. They report invalid schema input (an unsupported element type, a reserved key, an unregistered catalog or an invalidvalidation.pattern), and they log errors in error handlers.The secret scan flags two things. Both are false positives:
core.component.form-builder.preset.password;form-render.service.spec.ts.The git-secrets hooks passed on every commit and on the push.
Follow-up, not in this PR: the builder palette and the inspector still set
currency: 'VND'and the default precisions as literals. They should read the shared display defaults.🤖 Generated with Claude Code