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

Upgrade TypeScript version to 4.4 #6588

Merged
merged 1 commit into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/crm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"@types/faker": "^5.1.7",
"@types/jest": "^26.0.19",
"@types/lodash": "~4.14.168",
"@types/react": "^16.9.13",
"@types/react": "^17.0.20",
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^16.9.9",
"@types/react-dom": "^17.0.9",
"rewire": "^5.0.0",
"source-map-explorer": "^2.0.0",
"typescript": "^4.0.2",
"typescript": "^4.4.0",
"web-vitals": "^1.0.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/crm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react-jsx"
},
"include": [
"src"
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
"@types/jest": "^26.0.19",
"@types/node": "^12.12.14",
"@types/query-string": "5.1.0",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.9",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"rewire": "^5.0.0",
"source-map-explorer": "^2.0.0",
"typescript": "^4.0.2"
"typescript": "^4.4.0"
}
}
2 changes: 1 addition & 1 deletion examples/demo/src/products/GridList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const LoadedGridList = (props: GridProps) => {
);
};

interface GridProps extends DatagridProps, WithWidth {}
interface GridProps extends Omit<DatagridProps, 'width'>, WithWidth {}

const GridList = (props: WithWidth) => {
const { width } = props;
Expand Down
42 changes: 24 additions & 18 deletions examples/demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["src"]
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}
2 changes: 1 addition & 1 deletion examples/no-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@vitejs/plugin-react-refresh": "^1.3.1",
"typescript": "^4.1.2",
"typescript": "^4.4.0",
"vite": "^2.1.5"
}
}
2 changes: 1 addition & 1 deletion examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ignore-not-found-export-plugin": "^1.0.1",
"react-app-polyfill": "^1.0.4",
"style-loader": "~1.2.1",
"typescript": "^4.1.3",
"typescript": "^4.4.0",
"vite": "^2.2.3",
"webpack": "~4.5.0",
"webpack-cli": "~2.0.13",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@types/jest": "^26.0.19",
"@types/react": "^16.9.56",
"@types/react": "^17.0.20",
"@types/react-redux": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
Expand Down Expand Up @@ -87,6 +87,6 @@
"cypress"
],
"dependencies": {
"typescript": "^4.0.2"
"typescript": "^4.4.0"
}
}
4 changes: 3 additions & 1 deletion packages/ra-core/src/core/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const ResourceRegister = (props: ResourceProps) => {
icon,
})
);
return () => dispatch(unregisterResource(name));
return () => {
dispatch(unregisterResource(name));
};
}, [dispatch, name, create, edit, icon, list, show, options]);
return null;
};
Expand Down
2 changes: 2 additions & 0 deletions packages/ra-core/src/export/downloadCSV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ export default (csv, filename) => {
fakeLink.style.display = 'none';
document.body.appendChild(fakeLink);
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' });
// @ts-ignore
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
// Manage IE11+ & Edge
// @ts-ignore
window.navigator.msSaveOrOpenBlob(blob, `${filename}.csv`);
} else {
fakeLink.setAttribute('href', URL.createObjectURL(blob));
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/reducer/admin/resource/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const addOneRecord = (
[newRecord.id]: isEqual(newRecord, oldRecords[newRecord.id])
? oldRecords[newRecord.id] // do not change the record to avoid a redraw
: newRecord,
};
} as RecordSetWithDate;

return Object.defineProperty(newRecordsById, 'fetchedAt', {
value: { ...oldRecords.fetchedAt, [newRecord.id]: date },
Expand Down
50 changes: 19 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3683,10 +3683,10 @@
dependencies:
"@types/react" "*"

"@types/react-dom@^16.9.9":
version "16.9.9"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.9.tgz#d2d0a6f720a0206369ccbefff752ba37b9583136"
integrity sha512-jE16FNWO3Logq/Lf+yvEAjKzhpST/Eac8EMd1i4dgZdMczfgqC8EjpxwNgEe3SExHYLliabXDh9DEhhqnlXJhg==
"@types/react-dom@^17.0.9":
version "17.0.9"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add"
integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg==
dependencies:
"@types/react" "*"

Expand Down Expand Up @@ -3734,20 +3734,13 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@^16.9.13":
version "16.9.19"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.19.tgz#c842aa83ea490007d29938146ff2e4d9e4360c40"
integrity sha512-LJV97//H+zqKWMms0kvxaKYJDG05U2TtQB3chRLF8MPNs+MQh/H1aGlyDUxjaHvu08EAGerdX2z4LTBc7ns77A==
dependencies:
"@types/prop-types" "*"
csstype "^2.2.0"

"@types/react@^16.9.56":
version "16.9.56"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.56.tgz#ea25847b53c5bec064933095fc366b1462e2adf0"
integrity sha512-gIkl4J44G/qxbuC6r2Xh+D3CGZpJ+NdWTItAPmZbR5mUS+JQ8Zvzpl0ea5qT/ZT3ZNTUcDKUVqV3xBE8wv/DyQ==
"@types/react@*", "@types/react@^17.0.20":
version "17.0.20"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.20.tgz#a4284b184d47975c71658cd69e759b6bd37c3b8c"
integrity sha512-wWZrPlihslrPpcKyCSlmIlruakxr57/buQN1RjlIeaaTWDLtJkTtRW429MoQJergvVKc4IWBpRhWw7YNh/7GVA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/recharts-scale@*":
Expand All @@ -3771,6 +3764,11 @@
dependencies:
"@types/node" "*"

"@types/scheduler@*":
version "0.16.2"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==

"@types/sinonjs__fake-timers@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz#681df970358c82836b42f989188d133e218c458e"
Expand Down Expand Up @@ -7678,7 +7676,7 @@ cssstyle@^2.2.0:
dependencies:
cssom "~0.3.6"

csstype@^2.2.0, csstype@^2.5.2, csstype@^2.6.5, csstype@^2.6.7:
csstype@^2.5.2, csstype@^2.6.5, csstype@^2.6.7:
version "2.6.8"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431"
integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==
Expand Down Expand Up @@ -19711,20 +19709,10 @@ typescript-tuple@^2.2.1:
dependencies:
typescript-compare "^0.0.2"

typescript@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==

typescript@^4.1.2:
version "4.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==

typescript@^4.1.3:
version "4.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.2.tgz#1450f020618f872db0ea17317d16d8da8ddb8c4c"
integrity sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ==
typescript@^4.4.0:
version "4.4.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324"
integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==

ua-parser-js@^0.7.18:
version "0.7.28"
Expand Down