citizenlab icon indicating copy to clipboard operation
citizenlab copied to clipboard

Bump yup from 0.32.11 to 1.6.1 in /front

Open dependabot[bot] opened this issue 11 months ago • 1 comments

Bumps yup from 0.32.11 to 1.6.1.

Release notes

Sourced from yup's releases.

v1 Because I finally got around to it

jquense/yup#1906

v1.0.0-beta.7

Fixes published artifacts for the main field

v1.0.0-beta.5 - partial fixes and cast migration path

Beta 5 fixes partial and deepPartial making it work correctly with lazy schema. Specifically the optionality is added after lazy is evaluated but before any other when conditions are added. This makes it consistent with other conditional schema, where runtime conditions always supersede previous schema configuration. This allows for optional overrides if necessary.

const person = object({
  name: string().required(),
  age: number().required(),
  legalGuardian:  string().when('age', {
    is: (age) => age != null && age < 18,
    then: (schema) => schema.required(),
  }),
});

const optionalPerson = person.partial()

person.cast({name: 'James', age: 6 }) // => TypeError legalGuardian required

// age is still required b/c it's applied after the partial
optionalPerson.cast({name: 'James', age: 6 }) // => TypeError legalGuardian required

This works slightly differently for lazy which have no schema to "start" with:

const config = object({
  nameOrIdNumber:  lazy((value) => {
     if (typeof value === 'number') return number().required()
     return string().required()
  }),
});

const opti = config.partial()

config.cast({}) // => TypeError nameOrIdNumber is required

config.partial().cast({}) // => {}

Cast optionality migration path

A larger breaking change in v1 is the assertion of optionality during cast, making previous patterns like string().nullable().required() no longer possible. Generally this pattern is used when deserialized data is not valid to start, but will become valid through user input such as with an HTML form. v1 no longer allows this, but in order to make migration easier we've added an option to cast that mimics the previous behavior (not exactly but closely).

const name = string().required()
</tr></table> 

... (truncated)

Changelog

Sourced from yup's changelog.

1.6.1 (2024-12-17)

Bug Fixes

  • lazy validation errors thrown in builders should resolve async like other validations (c7d7f97)

1.6.0 (2024-12-16)

Features

1.5.0 (2024-12-03)

Bug Fixes

  • readme: some typos and update CustomizingErrors doc (#2163) (5c77e0d)

Features

  • Add exact and stripUnknown method to object() (adcdd8d)

1.4.0 (2024-03-06)

Bug Fixes

  • add optional message to nonNullable schema methods (#2119) (9e1df49)

Features

... (truncated)

Commits
  • d00abc3 Publish v1.6.1
  • c7d7f97 fix: lazy validation errors thrown in builders should resolve async like othe...
  • f27fa44 Publish v1.6.0
  • 0d7c327 build: modernize stuff
  • 2b0f126 feat: expose LazySchema
  • c26f9af Update README.md
  • 8ac18b6 Publish v1.5.0
  • adcdd8d feat: Add exact and stripUnknown method to object()
  • 87be159 Fix ValidationError.formatError() clobbering path param (#2250)
  • 5a22c16 let/const consistency in README: let preference (#2227)
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

dependabot[bot] avatar Jan 01 '25 04:01 dependabot[bot]

Warnings
:warning: The PR title contains no Jira issue key (case-sensitive)
:warning: The branch name contains no Jira issue key (case-sensitive)
Messages
:book: Changelog provided 🎉
:book:

Run the e2e tests

:book:

Check translation progress

Generated by :no_entry_sign: dangerJS against a228d085c2882de6e65d76cf72cee43633e804be

cl-dev-bot avatar Jan 01 '25 04:01 cl-dev-bot

Superseded by #12225.

dependabot[bot] avatar Oct 01 '25 04:10 dependabot[bot]