Repository navigation
Conversation
BREAKING CHANGE: useOcForm returns { form, resourceSchema, parseValues }
instead of React Hook Form methods. Validation is Zod. The
react-hook-form and @hookform/resolvers peers are removed.
@tanstack/react-form ^1.33.5 is required.
Save parseValues(), not the raw form state. Empty numbers and null
booleans are omitted. An entered integer must be a whole number and
still has to meet the spec minimum.
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.
Breaks
useOcFormfor #13. It returns{ form, resourceSchema, parseValues }from@tanstack/react-formv1, validated with Zod. SaveparseValues(), not raw form state. React stays^18.3.1.ordercloud-javascript-sdkstays^11.1.0.react-hook-form,@hookform/resolvers, andyupare gone.Empty numbers and null booleans are omitted. OrderCloud rejects
Active: nullandQuantityMultiplier: 0(minimum is 1). A number the user entered still has to meetminimum, and an integer rejects a decimal before the request is sent. A PUT of only{ ID, Name }clears omitted scalars such as Description and leaves an omittedInventoryobject in place, so callers must submit the full parsed form.useApiSpecnow shares one OpenAPI document per base URL.getRoutingUrlno longer throws when a create screen has no route params.npm run buildandnpm test(10 schema cases) pass. Live checks against Cloud Commerce sandboxQ4aM3ak2zkC7vB_NaHYV9Q(https://sandboxapi.ordercloud.io), then deleted:poc/validate-marketplace.mjs: name-only create, edit after GET, nested inventory, provider and inferred xp, assignment through an active catalog, one price break.poc/validate-edge-cases.mjs: 15/15 on two runs. Sparse product save, xp types, integer rejection, price-break add/remove/empty, category create, spec options (read-only on the spec body; created viaPOST /specs/{id}/options), variant generate with{ Active: true }, promotionStartDate.Do not publish 1.0.0 yet. Accelerator Admin is still on
@ordercloud/react-sdk^0.3.0, React^18.2.0, and React Hook Form. The onlyuseOcFormcall isapps/admin/src/components/OperationForm/index.tsx. Auth forms can stay on React Hook Form. That screen has to saveparseValues().bodyof the loaded form before this ships.