Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

fix(deps): update dependency react-final-form to v6 #17

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 29, 2019

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-final-form 4.1.0 -> 6.5.9 age adoption passing confidence

Release Notes

final-form/react-final-form

v6.5.9

Compare Source

  • Added React 18 to peer dependencies (#​982)

v6.5.8

Compare Source

v6.5.7

Compare Source

Type Fixes

v6.5.6

Compare Source

Oops. My mistake.

  • Remove engines from package.json #​945

v6.5.5

Compare Source

Apologies... FF v4.20.3 contained an engines value in package.json that broke some builds.

  • Skipped FF 4.20.3 for 4.20.4 #​945

v6.5.4

Compare Source

Bug Fixes

  • Use custom hook to create callback constants #​933
  • Use each item inside of decorators to allow decorators to change identity #​893
  • Stabilize useField public handler identity #​931 #​816

Type Fixes

  • Improved typing for the ability to convert types when using parse/format #​935 #​929

v6.5.3

Compare Source

Examples Fixes only

  • Programmatic submit does not work in React 17 (#​900)
  • Fix error component subscription prop b3c79b8

v6.5.2

Compare Source

🎉 Support for React 17 as a peer dep! 🎉

Bug Fixes

  • Lost the formatting method call in checked field getter #​859 #​858

Type Fixes

  • Apply generic types to params in useFormState declaration #​841
  • Allow custom props in FormProps #​867 #​864

v6.5.1

Compare Source

Hi, @​erikras here. The primary reason for this update is to remove the Scarf dependency. I already did for Final Form and I thought React Final Form did not have its own dependency, but I was mistaken. Apologies for the delay.

You can read about my feelings about Scarf here:

Open Source Sustainability

Deps Fixes

Bug Fixes

  • Update auto-save-selective-debounce to handle clearing inputs #​802
  • Re-initialize onFocus/onBlur handlers if the subscribed field changes #​787

Type Fixes

  • Update FormValues Typescript definition #​806

v6.5.0

Compare Source

New Features

  • 🎉🎉 Forward refs to input component 🎉🎉 #​608 #​141
  • Add modifiedSinceLastSubmit flag to form and field state #​799

Bug Fixes

  • Deduce select type from component prop for select-multiple #​793
  • If name prop is passed as undefined to Field component, an error is thrown #​777 #​450

v6.4.0

Compare Source

As of React v16.13.0, there has been a warning in React Final Form, Redux Form, and Formik. You can read @​gaearon's explanation of it here: https://github.com/facebook/react/issues/18178#issuecomment-595846312

This release, in conjunction with final-form@4.19.0, fixes this warning.

Technically, a peer dependency change should be a major, breaking change, but these two libraries are so tightly coupled, that I'm only making it a "minor" update. Shout at @​erikras on Twitter if this upsets you.

Bug Fix

  • Silent initial field registration to avoid React warning #​766 #​751

v6.3.5

Compare Source

Bug Fix

v6.3.4

Compare Source

Bug Fixes

Typing Fixes

v6.3.3

Compare Source

Typing Fixes

v6.3.2

Compare Source

v6.3.1 introduced a bug. v6.3.2 fixes it.

Bug Fixes

v6.3.1

Compare Source

Bug Fixes

Typing Fixes

  • Fix useFormState and useField Flow types #​630
  • Add RenderableProps to FormRenderProps #​575
  • Fix typescript typings in FieldProps #​619
  • Fix FormProps['decorators'] #​629
  • Pass FormValues type to Decorator #​661
  • FieldInputProps extends AnyObject #​606
  • Remove Omit from the typescript definitions #​589
  • Allow typed render props in TS #​570

Build Fixes

v6.3.0

Compare Source

New Features

  • Support for Final Form's new validating flag. Requires final-form@4.16.1. #​541

Bug Fixes

  • Fixed destroyOnUnregister bug #​537
  • Use updated value for formatOnBlur format func #​465

v6.2.1

Compare Source

Whilst it could be argued that updating a peer dependency is a "breaking change" – and it would be if it were on a large third party library, like React – it is the opinion of the library author that, due to the tight coupling between final-form and react-final-form, such a change, especially just for type definitions, is acceptable, even in a "patch" release. Feel free to yell at @​erikras on Twitter if you vehemently disagree.

Type Updates

  • Updated to FF@4.15.0 to get typed FieldState ab2e970

v6.2.0

Compare Source

TypeScript fixes

  • Use the same default for FormValues type in all declared types (#​525)
  • Replace empty object default type with any object (#​526)
  • Refactor getContext back to a simple context file (#​524)

New Features

  • Strongly typed field values (#​530)
  • Added tsx generic typings for Field, Form, and FormSpy components (#​522)

For Typescript users, you can take advantage of JSX Generics, so you can specify the type of your form values or field value directly in the JSX call to Form, Field, or FormSpy. For Form, it will even infer the form values type if you provide initialValues.

Behold this code:

interface MyValues {
  firstName: string
  lastName: string
}

const initialValues: MyValues = {
  firstName: 'Erik',
  lastName: 'Rasmussen'
}

const onSubmit = (values: MyValues) => {
  ajax.send(values)
}
{/*
  Typescript will complain if the type of initialValues is not
  the same as what is accepted by onSubmit
*/} 
<Form onSubmit={onSubmit} initialValues={initialValues}>
  {({ handleSubmit, values }) => {
    // 💥 Type of values is inferred from the type of initialValues 💥
    return (
      <form onSubmit={handleSubmit}>
        {/* 😎 Field values are strongly typed using JSX generics 😎 */}
        <Field<string> name="firstName" component={TextInput} />
        <Field<string> name="lastName" component={TextInput} />
        <Field<number> name="age" component={NumberInput} />
        <button type="submit">Submit</button>
      </form>
    )
  }}
</Form>

v6.1.0

Compare Source

New Features

  • Allowed swappable final-form APIs #​520
  • 💥 Strongly typed form values for Flow and Typescript 💥 #​516

Usage:

import { withTypes, Field } from 'react-final-form'

type MyValues = {
  email: string,
  password: string
}
const { Form } = withTypes<MyValues>()

<Form onSubmit={onSubmit}>
   {({ handleSubmit, values }) => {
     // values are of type MyValues
   }}
</Form>

Edit Strongly Typed Form Values with 🏁 React Final Form

Housekeeping

  • Remove context export #​515
  • Simplify slightly logic around keeping latest value in ref #​513

v6.0.1

Compare Source

Bug Fixes

Type Fixes

  • Fix Flow typings for UseFieldConfig and FieldProps #​503
  • Added back flow types that got removed #​505 #​500
  • Update Types to make useField's options optional #​499

v6.0.0

Compare Source

This release contains very minimal, edge-case, breaking changes.

Bug Fixes

  • Fixed bug in form component rerendering not responding to changes in form state properly. #​498 #​487 #​492

⚠️ Breaking Changes ⚠️

  • Subscription changes will now be ignored. For some reason previous versions of React Final Form did extra work to allow you to change the subscription prop, causing the component to reregister with the Final Form instance. That is a very rare use case, and it was a lot of code to enable it. If you need to change your subscription prop, you should also change the key prop, which will force the component to be destroyed and remounted with the new subscription.
  • parse={null} and format={null} are no longer allowed. That was a bad choice of API design, which is probably why Flow doesn't allow the Function | null union type. #​400 Passing null served the purpose of disabling the default parse and format functionality. If you need to disable the existing parse and format, you can pass an identity function, v => v, to parse and format.
< v6
<Field name="name" parse={null} format={null}/>
>= v6
const identity = v => v
...
<Field name="name" parse={identity} format={identity}/>

v5.1.2

Compare Source

  • Converted to use React.FC df89fde
  • Added missing length value to FieldRenderProps 89454a4

v5.1.1

Compare Source

Bug Fixes

  • Add state.change to useField's onChange dependencies. #​477
  • Make flattenSubscription hooks-safe #​479

Type Fixes

  • add beforeSubmit and afterSubmit to typescript def #​484
  • Add simple test for generic FieldRenderProps type #​439
  • Tweak useFormState TS types #​482 #​476
  • Adjust ts definitions #​486

v5.1.0

Compare Source

New Features

v5.0.2

Compare Source

Bug Fixes

v5.0.1

Compare Source

🤦‍♂️

  • Actually changed peerDep to React 16.8 99cef7d

v5.0.0

Compare Source

🎉 v5.0.0 – HOOKS!!! 🎉

First to explain why this change was made... To manage subscriptions to the internal 🏁 Final Form instance, 🏁 React Final Form has been using some legacy lifecycle methods that make the side effect of subscribing to an event emitter cumbersome. Such subscriptions are a perfect use case (no pun intended) for the new React.useEffect() hook. In an effort to modernize and future proof the library, the entire thing has been rewritten to use hooks.

All the previous tests have been rewritten to use 🐐 React Testing Library, which is a superior way to test React components. None of the tests were removed, so all existing functionality from v4 should work in v5, including some optimizations to minimize superfluous additional renders that were made possible by hooks.

⚠️ BREAKING CHANGES 😮

Don't worry...there really aren't that many.

  • Requires ^react@16.8.0. That's where the hooks are. 🙄
  • All deprecated functions provided in FormRenderProps and FormSpyRenderProps have been removed. They have been spitting warnings at you since v3, so you've probably already corrected for this. The following applies to:
    • batch
    • blur
    • change
    • focus
    • initialize
    • mutators
    • reset

Rather than spreading the FormApi into the render props, you are just given form itself.

v4
<Form onSubmit={submit}>{({ reset }) => (
  // fields here
  <button type="button" onClick={reset}>Reset</button>
)}</Form>
v5
<Form onSubmit={submit}>{({ form }) => (
  // fields here
  <button type="button" onClick={form.reset}>Reset</button>
)}</Form>
  • Field will no longer rerender when the validate prop. Note: it will still always run the latest validation function you have given it, but it won't rerender when the prop is !==. This is to allow the very common practice of providing an inline => function as a field-level validation function. This change will break the very rare edge case where if you are swapping field-level validation functions with different behaviors on subsequent renders, the field will no longer rerender with the new validation errors. The fix for this is to also change the key prop on Field any time you swap the validate function. See this test for an example of what I mean. There's also a sandbox demonstrating the issue:

Edit Changing Field Level Validators

  • The previously exported withReactFinalForm HOC has been removed. Now you should use the useForm() hook if you'd like to get the 🏁 Final Form instance out of the context. To ease your transition, you can make your own with a single line of code:
const withReactFinalForm = Component => props =>
  <Component reactFinalForm={useForm()} {...props} /> 

😎 New Hook API 😎

Because it was so easy to do, 🏁 React Final Form now exports the useField and useFormState hooks that are used internally in Field and FormSpy respectively. Literally the only thing Field and FormSpy do now is call their hook and then figure out if you are trying to render with the component, render, or children prop.

For example, before v5, if you wanted to create a custom error component that only rerendered when touched or error changed for a field, you'd have to do this:

v4
const Error = ({ name }) => (
  <Field name={name} subscription={{ touched: true, error: true }}>
    {field =>
      field.meta.touched && field.meta.error ? (
        <span>{field.meta.error}</span>
      ) : null
    }
  </Field>
)

...but now you can do:

v5
const Error = ({ name }) => {
  const field = useField(name, { subscription: { touched: true, error: true } })
  return field.meta.touched && field.meta.error ? (
    <span>{field.meta.error}</span>
  ) : null
}

Not too groundbreakingly different, but these hooks might allow for some composability that was previously harder to do, like this clever disgusting hack to listen to multiple fields at once.

Go forth and hook all the things! 🎣


Special thanks to @​Andarist for giving me such an extensive code review on #​467.


Configuration

📅 Schedule: Branch creation - "before 3am on Monday" (UTC), 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 requested a review from notrab May 29, 2019 05:31
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch 2 times, most recently from e630202 to da08a25 Compare May 29, 2019 20:39
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch 3 times, most recently from 9b873bd to bdc4107 Compare June 14, 2019 13:25
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from bdc4107 to bca96ab Compare June 19, 2019 10:46
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from bca96ab to 748ed2d Compare November 21, 2019 10:10
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 748ed2d to 58a67aa Compare February 8, 2020 21:59
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 58a67aa to e9382a5 Compare April 21, 2020 14:23
@renovate renovate bot changed the title fix(deps): update dependency react-final-form to v6 Update dependency react-final-form to v6 Apr 27, 2020
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from e9382a5 to 80b9274 Compare May 27, 2020 16:54
@renovate renovate bot changed the title Update dependency react-final-form to v6 fix(deps): update dependency react-final-form to v6 Jun 12, 2020
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 80b9274 to b6ba6ca Compare July 13, 2020 17:04
@renovate renovate bot changed the title fix(deps): update dependency react-final-form to v6 Update dependency react-final-form to v6 Jul 20, 2020
@renovate renovate bot changed the title Update dependency react-final-form to v6 fix(deps): update dependency react-final-form to v6 Aug 3, 2020
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch 3 times, most recently from 3967fc8 to b9da975 Compare August 4, 2020 21:52
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch 2 times, most recently from e8a59cb to 6121b81 Compare October 21, 2020 09:53
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 6121b81 to c3cf54f Compare March 20, 2021 12:53
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch 4 times, most recently from 2e4e193 to ffe26a1 Compare September 30, 2021 15:21
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from ffe26a1 to 0285665 Compare March 7, 2022 17:14
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 0285665 to 946373f Compare April 24, 2022 22:24
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 946373f to 818bf0e Compare September 25, 2022 22:44
@renovate renovate bot force-pushed the renovate/react-final-form-6.x branch from 818bf0e to 9ed4f76 Compare November 20, 2022 20:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants