Skip to content

Chore/jsf kit v1 - #1270

Open
jordividaller wants to merge 2 commits into
mainfrom
chore/jsf-kit-v1
Open

Chore/jsf kit v1#1270
jordividaller wants to merge 2 commits into
mainfrom
chore/jsf-kit-v1

Conversation

@jordividaller

Copy link
Copy Markdown
Collaborator

What

Upgrades @remoteoss/remote-json-schema-form-kit from 0.0.23 to 1.0.0 and prepares the SDK for the v1 engine rollout.

Why

Kit 1.0.0 ships one breaking change: the nextVersion flag is removed, and a schema that doesn't declare a version in x-rmt-meta now runs on the v1 engine (the pre-1.0 default was v0). Schemas that declare their version ({ jsfOldVersion: true } → v0, { jsfVersion: '1' } → v1) behave exactly as before.

The gateway stamps x-rmt-meta on its schema responses (verified on partners sandbox: cost-calculator region fields and contract_details both return { jsfOldVersion: true }), so API-served schemas are unaffected. The risk was everything that silently relied on the old default: our local static schemas and any consumer-provided schema.

How

Behavior-preserving upgrade:

All local static schemas (the json-schemas/ dirs of 5 flows + the Cost Calculator's static schema) now declare x-rmt-meta: { jsfOldVersion: true } at the source — they were authored against the v0 engine.
createHeadlessForm stamps undeclared schemas with a configurable engine fallback, defaulting to 'v0' (the historical behavior).
New public prop jsfEngineFallback: 'v0' | 'v1' on (documented in the README) lets consumers flip the fallback once the gateway starts serving undeclared v1 schemas; we'll flip the default in a future release.
Cost Calculator v1 readiness:
The region fields schema comes from the API and will eventually be served as v1. The region validation path now works on both engines, selected automatically by the schema's own x-rmt-meta — no code change needed on our side when the API switches:

The region handleValidation only receives the region schema's own values: the v1 engine enforces additionalProperties, so static-field values would be rejected as forbidden properties (v0 silently ignored them).
When the v1 engine validated the schema (it returns no yupError), the yup entries are synthesized from formErrors, keeping handleValidation's public return shape identical on both engines.
The static schema (and its public yup validationSchema) deliberately stays on v0; migrating it is a separate effort gated on an API deprecation decision.
Known behavioral difference, covered by a test: the v1 engine doesn't require nested fieldset fields when the parent object is absent from the root required (v0's yup casted absent objects to {} and fired the inner requireds). This follows strict JSON Schema semantics; if those errors are wanted, the schema should list the fieldset in its root required.

Testing

876/876 unit tests green (10 new: engine-fallback behavior, v1 region fields fill/submit/validation, formErrorsToValidationErrors helper)
Full local CI green (build, format, exports, lint, type-check, tests, bundle size within limits)
E2E: 4/5 specs pass — identical to main. onboard-basic-employee.spec.ts fails the same way on main with kit 0.0.23 (pre-existing sandbox/spec issue, not a regression)

Jordi Vidaller and others added 2 commits August 31, 2026 11:27
Kit v1.0.0 removes the `nextVersion` flag and runs schemas that don't
declare a version in `x-rmt-meta` on the v1 engine (the pre-1.0 default
was v0). To keep behaviour stable while staying ready for the switch:

- local static schemas (json-schemas/) now declare
  `x-rmt-meta: { jsfOldVersion: true }` at the source, since they were
  authored against the v0 engine
- `createHeadlessForm` stamps undeclared schemas with a configurable
  engine fallback, defaulting to v0 (the historical behaviour)
- new `jsfEngineFallback` prop on `<RemoteFlows>` lets consumers flip
  the fallback to v1 once the gateway starts serving undeclared v1
  schemas

Schemas that declare their version in `x-rmt-meta` (all gateway
responses today) are unaffected by the fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The region fields schema comes from the API, which will eventually serve
it as jsf v1. Both engines now work, selected by the schema's own
x-rmt-meta declaration:

- only pass the region schema's own values to its handleValidation: the
  v1 engine enforces additionalProperties, so the static fields' values
  would be rejected as forbidden properties (v0 silently ignored them)
- synthesize the yupError entries from formErrors when the v1 engine
  validated the schema (it returns no yupError), keeping handleValidation's
  public return shape identical on both engines
- declare the static cost calculator schema as v0 in x-rmt-meta (it was
  authored against the v0 engine and its yup validationSchema is public
  API); it no longer depends on any engine default

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 259.78 kB 259.18 kB +601 B (+0.2%) 🔴
Total (raw) 694.74 kB 693.63 kB +1.11 kB (+0.2%) 🔴
CSS (gzip) 21.69 kB 21.69 kB 0 B (0%) 🟢
CSS (raw) 112.77 kB 112.77 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 259.78 kB / 350 kB (74.2%)
  • ✅ Total raw: 694.74 kB / 850 kB (81.7%)
  • ✅ CSS gzipped: 21.69 kB / 25 kB (86.8%)

Largest Files (Top 5)

  1. chunk-AUPAAQUT.js - 14 kB (0 B (0%))
  2. styles.css - 10.85 kB (0 B (0%))
  3. index.css - 10.85 kB (0 B (0%))
  4. index.js - 6.82 kB (+25 B (+0.4%))
  5. chunk-KDHFTLCW.js - 6.58 kB (0 B (0%))
View All Files (421 total)
File Size (gzip) Change
chunk-AUPAAQUT.js 14 kB 0 B (0%)
styles.css 10.85 kB 0 B (0%)
index.css 10.85 kB 0 B (0%)
index.js 6.82 kB +25 B (+0.4%)
chunk-KDHFTLCW.js 6.58 kB 0 B (0%)
chunk-7WDXUW25.js 6.43 kB new
chunk-HQGQSXW5.js 5.82 kB new
chunk-C4HFMTSB.js 5.33 kB 0 B (0%)
chunk-P2YLLK6M.js 4.65 kB 0 B (0%)
chunk-GCTPC4JC.js 4.22 kB new

✅ Bundle size check passed

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 85.50% 85.48% +0.03% 🟢
Statements 85.07% 85.04% +0.03% 🟢
Functions 83.75% 83.70% +0.06% 🟢
Branches 76.99% 76.89% +0.10% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 4370 / 5111
  • Coverage: 85.50%
  • Change: +0.03% (15 lines)
Statements Coverage
  • Covered: 4443 / 5223
  • Coverage: 85.07%
  • Change: +0.03% (15 statements)
Functions Coverage
  • Covered: 1160 / 1385
  • Coverage: 83.75%
  • Change: +0.06% (5 functions)
Branches Coverage
  • Covered: 2721 / 3534
  • Coverage: 76.99%
  • Change: +0.10% (22 branches)

✅ Coverage check passed

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-ld297067i-remotecom.vercel.app
Latest Commit:315fc60

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-ngyjl6xrv-remotecom.vercel.app
Latest Commit:315fc60

Deployed with vercel-action

@jordividaller jordividaller self-assigned this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant