From e838a7060acc29cd94ab4cf847192733b9aa1188 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 8 Apr 2022 10:58:08 +0200 Subject: [PATCH 1/5] Add package resolution for @types/react Signed-off-by: Johan Haals --- .changeset/little-moles-pull.md | 5 +++++ package.json | 3 ++- .../templates/default-app/package.json.hbs | 3 +++ yarn.lock | 21 ++++--------------- 4 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 .changeset/little-moles-pull.md diff --git a/.changeset/little-moles-pull.md b/.changeset/little-moles-pull.md new file mode 100644 index 0000000000..8a8d6da972 --- /dev/null +++ b/.changeset/little-moles-pull.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Add resolution for version 17 `@types/react` due to breaking changes introduced in version 18. diff --git a/package.json b/package.json index 13ba3c34ea..3154188414 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ ] }, "resolutions": { - "**/@graphql-codegen/cli/**/ws": "^7.4.6" + "**/@graphql-codegen/cli/**/ws": "^7.4.6", + "@types/react": "^17.0.39" }, "version": "1.1.0-next.2", "dependencies": { diff --git a/packages/create-app/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs index 884eaf23cf..55a1b63aa9 100644 --- a/packages/create-app/templates/default-app/package.json.hbs +++ b/packages/create-app/templates/default-app/package.json.hbs @@ -37,6 +37,9 @@ "prettier": "^2.3.2", "typescript": "~4.5.4" }, + "resolutions": { + "@types/react": "^17.0.39" + }, "prettier": "@spotify/prettier-config", "lint-staged": { "*.{js,jsx,ts,tsx,mjs,cjs}": [ diff --git a/yarn.lock b/yarn.lock index 63cd4710f5..21e7f59caa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1478,14 +1478,6 @@ lodash "^4.17.21" uuid "^8.0.0" -"@backstage/config@^0.1.15": - version "0.1.15" - resolved "https://registry.npmjs.org/@backstage/config/-/config-0.1.15.tgz#4bad122ad861be5bd61a60639f92d2494fa245c5" - integrity sha512-eNJEYYSEu9MkrkBYiMpUBWEc3Bu64YgB9pZZGCMW7/9350tV2wbylEdoBJHslilJlJhiUyTXBckn8Ua7DOH7rw== - dependencies: - "@backstage/types" "^0.1.3" - lodash "^4.17.21" - "@backstage/core-components@^0.9.0", "@backstage/core-components@^0.9.2": version "0.9.2" resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.9.2.tgz#9a3d79a15039256bbc007e5daa08c983050e0238" @@ -1610,11 +1602,6 @@ react-use "^17.2.4" swr "^1.1.2" -"@backstage/types@^0.1.3": - version "0.1.3" - resolved "https://registry.npmjs.org/@backstage/types/-/types-0.1.3.tgz#6613d8cbdf97d42d31cd1e66a833df533e7ccf14" - integrity sha512-fJVi4oVrlO+G3PRv1fYSll9/X4pE11HLnkI//Geare9sP6wSfp/2zXpLYfKVsG0e24jOl7Swkc8lwLkQ90zMaQ== - "@balena/dockerignore@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" @@ -6652,10 +6639,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16.9.0", "@types/react@^16.13.1 || ^17.0.0": - version "17.0.43" - resolved "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz#4adc142887dd4a2601ce730bc56c3436fdb07a55" - integrity sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A== +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^16.13.1 || ^17.0.0", "@types/react@^17.0.39": + version "17.0.44" + resolved "https://registry.npmjs.org/@types/react/-/react-17.0.44.tgz#c3714bd34dd551ab20b8015d9d0dbec812a51ec7" + integrity sha512-Ye0nlw09GeMp2Suh8qoOv0odfgCoowfM/9MG6WeRD60Gq9wS90bdkdRtYbRkNhXOpG4H+YXGvj4wOWhAC0LJ1g== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" From 8b669400ea8340a1f2c7595b186e33837c3143cc Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 8 Apr 2022 11:05:43 +0200 Subject: [PATCH 2/5] include react-dom types, update changeset Signed-off-by: Johan Haals --- .changeset/little-moles-pull.md | 20 ++++++++++++++++++- package.json | 3 ++- .../templates/default-app/package.json.hbs | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.changeset/little-moles-pull.md b/.changeset/little-moles-pull.md index 8a8d6da972..7fee7e5148 100644 --- a/.changeset/little-moles-pull.md +++ b/.changeset/little-moles-pull.md @@ -2,4 +2,22 @@ '@backstage/create-app': patch --- -Add resolution for version 17 `@types/react` due to breaking changes introduced in version 18. +Add resolution for version 17 `@types/react` and `types/react-dom` due to breaking changes introduced in version 18. + +To apply these changes to your existing installation. Add a resolutions block to your `package.json` + +```json + "resolutions": { + "@types/react": "^17", + "@types/react-dom": "^17" + }, +``` + +If your depending on react 16 in use this resolution block instead. + +```json + "resolutions": { + "@types/react": "^16", + "@types/react-dom": "^16" + }, +``` diff --git a/package.json b/package.json index 3154188414..dc72b8974b 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ }, "resolutions": { "**/@graphql-codegen/cli/**/ws": "^7.4.6", - "@types/react": "^17.0.39" + "@types/react": "^17", + "@types/react-dom": "^17" }, "version": "1.1.0-next.2", "dependencies": { diff --git a/packages/create-app/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs index 55a1b63aa9..5bdbec7971 100644 --- a/packages/create-app/templates/default-app/package.json.hbs +++ b/packages/create-app/templates/default-app/package.json.hbs @@ -38,7 +38,8 @@ "typescript": "~4.5.4" }, "resolutions": { - "@types/react": "^17.0.39" + "@types/react": "^17", + "@types/react-dom": "^17" }, "prettier": "@spotify/prettier-config", "lint-staged": { From 7d0a1f0199751abac40735a016cf6bed39715a52 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 8 Apr 2022 11:10:09 +0200 Subject: [PATCH 3/5] fix typo Signed-off-by: Johan Haals --- .changeset/little-moles-pull.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/little-moles-pull.md b/.changeset/little-moles-pull.md index 7fee7e5148..8b9f3ca446 100644 --- a/.changeset/little-moles-pull.md +++ b/.changeset/little-moles-pull.md @@ -2,7 +2,7 @@ '@backstage/create-app': patch --- -Add resolution for version 17 `@types/react` and `types/react-dom` due to breaking changes introduced in version 18. +Add type resolutions for `@types/react` and `types/react-dom`. This is an To apply these changes to your existing installation. Add a resolutions block to your `package.json` @@ -13,7 +13,7 @@ To apply these changes to your existing installation. Add a resolutions block to }, ``` -If your depending on react 16 in use this resolution block instead. +If your existing app depend on react 16 use this resolution block instead. ```json "resolutions": { From 1d031b536797bb5ac16c556dc399b6bfa4789fb2 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 8 Apr 2022 11:18:27 +0200 Subject: [PATCH 4/5] fix wording Signed-off-by: Johan Haals --- .changeset/little-moles-pull.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.changeset/little-moles-pull.md b/.changeset/little-moles-pull.md index 8b9f3ca446..592fc13ab6 100644 --- a/.changeset/little-moles-pull.md +++ b/.changeset/little-moles-pull.md @@ -2,7 +2,9 @@ '@backstage/create-app': patch --- -Add type resolutions for `@types/react` and `types/react-dom`. This is an +Add type resolutions for `@types/react` and `types/react-dom`. + +The reason for this is the usage of `"@types/react": "*"` as a dependency which is very common practice in react packages. This recently resolves to react 18 which introduces several breaking changes in both internal and external packages. To apply these changes to your existing installation. Add a resolutions block to your `package.json` @@ -13,7 +15,7 @@ To apply these changes to your existing installation. Add a resolutions block to }, ``` -If your existing app depend on react 16 use this resolution block instead. +If your existing app depends on react 16, use this resolution block instead. ```json "resolutions": { From 48129cf82642e071089c0f18dd42880dd1dd7858 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 8 Apr 2022 11:19:56 +0200 Subject: [PATCH 5/5] reformat Signed-off-by: Johan Haals --- .changeset/little-moles-pull.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/little-moles-pull.md b/.changeset/little-moles-pull.md index 592fc13ab6..f52bc24bb2 100644 --- a/.changeset/little-moles-pull.md +++ b/.changeset/little-moles-pull.md @@ -6,7 +6,7 @@ Add type resolutions for `@types/react` and `types/react-dom`. The reason for this is the usage of `"@types/react": "*"` as a dependency which is very common practice in react packages. This recently resolves to react 18 which introduces several breaking changes in both internal and external packages. -To apply these changes to your existing installation. Add a resolutions block to your `package.json` +To apply these changes to your existing installation, add a resolutions block to your `package.json` ```json "resolutions": {