Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency @hookform/resolvers to v3 #814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 23, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@hookform/resolvers (source) 1.3.8 -> 3.4.2 age adoption passing confidence

Release Notes

react-hook-form/resolvers (@​hookform/resolvers)

v3.4.2

Compare Source

Bug Fixes

v3.4.1

Compare Source

v3.4.0

Compare Source

v3.3.4

Compare Source

Bug Fixes
  • error handling for array errors with root error (1bfc6ab)

v3.3.3

Compare Source

Bug Fixes

v3.3.2

Compare Source

Bug Fixes

v3.3.1

Compare Source

Bug Fixes

v3.3.0

Compare Source

Bug Fixes
Features
  • add support for root errors for field array (#​621) (5f1a622)
  • pass field names and a context as arguments to a Vest suite (#​584) (3519701)
  • valibot: add more tests, support of criteriaMode and reduce size (#​620) (a9d319d)

v3.2.0

Compare Source

Features

v3.1.1

Compare Source

BREAKING CHANGES

Bug Fixes

You don't need to explicitly provide the type when using the useForm function because it automatically infers the types from the Yup schema.

Before

const schema = Yup.shape({ name: string });

const { register } = useForm<{name: string}>({ resolver: yupResolver(schema) });

After

const schema = Yup.shape({ name: string });

const { register } = useForm({ resolver: yupResolver(schema) });

v3.1.0

Compare Source

Features

v3.0.1

Compare Source

Bug Fixes

v3.0.0

Compare Source

BREAKING CHANGES
  • Yup resolver require Yup v1
  • rename rawValues option to raw
  • classValidationResolver: schema options now includes validator and transformer options
  • Please note that ajv and ajv-errors need to be installed separately, as they are not bundled with resolvers

Before:

schemaOptions?: ValidatorOptions,

After:

schemaOptions?: {
    validator?: ValidatorOptions;
    transformer?: ClassTransformOptions;
  }
Bug Fixes
Features
import { useForm } from 'react-hook-form';
import { typeboxResolver } from '@&#8203;hookform/resolvers/typebox';
import { Type } from '@&#8203;sinclair/typebox';

const schema = Type.Object({
  username: Type.String({ minLength: 1 }),
  password: Type.String({ minLength: 1 }),
});

const App = () => {
  const { register, handleSubmit } = useForm({
    resolver: typeboxResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('username')} />
      <input type="password" {...register('password')} />
      <input type="submit" />
    </form>
  );
};
Performance Improvements

v2.9.11

Compare Source

Bug Fixes

v2.9.10

Compare Source

Bug Fixes

v2.9.9

Compare Source

Bug Fixes

v2.9.8

Compare Source

Bug Fixes

v2.9.7

Compare Source

Bug Fixes

v2.9.6

Compare Source

Bug Fixes
  • yup: yup wrong import statement assuming default export (#​427) (928afae)

v2.9.5

Compare Source

Bug Fixes
  • renamed private packages to avoid ambiguity with existing official packages. (#​424) (18ae921)

v2.9.4

Compare Source

Bug Fixes

v2.9.3

Compare Source

Breaking Change
  • compile error with UnpackNestedValue

BREAKING CHANGE: This change will update package dependency with react-hook-form to 7.33.0 above (52a6e07)

v2.9.2

Compare Source

Bug Fixes

v2.9.1

Compare Source

Bug Fixes
  • ajv resolver to work with unlimited layers of nesting (#​412) (692fe65)

v2.9.0

Compare Source

Features
import { useForm } from 'react-hook-form';
import { ajvResolver } from '@&#8203;hookform/resolvers/ajv';

// must use `minLength: 1` to implement required field
const schema = {
  type: 'object',
  properties: {
    username: {
      type: 'string',
      minLength: 1,
      errorMessage: { minLength: 'username field is required' },
    },
    password: {
      type: 'string',
      minLength: 1,
      errorMessage: { minLength: 'password field is required' },
    },
  },
  required: ['username', 'password'],
  additionalProperties: false,
};

const App = () => {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm({
    resolver: ajvResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((data) => console.log(data))}>
      <input {...register('username')} />
      {errors.username && <span>{errors.username.message}</span>}
      <input {...register('password')} />
      {errors.password && <span>{errors.password.message}</span>}
      <button type="submit">submit</button>
    </form>
  );
};

v2.8.10

Compare Source

Bug Fixes

v2.8.9

Compare Source

Bug Fixes

v2.8.8

Compare Source

Bug Fixes

v2.8.7

Compare Source

Bug Fixes

v2.8.6

Compare Source

Bug Fixes

v2.8.5

Compare Source

Bug Fixes

v2.8.4

Compare Source

Bug Fixes

v2.8.3

Compare Source

Bug Fixes
  • zodResolver: no exported member ParseParamsNoData (#​264) (14683e5)

v2.8.2

Compare Source

Bug Fixes
  • TypeScript issues with the latest react-hook-form version (66182f8)

v2.8.1

Compare Source

Bug Fixes

v2.8.0

Compare Source

BREAKING CHANGES

v2.7.1

Compare Source

Performance Improvements

v2.7.0

Compare Source

Features
import { useForm } from 'react-hook-form';
import { typanionResolver } from '@&#8203;hookform/resolvers/typanion';
import * as t from 'typanion';

const isUser = t.isObject({
  username: t.applyCascade(t.isString(), [t.hasMinLength(1)]),
  age: t.applyCascade(t.isNumber(), [t.isInteger(), t.isInInclusiveRange(1, 100)]),
});

const App = () => {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm({
    resolver: typanionResolver(isUser),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('name')} />
      {errors.name?.message && <p>{errors.name?.message}</p>}
      <input type="number" {...register('age')} />
      {errors.age?.message && <p>{errors.age?.message}</p>}
      <input type="submit" />
    </form>
  );
};

v2.6.1

Compare Source

Bug Fixes

v2.6.0

Compare Source

Features

v2.5.2

Compare Source

Bug Fixes

v2.5.1

Compare Source

Bug Fixes

v2.5.0

Compare Source

Features
import React from 'react';
import { useForm } from 'react-hook-form';
import { computedTypesResolver } from '@&#8203;hookform/resolvers/computed-types';
import Schema, { number, string } from 'computed-types';

const schema = Schema({
  username: string.min(1).error('username field is required'),
  password: string.min(1).error('password field is required'),
  password: number,
});

const App = () => {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm({
    resolver: computedTypesResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('name')} />
      {errors.name?.message && <p>{errors.name?.message}</p>}
      <input type="number" {...register('age', { valueAsNumber: true })} />
      {errors.age?.message && <p>{errors.age?.message}</p>}
      <input type="submit" />
    </form>
  );
};

export default App;

v2.4.0

Compare Source

Features
import React from 'react';
import { useForm } from 'react-hook-form';
import { nopeResolver } from '@&#8203;hookform/resolvers/nope';
import Nope from 'nope-validator';

const schema = Nope.object().shape({
  name: Nope.string().required(),
  age: Nope.number().required(),
});

const App = () => {
  const { register, handleSubmit } = useForm({
    resolver: nopeResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input name="name" ref={register} />
      <input name="age" type="number" ref={register} />
      <input type="submit" />
    </form>
  );
};

export default App;

v2.3.2

Compare Source

Bug Fixes

v2.3.1

Compare Source

Bug Fixes

v2.3.0

Compare Source

Features
import React from 'react';
import { useForm } from 'react-hook-form';
import { ioTsResolver } from '@&#8203;hookform/resolvers/io-ts';
import t from 'io-ts';
// you don't have to use io-ts-types but it's very useful
import tt from 'io-ts-types';

const schema = t.type({
  username: t.string,
  age: tt.NumberFromString,
});

const App = () => {
  const { register, handleSubmit } = useForm({
    resolver: ioTsResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input name="username" ref={register} />
      <input name="age" type="number" ref={register} />
      <input type="submit" />
    </form>
  );
};

export default App;

v2.2.0

Compare Source

Features
Bug Fixes
Performance Improvements

v2.1.0

Compare Source

Features
import 'reflect-metadata';
import React from 'react';
import { useForm } from 'react-hook-form';
import { classValidatorResolver } from '@&#8203;hookform/resolvers/class-validator';
import { Length, Min, IsEmail } from 'class-validator';

class User {
  @&#8203;Length(2, 30)
  username: string;

  @&#8203;Min(18)
  age: number;

  @&#8203;IsEmail()
  email: string;
}

const App = () => {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm<User>({ resolver:  classValidatorResolver(User) });

  return (
      <form onSubmit={handleSubmit((data) => console.log(data))} >
        <input type="text" {...register('username')} />
        {errors.username && <span>{errors.username.message}</span>}

        <input type="text" {...register('email')} />
        {errors.email && <span>{errors.email.message}</span>}

        <input type="number" {...register('age', { valueAsNumber: true })} />
        {errors.age && <span>{errors.age.message}</span>}

        <input type="submit" value="Submit" />
      </form>
  );
};

export default App;

v2.0.1

Compare Source

Bug Fixes

v2.0.0

Compare Source

BREAKING CHANGES
  • Require react-hook-form >= 7
Features
Bug Fixes
Performance Improvements

V2 🚀 (#​108) (fe53179), closes #​108 #​97 #​114 #​116 #​115 #​117 #​123 #​125 #​124 #​126 #​127 #​128 #​129 #​131 #​130 #​132 #​134 #​136


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 50aa3aa to 9c40c4c Compare April 5, 2023 08:47
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 9c40c4c to 30326dc Compare April 15, 2023 20:20
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 30326dc to 885a84a Compare June 14, 2023 12:29
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 885a84a to ed746a7 Compare August 6, 2023 13:54
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch 2 times, most recently from 51883e3 to 12c203f Compare August 28, 2023 21:55
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 12c203f to 9812da9 Compare October 11, 2023 22:26
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 9812da9 to 111d42c Compare October 24, 2023 04:32
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 111d42c to 148d460 Compare December 26, 2023 12:30
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 148d460 to 82990cf Compare January 4, 2024 09:46
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from 82990cf to c1670be Compare April 8, 2024 07:31
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from c1670be to d9b4883 Compare April 30, 2024 04:41
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from d9b4883 to b598c44 Compare May 15, 2024 04:49
@renovate renovate bot force-pushed the renovate/hookform-resolvers-3.x branch from b598c44 to 325ea4e Compare May 21, 2024 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants