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

fix(deps): update dependency @hookform/resolvers to v2 #220

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 2, 2021

WhiteSource Renovate

This PR contains the following updates:

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

Release Notes

react-hook-form/resolvers

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 '@​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

v1.3.7

Compare Source

Bug Fixes

v1.3.6

Compare Source

Bug Fixes

v1.3.5

Compare Source

Bug Fixes

v1.3.4

Compare Source

Bug Fixes

v1.3.3

Compare Source

Bug Fixes
  • expose array element validation errors in zod resolver (#​119) (ecee1e9)

v1.3.2

Compare Source

Bug Fixes

v1.3.1

Compare Source

esm support to fix bundler incompatibility (#​95)

v1.3.0

Compare Source

Support Yup ^0.32.0 (#​92)

v1.2.0

Compare Source

vestResolver (#​82)

import * as React from 'react';
import { useForm } from 'react-hook-form';
import { vestResolver } from '@&#8203;hookform/resolvers/vest';
import vest, { test, enforce } from 'vest';

const validationSuite = vest.create((data = {}) => {
  test('username', 'Username is required', () => {
    enforce(data.username).isNotEmpty();
  });

  test('username', 'Must be longer than 3 chars', () => {
    enforce(data.username).longerThan(3);
  });

  test('password', 'Password is required', () => {
    enforce(data.password).isNotEmpty();
  });

  test('password', 'Password must be at least 5 chars', () => {
    enforce(data.password).longerThanOrEquals(5);
  });

  test('password', 'Password must contain a digit', () => {
    enforce(data.password).matches(/[0-9]/);
  });

  test('password', 'Password must contain a symbol', () => {
    enforce(data.password).matches(/[^A-Za-z0-9]/);
  });
});

const App = () => {
  const { register, handleSubmit, errors } = useForm({
    resolver: vestResolver(validationSuite),
  });

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

v1.1.2

Compare Source

fix: superstruct filename typo (#​89)

v1.1.1

Compare Source

fix: IE11 build (#​85)

v1.1.0

Compare Source

Update Superstruct version (#​83)

v1.0.1

Compare Source

  • build: add TS declaration file to ie11 build (#​72)
  • Use right version of react-hook-form for ie11 bundle (#​68)

Configuration

📅 Schedule: 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 WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/hookform-resolvers-2.x branch 4 times, most recently from 40baf5f to cc2e9d1 Compare April 13, 2021 08:00
@renovate renovate bot force-pushed the renovate/hookform-resolvers-2.x branch 3 times, most recently from c314aa2 to 3ff4ea6 Compare April 17, 2021 08:50
@renovate renovate bot force-pushed the renovate/hookform-resolvers-2.x branch from 3ff4ea6 to 5e545b1 Compare May 13, 2021 15:52
@renovate renovate bot force-pushed the renovate/hookform-resolvers-2.x branch from 5e545b1 to 511f732 Compare May 16, 2021 18:52
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.

1 participant