Skip to content

Commit d34e6ee

Browse files
committed
Upgraded deps
1 parent c5d9dc5 commit d34e6ee

File tree

7 files changed

+13233
-5940
lines changed

7 files changed

+13233
-5940
lines changed

package-lock.json

Lines changed: 13161 additions & 5869 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-scripts.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,7 @@ module.exports = {
7979
validate: {
8080
description:
8181
'This runs several scripts to make sure things look good before committing or on clean install',
82-
default: concurrent.nps(
83-
'lint',
84-
'flow',
85-
'typescript',
86-
'build.andTest',
87-
'test'
88-
)
82+
default: concurrent.nps('lint', 'typescript', 'build.andTest', 'test')
8983
}
9084
},
9185
options: {

package.json

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,68 +25,69 @@
2525
},
2626
"homepage": "https://github.com/final-form/react-final-form-arrays#readme",
2727
"devDependencies": {
28-
"@babel/core": "^7.4.5",
29-
"@babel/plugin-proposal-class-properties": "^7.4.4",
30-
"@babel/plugin-proposal-decorators": "^7.4.4",
31-
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
32-
"@babel/plugin-proposal-function-sent": "^7.2.0",
33-
"@babel/plugin-proposal-json-strings": "^7.2.0",
34-
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
35-
"@babel/plugin-proposal-throw-expressions": "^7.2.0",
36-
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
37-
"@babel/plugin-syntax-import-meta": "^7.2.0",
38-
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
39-
"@babel/plugin-transform-runtime": "^7.4.4",
40-
"@babel/preset-env": "^7.4.5",
41-
"@babel/preset-flow": "^7.0.0",
42-
"@babel/preset-react": "^7.0.0",
43-
"@testing-library/jest-dom": "^4.0.0",
44-
"@testing-library/react": "^8.0.1",
45-
"@types/react": "^16.8.20",
28+
"@babel/core": "^7.12.3",
29+
"@babel/plugin-proposal-class-properties": "^7.12.1",
30+
"@babel/plugin-proposal-decorators": "^7.12.1",
31+
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
32+
"@babel/plugin-proposal-function-sent": "^7.12.1",
33+
"@babel/plugin-proposal-json-strings": "^7.12.1",
34+
"@babel/plugin-proposal-numeric-separator": "^7.12.1",
35+
"@babel/plugin-proposal-throw-expressions": "^7.12.1",
36+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
37+
"@babel/plugin-syntax-import-meta": "^7.10.4",
38+
"@babel/plugin-transform-flow-strip-types": "^7.12.1",
39+
"@babel/plugin-transform-runtime": "^7.12.1",
40+
"@babel/preset-env": "^7.12.1",
41+
"@babel/preset-flow": "^7.12.1",
42+
"@babel/preset-react": "^7.12.1",
43+
"@testing-library/jest-dom": "^5.11.4",
44+
"@testing-library/react": "^11.1.0",
45+
"@types/react": "^16.9.53",
46+
"@typescript-eslint/eslint-plugin": "^4.5.0",
4647
"babel-core": "^7.0.0-bridge.0",
47-
"babel-eslint": "^10.0.1",
48-
"babel-jest": "^24.8.0",
48+
"babel-eslint": "^10.1.0",
49+
"babel-jest": "^26.6.0",
4950
"bundlesize": "^0.18.0",
5051
"doctoc": "^1.4.0",
51-
"eslint": "^5.16.0",
52-
"eslint-config-react-app": "^4.0.1",
53-
"eslint-plugin-babel": "^5.2.1",
54-
"eslint-plugin-flowtype": "^3.10.3",
55-
"eslint-plugin-import": "^2.17.3",
56-
"eslint-plugin-jsx-a11y": "^6.2.1",
57-
"eslint-plugin-react": "^7.13.0",
58-
"eslint-plugin-react-hooks": "^1.6.0",
59-
"fast-check": "^1.16.0",
60-
"final-form": "^4.18.1",
61-
"final-form-arrays": "^3.0.0",
62-
"flow-bin": "^0.102.0",
52+
"eslint": "^7.11.0",
53+
"eslint-config-react-app": "^5.2.1",
54+
"eslint-plugin-babel": "^5.3.1",
55+
"eslint-plugin-flowtype": "^5.2.0",
56+
"eslint-plugin-import": "^2.22.1",
57+
"eslint-plugin-jsx-a11y": "^6.3.1",
58+
"eslint-plugin-react": "^7.21.5",
59+
"eslint-plugin-react-hooks": "^4.2.0",
60+
"fast-check": "^2.5.0",
61+
"final-form": "^4.20.1",
62+
"final-form-arrays": "^3.0.2",
63+
"flow-bin": "^0.136.0",
6364
"glow": "^1.2.2",
64-
"husky": "^3.0.0",
65-
"jest": "^24.8.0",
66-
"jest-watch-typeahead": "^0.3.1",
67-
"lint-staged": "^9.2.0",
68-
"nps": "^5.9.5",
65+
"husky": "^4.3.0",
66+
"jest": "^26.6.0",
67+
"jest-watch-typeahead": "^0.6.1",
68+
"lint-staged": "^10.4.2",
69+
"nps": "^5.10.0",
6970
"nps-utils": "^1.7.0",
70-
"prettier": "^1.18.2",
71+
"prettier": "^2.1.2",
7172
"prettier-eslint-cli": "^5.0.0",
72-
"raf": "^3.4.0",
73-
"react": "^16.8.6",
74-
"react-dom": "^16.8.6",
75-
"react-final-form": "^6.2.1",
76-
"rollup": "^1.15.5",
77-
"rollup-plugin-babel": "^4.3.2",
78-
"rollup-plugin-commonjs": "^10.0.0",
73+
"raf": "^3.4.1",
74+
"react": "^17.0.0",
75+
"react-dom": "^17.0.0",
76+
"react-final-form": "^6.5.2",
77+
"rollup": "^2.32.1",
78+
"rollup-plugin-babel": "^4.4.0",
79+
"rollup-plugin-commonjs": "^10.1.0",
7980
"rollup-plugin-json": "^4.0.0",
80-
"rollup-plugin-node-resolve": "^5.0.2",
81+
"rollup-plugin-node-resolve": "^5.2.0",
8182
"rollup-plugin-replace": "^2.2.0",
82-
"rollup-plugin-uglify": "^6.0.2",
83-
"typescript": "^3.5.2"
83+
"rollup-plugin-uglify": "^6.0.4",
84+
"typescript": "^4.0.3"
8485
},
8586
"peerDependencies": {
8687
"final-form": "^4.15.0",
8788
"final-form-arrays": ">=1.0.4",
8889
"react-final-form": "^6.2.1",
89-
"react": "^16.8.0"
90+
"react": "^16.8.0 || ^17.0.0"
9091
},
9192
"jest": {
9293
"watchPlugins": [
@@ -118,6 +119,6 @@
118119
}
119120
],
120121
"dependencies": {
121-
"@babel/runtime": "^7.4.5"
122+
"@babel/runtime": "^7.12.1"
122123
}
123124
}

src/FieldArray.d.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
12
import * as React from 'react'
23
import { Form, Field } from 'react-final-form'
34
import arrayMutators from 'final-form-arrays'

src/FieldArray.test.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import React from 'react'
2-
import { render, fireEvent, cleanup } from '@testing-library/react'
2+
import { act, render, fireEvent, cleanup } from '@testing-library/react'
33
import '@testing-library/jest-dom/extend-expect'
44
import arrayMutators from 'final-form-arrays'
55
import { ErrorBoundary, Toggle, wrapWith } from './testUtils'
66
import { Form, Field } from 'react-final-form'
77
import { FieldArray, version } from '.'
88

99
const onSubmitMock = values => {}
10-
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
10+
const timeout = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
11+
async function sleep(ms) {
12+
await act(async () => {
13+
await timeout(ms)
14+
})
15+
}
1116

1217
describe('FieldArray', () => {
1318
afterEach(cleanup)
@@ -259,7 +264,7 @@ describe('FieldArray', () => {
259264

260265
expect(typeof renderArray.mock.calls[0][0].fields.push).toBe('function')
261266

262-
renderArray.mock.calls[0][0].fields.push('c')
267+
act(() => renderArray.mock.calls[0][0].fields.push('c'))
263268
expect(validate).toHaveBeenCalledTimes(2)
264269

265270
expect(renderArray).toHaveBeenCalledTimes(2)
@@ -328,9 +333,10 @@ describe('FieldArray', () => {
328333
})
329334

330335
it('calculate dirty/pristine using provided isEqual predicate', () => {
331-
const isEqual = jest.fn(
332-
(aArray, bArray) =>
333-
!aArray.some((a, index) => a.bar !== bArray[index].bar)
336+
const isEqual = jest.fn((aArray, bArray) =>
337+
!aArray
338+
? !bArray
339+
: bArray && !aArray.some((a, index) => a.bar !== bArray[index].bar)
334340
)
335341
const { getByTestId } = render(
336342
<Form
@@ -508,8 +514,8 @@ describe('FieldArray', () => {
508514
<FieldArray name="clients">
509515
{({ fields }) => (
510516
<div>
511-
{fields.map(field => (
512-
<div>
517+
{fields.map((field) => (
518+
<div key={field}>
513519
<Field
514520
name={`${field}.firstName`}
515521
key={`${field}.firstName`}
@@ -725,15 +731,15 @@ describe('FieldArray', () => {
725731
)}
726732
</Form>
727733
)
728-
expect(getByTestId('values')).toHaveTextContent('')
734+
expect(getByTestId('values')).toHaveTextContent('{}')
729735
expect(onSubmit).not.toHaveBeenCalled()
730736
fireEvent.click(getByText('Add'))
731737
expect(getByTestId('values')).toHaveTextContent('{"names":["erikras"]}')
732738
fireEvent.submit(getByTestId('form'))
733739
await sleep(3)
734740
expect(onSubmit).toHaveBeenCalled()
735741
expect(onSubmit).toHaveBeenCalledTimes(1)
736-
expect(getByTestId('values')).toHaveTextContent('')
742+
expect(getByTestId('values')).toHaveTextContent('{}')
737743
})
738744

739745
it('should provide value', () => {

src/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as React from 'react'
2-
import { FieldSubscription, FieldState } from 'final-form'
1+
import { FieldState } from 'final-form'
32
import { UseFieldConfig } from 'react-final-form'
43
export const version: string
54

src/useFieldArray.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { render, cleanup } from '@testing-library/react'
2+
import { act, render, cleanup } from '@testing-library/react'
33
import '@testing-library/jest-dom/extend-expect'
44
import arrayMutators from 'final-form-arrays'
55
import { ErrorBoundary } from './testUtils'
@@ -53,7 +53,7 @@ describe('FieldArray', () => {
5353
expect(spy).toHaveBeenCalledTimes(1)
5454
expect(spy.mock.calls[0][0].fields.length).toBe(0)
5555

56-
spy.mock.calls[0][0].fields.push('bob')
56+
act(() => spy.mock.calls[0][0].fields.push('bob'))
5757

5858
expect(spy).toHaveBeenCalledTimes(2)
5959
expect(spy.mock.calls[1][0].fields.length).toBe(1)

0 commit comments

Comments
 (0)