From 017e6d461e6ddbf840fe9b978f0c47ce47c87221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 21 Nov 2024 11:59:31 +0000 Subject: [PATCH 1/5] chore: move v13 docs to `13.x-next` --- website/docs/{13.x-alpha => 13.x-next}/_meta.json | 0 website/docs/{13.x-alpha => 13.x-next}/cookbook/_meta.json | 0 .../docs/{13.x-alpha => 13.x-next}/cookbook/advanced/_meta.json | 0 .../cookbook/advanced/network-requests.md | 0 website/docs/{13.x-alpha => 13.x-next}/cookbook/basics/_meta.json | 0 .../docs/{13.x-alpha => 13.x-next}/cookbook/basics/async-tests.md | 0 .../{13.x-alpha => 13.x-next}/cookbook/basics/custom-render.md | 0 website/docs/{13.x-alpha => 13.x-next}/cookbook/index.md | 0 .../cookbook/state-management/_meta.json | 0 .../{13.x-alpha => 13.x-next}/cookbook/state-management/jotai.md | 0 website/docs/{13.x-alpha => 13.x-next}/docs/_meta.json | 0 website/docs/{13.x-alpha => 13.x-next}/docs/advanced/_meta.json | 0 .../docs/{13.x-alpha => 13.x-next}/docs/advanced/testing-env.mdx | 0 .../{13.x-alpha => 13.x-next}/docs/advanced/understanding-act.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api.md | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/_meta.json | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/events/_meta.json | 0 .../docs/{13.x-alpha => 13.x-next}/docs/api/events/fire-event.mdx | 0 .../docs/{13.x-alpha => 13.x-next}/docs/api/events/user-event.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/jest-matchers.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/_meta.json | 0 .../{13.x-alpha => 13.x-next}/docs/api/misc/accessibility.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/async.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/config.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/other.mdx | 0 .../docs/{13.x-alpha => 13.x-next}/docs/api/misc/render-hook.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/queries.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/render.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/api/screen.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/guides/_meta.json | 0 .../{13.x-alpha => 13.x-next}/docs/guides/community-resources.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/guides/faq.mdx | 0 .../docs/{13.x-alpha => 13.x-next}/docs/guides/how-to-query.mdx | 0 .../{13.x-alpha => 13.x-next}/docs/guides/troubleshooting.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/migration/_meta.json | 0 .../{13.x-alpha => 13.x-next}/docs/migration/jest-matchers.mdx | 0 .../{13.x-alpha => 13.x-next}/docs/migration/previous/_meta.json | 0 .../{13.x-alpha => 13.x-next}/docs/migration/previous/v11.mdx | 0 .../docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v2.mdx | 0 .../docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v7.mdx | 0 .../docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v9.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/migration/v12.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/docs/start/_meta.json | 0 website/docs/{13.x-alpha => 13.x-next}/docs/start/intro.md | 0 website/docs/{13.x-alpha => 13.x-next}/docs/start/quick-start.mdx | 0 website/docs/{13.x-alpha => 13.x-next}/index.md | 0 46 files changed, 0 insertions(+), 0 deletions(-) rename website/docs/{13.x-alpha => 13.x-next}/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/advanced/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/advanced/network-requests.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/basics/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/basics/async-tests.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/basics/custom-render.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/index.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/state-management/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/cookbook/state-management/jotai.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/advanced/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/advanced/testing-env.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/advanced/understanding-act.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/events/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/events/fire-event.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/events/user-event.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/jest-matchers.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/accessibility.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/async.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/config.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/other.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/misc/render-hook.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/queries.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/render.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/api/screen.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/guides/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/guides/community-resources.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/guides/faq.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/guides/how-to-query.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/guides/troubleshooting.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/jest-matchers.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/previous/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v11.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v2.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v7.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/previous/v9.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/migration/v12.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/start/_meta.json (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/start/intro.md (100%) rename website/docs/{13.x-alpha => 13.x-next}/docs/start/quick-start.mdx (100%) rename website/docs/{13.x-alpha => 13.x-next}/index.md (100%) diff --git a/website/docs/13.x-alpha/_meta.json b/website/docs/13.x-next/_meta.json similarity index 100% rename from website/docs/13.x-alpha/_meta.json rename to website/docs/13.x-next/_meta.json diff --git a/website/docs/13.x-alpha/cookbook/_meta.json b/website/docs/13.x-next/cookbook/_meta.json similarity index 100% rename from website/docs/13.x-alpha/cookbook/_meta.json rename to website/docs/13.x-next/cookbook/_meta.json diff --git a/website/docs/13.x-alpha/cookbook/advanced/_meta.json b/website/docs/13.x-next/cookbook/advanced/_meta.json similarity index 100% rename from website/docs/13.x-alpha/cookbook/advanced/_meta.json rename to website/docs/13.x-next/cookbook/advanced/_meta.json diff --git a/website/docs/13.x-alpha/cookbook/advanced/network-requests.md b/website/docs/13.x-next/cookbook/advanced/network-requests.md similarity index 100% rename from website/docs/13.x-alpha/cookbook/advanced/network-requests.md rename to website/docs/13.x-next/cookbook/advanced/network-requests.md diff --git a/website/docs/13.x-alpha/cookbook/basics/_meta.json b/website/docs/13.x-next/cookbook/basics/_meta.json similarity index 100% rename from website/docs/13.x-alpha/cookbook/basics/_meta.json rename to website/docs/13.x-next/cookbook/basics/_meta.json diff --git a/website/docs/13.x-alpha/cookbook/basics/async-tests.md b/website/docs/13.x-next/cookbook/basics/async-tests.md similarity index 100% rename from website/docs/13.x-alpha/cookbook/basics/async-tests.md rename to website/docs/13.x-next/cookbook/basics/async-tests.md diff --git a/website/docs/13.x-alpha/cookbook/basics/custom-render.md b/website/docs/13.x-next/cookbook/basics/custom-render.md similarity index 100% rename from website/docs/13.x-alpha/cookbook/basics/custom-render.md rename to website/docs/13.x-next/cookbook/basics/custom-render.md diff --git a/website/docs/13.x-alpha/cookbook/index.md b/website/docs/13.x-next/cookbook/index.md similarity index 100% rename from website/docs/13.x-alpha/cookbook/index.md rename to website/docs/13.x-next/cookbook/index.md diff --git a/website/docs/13.x-alpha/cookbook/state-management/_meta.json b/website/docs/13.x-next/cookbook/state-management/_meta.json similarity index 100% rename from website/docs/13.x-alpha/cookbook/state-management/_meta.json rename to website/docs/13.x-next/cookbook/state-management/_meta.json diff --git a/website/docs/13.x-alpha/cookbook/state-management/jotai.md b/website/docs/13.x-next/cookbook/state-management/jotai.md similarity index 100% rename from website/docs/13.x-alpha/cookbook/state-management/jotai.md rename to website/docs/13.x-next/cookbook/state-management/jotai.md diff --git a/website/docs/13.x-alpha/docs/_meta.json b/website/docs/13.x-next/docs/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/_meta.json rename to website/docs/13.x-next/docs/_meta.json diff --git a/website/docs/13.x-alpha/docs/advanced/_meta.json b/website/docs/13.x-next/docs/advanced/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/advanced/_meta.json rename to website/docs/13.x-next/docs/advanced/_meta.json diff --git a/website/docs/13.x-alpha/docs/advanced/testing-env.mdx b/website/docs/13.x-next/docs/advanced/testing-env.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/advanced/testing-env.mdx rename to website/docs/13.x-next/docs/advanced/testing-env.mdx diff --git a/website/docs/13.x-alpha/docs/advanced/understanding-act.mdx b/website/docs/13.x-next/docs/advanced/understanding-act.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/advanced/understanding-act.mdx rename to website/docs/13.x-next/docs/advanced/understanding-act.mdx diff --git a/website/docs/13.x-alpha/docs/api.md b/website/docs/13.x-next/docs/api.md similarity index 100% rename from website/docs/13.x-alpha/docs/api.md rename to website/docs/13.x-next/docs/api.md diff --git a/website/docs/13.x-alpha/docs/api/_meta.json b/website/docs/13.x-next/docs/api/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/api/_meta.json rename to website/docs/13.x-next/docs/api/_meta.json diff --git a/website/docs/13.x-alpha/docs/api/events/_meta.json b/website/docs/13.x-next/docs/api/events/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/api/events/_meta.json rename to website/docs/13.x-next/docs/api/events/_meta.json diff --git a/website/docs/13.x-alpha/docs/api/events/fire-event.mdx b/website/docs/13.x-next/docs/api/events/fire-event.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/events/fire-event.mdx rename to website/docs/13.x-next/docs/api/events/fire-event.mdx diff --git a/website/docs/13.x-alpha/docs/api/events/user-event.mdx b/website/docs/13.x-next/docs/api/events/user-event.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/events/user-event.mdx rename to website/docs/13.x-next/docs/api/events/user-event.mdx diff --git a/website/docs/13.x-alpha/docs/api/jest-matchers.mdx b/website/docs/13.x-next/docs/api/jest-matchers.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/jest-matchers.mdx rename to website/docs/13.x-next/docs/api/jest-matchers.mdx diff --git a/website/docs/13.x-alpha/docs/api/misc/_meta.json b/website/docs/13.x-next/docs/api/misc/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/api/misc/_meta.json rename to website/docs/13.x-next/docs/api/misc/_meta.json diff --git a/website/docs/13.x-alpha/docs/api/misc/accessibility.mdx b/website/docs/13.x-next/docs/api/misc/accessibility.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/misc/accessibility.mdx rename to website/docs/13.x-next/docs/api/misc/accessibility.mdx diff --git a/website/docs/13.x-alpha/docs/api/misc/async.mdx b/website/docs/13.x-next/docs/api/misc/async.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/misc/async.mdx rename to website/docs/13.x-next/docs/api/misc/async.mdx diff --git a/website/docs/13.x-alpha/docs/api/misc/config.mdx b/website/docs/13.x-next/docs/api/misc/config.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/misc/config.mdx rename to website/docs/13.x-next/docs/api/misc/config.mdx diff --git a/website/docs/13.x-alpha/docs/api/misc/other.mdx b/website/docs/13.x-next/docs/api/misc/other.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/misc/other.mdx rename to website/docs/13.x-next/docs/api/misc/other.mdx diff --git a/website/docs/13.x-alpha/docs/api/misc/render-hook.mdx b/website/docs/13.x-next/docs/api/misc/render-hook.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/misc/render-hook.mdx rename to website/docs/13.x-next/docs/api/misc/render-hook.mdx diff --git a/website/docs/13.x-alpha/docs/api/queries.mdx b/website/docs/13.x-next/docs/api/queries.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/queries.mdx rename to website/docs/13.x-next/docs/api/queries.mdx diff --git a/website/docs/13.x-alpha/docs/api/render.mdx b/website/docs/13.x-next/docs/api/render.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/render.mdx rename to website/docs/13.x-next/docs/api/render.mdx diff --git a/website/docs/13.x-alpha/docs/api/screen.mdx b/website/docs/13.x-next/docs/api/screen.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/api/screen.mdx rename to website/docs/13.x-next/docs/api/screen.mdx diff --git a/website/docs/13.x-alpha/docs/guides/_meta.json b/website/docs/13.x-next/docs/guides/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/guides/_meta.json rename to website/docs/13.x-next/docs/guides/_meta.json diff --git a/website/docs/13.x-alpha/docs/guides/community-resources.mdx b/website/docs/13.x-next/docs/guides/community-resources.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/guides/community-resources.mdx rename to website/docs/13.x-next/docs/guides/community-resources.mdx diff --git a/website/docs/13.x-alpha/docs/guides/faq.mdx b/website/docs/13.x-next/docs/guides/faq.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/guides/faq.mdx rename to website/docs/13.x-next/docs/guides/faq.mdx diff --git a/website/docs/13.x-alpha/docs/guides/how-to-query.mdx b/website/docs/13.x-next/docs/guides/how-to-query.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/guides/how-to-query.mdx rename to website/docs/13.x-next/docs/guides/how-to-query.mdx diff --git a/website/docs/13.x-alpha/docs/guides/troubleshooting.mdx b/website/docs/13.x-next/docs/guides/troubleshooting.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/guides/troubleshooting.mdx rename to website/docs/13.x-next/docs/guides/troubleshooting.mdx diff --git a/website/docs/13.x-alpha/docs/migration/_meta.json b/website/docs/13.x-next/docs/migration/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/migration/_meta.json rename to website/docs/13.x-next/docs/migration/_meta.json diff --git a/website/docs/13.x-alpha/docs/migration/jest-matchers.mdx b/website/docs/13.x-next/docs/migration/jest-matchers.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/migration/jest-matchers.mdx rename to website/docs/13.x-next/docs/migration/jest-matchers.mdx diff --git a/website/docs/13.x-alpha/docs/migration/previous/_meta.json b/website/docs/13.x-next/docs/migration/previous/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/migration/previous/_meta.json rename to website/docs/13.x-next/docs/migration/previous/_meta.json diff --git a/website/docs/13.x-alpha/docs/migration/previous/v11.mdx b/website/docs/13.x-next/docs/migration/previous/v11.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/migration/previous/v11.mdx rename to website/docs/13.x-next/docs/migration/previous/v11.mdx diff --git a/website/docs/13.x-alpha/docs/migration/previous/v2.mdx b/website/docs/13.x-next/docs/migration/previous/v2.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/migration/previous/v2.mdx rename to website/docs/13.x-next/docs/migration/previous/v2.mdx diff --git a/website/docs/13.x-alpha/docs/migration/previous/v7.mdx b/website/docs/13.x-next/docs/migration/previous/v7.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/migration/previous/v7.mdx rename to website/docs/13.x-next/docs/migration/previous/v7.mdx diff --git a/website/docs/13.x-alpha/docs/migration/previous/v9.mdx b/website/docs/13.x-next/docs/migration/previous/v9.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/migration/previous/v9.mdx rename to website/docs/13.x-next/docs/migration/previous/v9.mdx diff --git a/website/docs/13.x-alpha/docs/migration/v12.mdx b/website/docs/13.x-next/docs/migration/v12.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/migration/v12.mdx rename to website/docs/13.x-next/docs/migration/v12.mdx diff --git a/website/docs/13.x-alpha/docs/start/_meta.json b/website/docs/13.x-next/docs/start/_meta.json similarity index 100% rename from website/docs/13.x-alpha/docs/start/_meta.json rename to website/docs/13.x-next/docs/start/_meta.json diff --git a/website/docs/13.x-alpha/docs/start/intro.md b/website/docs/13.x-next/docs/start/intro.md similarity index 100% rename from website/docs/13.x-alpha/docs/start/intro.md rename to website/docs/13.x-next/docs/start/intro.md diff --git a/website/docs/13.x-alpha/docs/start/quick-start.mdx b/website/docs/13.x-next/docs/start/quick-start.mdx similarity index 100% rename from website/docs/13.x-alpha/docs/start/quick-start.mdx rename to website/docs/13.x-next/docs/start/quick-start.mdx diff --git a/website/docs/13.x-alpha/index.md b/website/docs/13.x-next/index.md similarity index 100% rename from website/docs/13.x-alpha/index.md rename to website/docs/13.x-next/index.md From 82bd32532cba6c931f870945e5598d60882c6d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 21 Nov 2024 12:22:07 +0000 Subject: [PATCH 2/5] docs: v13 migration guide --- .../docs/13.x-next/docs/migration/_meta.json | 6 +- .../docs/migration/previous/_meta.json | 2 +- .../{ => previous}/jest-matchers.mdx | 0 .../docs/migration/{ => previous}/v12.mdx | 0 website/docs/13.x-next/docs/migration/v13.mdx | 122 ++++++++++++++++++ website/rspress.config.ts | 2 +- 6 files changed, 125 insertions(+), 7 deletions(-) rename website/docs/13.x-next/docs/migration/{ => previous}/jest-matchers.mdx (100%) rename website/docs/13.x-next/docs/migration/{ => previous}/v12.mdx (100%) create mode 100644 website/docs/13.x-next/docs/migration/v13.mdx diff --git a/website/docs/13.x-next/docs/migration/_meta.json b/website/docs/13.x-next/docs/migration/_meta.json index fdaff4905..b245d571a 100644 --- a/website/docs/13.x-next/docs/migration/_meta.json +++ b/website/docs/13.x-next/docs/migration/_meta.json @@ -1,5 +1 @@ -[ - "v12", - "jest-matchers", - { "type": "dir", "name": "previous", "label": "Previous versions", "collapsed": true } -] +["v13", { "type": "dir", "name": "previous", "label": "Previous versions", "collapsed": true }] diff --git a/website/docs/13.x-next/docs/migration/previous/_meta.json b/website/docs/13.x-next/docs/migration/previous/_meta.json index f34219315..f3951d2e3 100644 --- a/website/docs/13.x-next/docs/migration/previous/_meta.json +++ b/website/docs/13.x-next/docs/migration/previous/_meta.json @@ -1 +1 @@ -["v11", "v9", "v7", "v2"] +["v12", "jest-matchers", "v11", "v9", "v7", "v2"] diff --git a/website/docs/13.x-next/docs/migration/jest-matchers.mdx b/website/docs/13.x-next/docs/migration/previous/jest-matchers.mdx similarity index 100% rename from website/docs/13.x-next/docs/migration/jest-matchers.mdx rename to website/docs/13.x-next/docs/migration/previous/jest-matchers.mdx diff --git a/website/docs/13.x-next/docs/migration/v12.mdx b/website/docs/13.x-next/docs/migration/previous/v12.mdx similarity index 100% rename from website/docs/13.x-next/docs/migration/v12.mdx rename to website/docs/13.x-next/docs/migration/previous/v12.mdx diff --git a/website/docs/13.x-next/docs/migration/v13.mdx b/website/docs/13.x-next/docs/migration/v13.mdx new file mode 100644 index 000000000..8179b7daa --- /dev/null +++ b/website/docs/13.x-next/docs/migration/v13.mdx @@ -0,0 +1,122 @@ +# Migration to 13.x + +Migration to React Native Testing Library version 13 from version 12.x. + +Overall the v13 release is relatively small, focusing on removing deprecated queries and improving the developer experience. + +## Breaking changes + +### Supported React and React Native versions + +This version supports only React 18+ and corresponding React Native versions (0.71+). If you use React 16 or 17, please use latest of v12 versions. + +Note: at the moment there is no React Native for React 19, and React 19 is still in RC phase, so we test against React Native nightly builds. + +### Concurrent rendering by default + +This version introduces concurrent rendering by default. In general this should not be visible in regular tests, but it might affect your tests if you use React Suspense or similar. + +You can revert to legacy rendering by passing `concurrentRoot: false` to `render` or `configure` methods. + +Note: in React 19, concurrent rendering is the only supported rendering mode. + +### Extend Jest matchers by default + +You can remove `import '@testing-library/react-native/extend-expect'` imports, as now Jest matchers are extended by default when you import anything from `@testing-library/react-native`. + +You can avoid automatic extending of Jest matchers by importing `@testing-library/react-native/pure` instead. + +```tsx +// Remove this: +import '@testing-library/react-native/extend-expect'; +``` + +### Removed deprecated `*ByAccessibilityState` queries + +This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: + +- [`*ByRole`](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy` +- use built-in Jest matchers to check the state of element found using some other query: + - enabled state: [`toBeEnabled()` / `toBeDisabled()`](docs/api/jest-matchers#tobeenabled) + - checked state: [`toBeChecked()` / `toBePartiallyChecked()`](docs/api/jest-matchers#tobechecked) + - selected state: [`toBeSelected()`](docs/api/jest-matchers#tobeselected) + - expanded state: [`toBeExpanded()` / `toBeCollapsed()`](docs/api/jest-matchers#tobeexpanded) + - busy state: [`toBeBusy()`](docs/api/jest-matchers#tobebusy) + +```ts +// Replace this: +const view = screen.getByAccessibilityState({ disabled: true }); + +// with this (getByRole query): +const view = screen.getByRole('', { disabled: true }); + +// or this (Jest matcher): +const view = screen.getBy*(...); // Find the element using any query: *ByRole, *ByText, *ByTestId +expect(view).toBeDisabled(); // Assert its accessibility state +``` + +### Removed deprecated `*ByAccessibilityValue` queries + +This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: + +- [`toHaveAccessibilityValue()`](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query +- [`*ByRole`](#by-role) query with `value` option + +```ts +// Replace this: +const view = screen.getByAccessibilityValue({ now: 50, min: 0, max: 50 }); + +// with this (getByRole query): +const view = screen.getByRole('', { value: { now: 50, min: 0, max: 50 } }); + +// or this (Jest matcher): +const view = screen.getBy*(...); // Find the element using any query: *ByRole, *ByText, *ByTestId +expect(view).toHaveAccessibilityValue({ now: 50, min: 0, max: 50 }); // Assert its accessibility value +``` + +### Removed Jest preset + +RNTL Jest preset has been removed, so you should change you `jest.config.js` accordingly. + +Replace: + +```ts title=jest.config.js +// replace this: +preset: '@testing-library/react-native'; + +// with this: +preset: 'react-native'; +``` + +### Removed `debug.shallow` + +For a time being we didn't support shallow rendering. Now we are removing the last remains of it: `debug.shallow()`. If you are interested in shallow rendering see [here](docs/migration/previous/v2#removed-global-shallow-function). + +### Changes to accessibility label calculation + +Explicit labels: + +- `accessiblityLabelledBy` +- `accessiblityLabel` +- `aria-labelledby` +- `aria-label` + +now take strict priority over implicit labels derived from the text content of the element. + +## Other changes + +### Removed host component names autodetection + +This should not break any tests, additionally this should make RNTL tests run 10-20% faster. + +### Use React implementation of `act` instead of React Test Renderer one + +This should not break any tests. + +### Updated `flushMicroTasks` internal method + +This should not break any tests. + +## Full Changelog + +https://github.com/callstack/react-native-testing-library/compare/v12.5.2...v13.0.0-beta.0 diff --git a/website/rspress.config.ts b/website/rspress.config.ts index 842ac1874..dae1ff197 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -19,7 +19,7 @@ export default defineConfig({ }, multiVersion: { default: '12.x', - versions: ['12.x', '13.x-alpha'], + versions: ['12.x', '13.x-next'], }, route: { cleanUrls: true, From c5be431816bac65a303dc69bd6b17d449948de68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 21 Nov 2024 12:27:18 +0000 Subject: [PATCH 3/5] docs: tweaks --- website/docs/12.x/docs/api/misc/async.mdx | 4 +- website/docs/12.x/docs/api/misc/other.mdx | 2 +- .../docs/13.x-next/docs/api/misc/async.mdx | 18 +-- .../docs/13.x-next/docs/api/misc/other.mdx | 2 +- website/docs/13.x-next/docs/api/queries.mdx | 109 ------------------ website/docs/13.x-next/docs/migration/v13.mdx | 2 +- 6 files changed, 7 insertions(+), 130 deletions(-) diff --git a/website/docs/12.x/docs/api/misc/async.mdx b/website/docs/12.x/docs/api/misc/async.mdx index 5ae3cf1c8..5eb8fe310 100644 --- a/website/docs/12.x/docs/api/misc/async.mdx +++ b/website/docs/12.x/docs/api/misc/async.mdx @@ -101,7 +101,7 @@ In order to properly use `waitFor` you need at least React >=16.9.0 (featuring a ::: :::note -If you receive warnings related to `act()` function consult our [Undestanding Act](docs/advanced/understanding-act.md) function document. +If you receive warnings related to `act()` function consult our [Understanding Act](docs/advanced/understanding-act.md) function document. ::: ## `waitForElementToBeRemoved` @@ -134,5 +134,5 @@ In order to properly use `waitForElementToBeRemoved` you need at least React >=1 ::: :::note -If you receive warnings related to `act()` function consult our [Undestanding Act](docs/advanced/understanding-act.md) function document. +If you receive warnings related to `act()` function consult our [Understanding Act](docs/advanced/understanding-act.md) function document. ::: diff --git a/website/docs/12.x/docs/api/misc/other.mdx b/website/docs/12.x/docs/api/misc/other.mdx index 8132a8b90..8100981c3 100644 --- a/website/docs/12.x/docs/api/misc/other.mdx +++ b/website/docs/12.x/docs/api/misc/other.mdx @@ -31,7 +31,7 @@ Use cases for scoped queries include: Useful function to help testing components that use hooks API. By default any `render`, `update`, `fireEvent`, and `waitFor` calls are wrapped by this function, so there is no need to wrap it manually. This method is re-exported from [`react-test-renderer`](https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactTestRenderer.js#L567]). -Consult our [Undestanding Act function](docs/advanced/understanding-act.md) document for more understanding of its intricacies. +Consult our [Understanding Act function](docs/advanced/understanding-act.md) document for more understanding of its intricacies. ## `cleanup` diff --git a/website/docs/13.x-next/docs/api/misc/async.mdx b/website/docs/13.x-next/docs/api/misc/async.mdx index 5ae3cf1c8..4638ece49 100644 --- a/website/docs/13.x-next/docs/api/misc/async.mdx +++ b/website/docs/13.x-next/docs/api/misc/async.mdx @@ -53,12 +53,6 @@ Avoiding side effects in `expectation` callback can be partially enforced with t It is also recommended to have a [single assertion per each `waitFor`](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#having-multiple-assertions-in-a-single-waitfor-callback) for more consistency and faster failing tests. If you want to make several assertions, then they should be in seperate `waitFor` calls. In many cases you won't actually need to wrap the second assertion in `waitFor` since the first one will do the waiting required for asynchronous change to happen. -### Using a React Native version < 0.71 with Jest fake timers - -:::caution -When using a version of React Native < 0.71 and modern fake timers (the default for `Jest` >= 27), `waitFor` won't work (it will always timeout even if `expectation()` doesn't throw) unless you use the custom [@testing-library/react-native preset](https://github.com/callstack/react-native-testing-library#custom-jest-preset). -::: - `waitFor` checks whether Jest fake timers are enabled and adapts its behavior in such case. The following snippet is a simplified version of how it behaves when fake timers are enabled: ```tsx @@ -96,12 +90,8 @@ await waitFor(() => { }, 10000); ``` -:::info -In order to properly use `waitFor` you need at least React >=16.9.0 (featuring async `act`) or React Native >=0.61 (which comes with React >=16.9.0). -::: - :::note -If you receive warnings related to `act()` function consult our [Undestanding Act](docs/advanced/understanding-act.md) function document. +If you receive warnings related to `act()` function consult our [Understanding Act](docs/advanced/understanding-act.md) function document. ::: ## `waitForElementToBeRemoved` @@ -129,10 +119,6 @@ This method expects that the element is initially present in the render tree and You can use any of `getBy`, `getAllBy`, `queryBy` and `queryAllBy` queries for `expectation` parameter. -:::info -In order to properly use `waitForElementToBeRemoved` you need at least React >=16.9.0 (featuring async `act`) or React Native >=0.61 (which comes with React >=16.9.0). -::: - :::note -If you receive warnings related to `act()` function consult our [Undestanding Act](docs/advanced/understanding-act.md) function document. +If you receive warnings related to `act()` function consult our [Understanding Act](docs/advanced/understanding-act.md) function document. ::: diff --git a/website/docs/13.x-next/docs/api/misc/other.mdx b/website/docs/13.x-next/docs/api/misc/other.mdx index 8132a8b90..8100981c3 100644 --- a/website/docs/13.x-next/docs/api/misc/other.mdx +++ b/website/docs/13.x-next/docs/api/misc/other.mdx @@ -31,7 +31,7 @@ Use cases for scoped queries include: Useful function to help testing components that use hooks API. By default any `render`, `update`, `fireEvent`, and `waitFor` calls are wrapped by this function, so there is no need to wrap it manually. This method is re-exported from [`react-test-renderer`](https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactTestRenderer.js#L567]). -Consult our [Undestanding Act function](docs/advanced/understanding-act.md) document for more understanding of its intricacies. +Consult our [Understanding Act function](docs/advanced/understanding-act.md) document for more understanding of its intricacies. ## `cleanup` diff --git a/website/docs/13.x-next/docs/api/queries.mdx b/website/docs/13.x-next/docs/api/queries.mdx index 85df7e0ac..232ffab5f 100644 --- a/website/docs/13.x-next/docs/api/queries.mdx +++ b/website/docs/13.x-next/docs/api/queries.mdx @@ -383,115 +383,6 @@ const element = screen.getByTestId('unique-id'); In the spirit of [the guiding principles](https://testing-library.com/docs/guiding-principles), it is recommended to use this only after the other queries don't work for your use case. Using `testID` attributes do not resemble how your software is used and should be avoided if possible. However, they are particularly useful for end-to-end testing on real devices, e.g. using Detox and it's an encouraged technique to use there. Learn more from the blog post ["Making your UI tests resilient to change"](https://kentcdodds.com/blog/making-your-ui-tests-resilient-to-change). ::: -### `*ByA11yState`, `ByAccessibilityState` (deprecated) {#by-accessibility-state} - -:::caution -This query has been marked deprecated, as is typically too general to give meaningful results. Therefore, it's better to use one of following options: - -- [`*ByRole`](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy` -- use built-in Jest matchers to check the state of element found using some other query: - - enabled state: [`toBeEnabled()` / `toBeDisabled()`](docs/api/jest-matchers#tobeenabled) - - checked state: [`toBeChecked()` / `toBePartiallyChecked()`](docs/api/jest-matchers#tobechecked) - - selected state: [`toBeSelected()`](docs/api/jest-matchers#tobeselected) - - expanded state: [`toBeExpanded()` / `toBeCollapsed()`](docs/api/jest-matchers#tobeexpanded) - - busy state: [`toBeBusy()`](docs/api/jest-matchers#tobebusy) - -::: - -> getByA11yState, getAllByA11yState, queryByA11yState, queryAllByA11yState, findByA11yState, findAllByA11yState -> getByAccessibilityState, getAllByAccessibilityState, queryByAccessibilityState, queryAllByAccessibilityState, findByAccessibilityState, findAllByAccessibilityState - -```ts -getByA11yState( - state: { - disabled?: boolean, - selected?: boolean, - checked?: boolean | 'mixed', - busy?: boolean, - expanded?: boolean, - }, - options?: { - includeHiddenElements?: boolean; - }, -): ReactTestInstance; -``` - -Returns a `ReactTestInstance` with matching `accessibilityState` prop or ARIA state props: `aria-disabled`, `aria-selected`, `aria-checked`, `aria-busy`, and `aria-expanded`. - -```jsx -import { render, screen } from '@testing-library/react-native'; - -render(); -const element = screen.getByA11yState({ disabled: true }); -``` - -:::note - -#### Default state for: `disabled`, `selected`, and `busy` keys - -Passing `false` matcher value will match both elements with explicit `false` state value and without explicit state value. - -For instance, `getByA11yState({ disabled: false })` will match elements with following props: - -- `accessibilityState={{ disabled: false, ... }}` -- no `disabled` key under `accessibilityState` prop, e.g. `accessibilityState={{}}` -- no `accessibilityState` prop at all - -#### Default state for: `checked` and `expanded` keys - -Passing `false` matcher value will only match elements with explicit `false` state value. - -For instance, `getByA11yState({ checked: false })` will only match elements with: - -- `accessibilityState={{ checked: false, ... }}` - -but will not match elements with following props: - -- no `checked` key under `accessibilityState` prop, e.g. `accessibilityState={{}}` -- no `accessibilityState` prop at all - -The difference in handling default values is made to reflect observed accessibility behaviour on iOS and Android platforms. -::: - -### `*ByA11yValue`, `*ByAccessibilityValue` (deprecated) {#by-accessibility-value} - -:::caution -This query has been marked deprecated, as is typically too general to give meaningful results. Therefore, it's better to use one of following options: - -- [`toHaveAccessibilityValue()`](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query -- [`*ByRole`](#by-role) query with `value` option - -::: - -> getByA11yValue, getAllByA11yValue, queryByA11yValue, queryAllByA11yValue, findByA11yValue, findAllByA11yValue -> getByAccessibilityValue, getAllByAccessibilityValue, queryByAccessibilityValue, queryAllByAccessibilityValue, findByAccessibilityValue, findAllByAccessibilityValue - -```ts -getByA11yValue( - value: { - min?: number; - max?: number; - now?: number; - text?: TextMatch; - }, - options?: { - includeHiddenElements?: boolean; - }, -): ReactTestInstance; -``` - -Returns a host element with matching accessibility value based on `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, `aria-valuetext` & `accessibilityValue` props. Only value entires provided to the query will be used to match elements. Element might have additional accessibility value entries and still be matched. - -When querying by `text` entry a string or regex might be used. - -```jsx -import { render, screen } from '@testing-library/react-native'; - -render(); -const element = screen.getByA11yValue({ now: 25 }); -const element2 = screen.getByA11yValue({ text: /25/ }); -``` - ### Common options Usually query first argument can be a **string** or a **regex**. All queries take at least the [`hidden`](#hidden-option) option as an optionnal second argument and some queries accept more options which change string matching behaviour. See [TextMatch](#textmatch) for more info. diff --git a/website/docs/13.x-next/docs/migration/v13.mdx b/website/docs/13.x-next/docs/migration/v13.mdx index 8179b7daa..efc1ce1e2 100644 --- a/website/docs/13.x-next/docs/migration/v13.mdx +++ b/website/docs/13.x-next/docs/migration/v13.mdx @@ -26,7 +26,7 @@ You can remove `import '@testing-library/react-native/extend-expect'` imports, a You can avoid automatic extending of Jest matchers by importing `@testing-library/react-native/pure` instead. -```tsx +```tsx title=jest-setup.ts // Remove this: import '@testing-library/react-native/extend-expect'; ``` From 796cda2c01b9402f47be61b39877b9b220acf979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 21 Nov 2024 12:34:12 +0000 Subject: [PATCH 4/5] docs: tweaks --- website/docs/12.x/docs/api/misc/config.mdx | 2 +- website/docs/12.x/docs/api/render.mdx | 2 +- .../docs/13.x-next/docs/api/misc/config.mdx | 2 +- website/docs/13.x-next/docs/api/render.mdx | 2 +- website/docs/13.x-next/docs/migration/v13.mdx | 20 +++++++++---------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/website/docs/12.x/docs/api/misc/config.mdx b/website/docs/12.x/docs/api/misc/config.mdx index bdaabd107..fb54d8ac0 100644 --- a/website/docs/12.x/docs/api/misc/config.mdx +++ b/website/docs/12.x/docs/api/misc/config.mdx @@ -27,7 +27,7 @@ This option is also available as `defaultHidden` alias for compatibility with [R Default [debug options](#debug) to be used when calling `debug()`. These default options will be overridden by the ones you specify directly when calling `debug()`. -### `concurrentRoot` option +### `concurrentRoot` option {#concurrent-root} Set to `true` to enable concurrent rendering used in the React Native New Architecture. Otherwise `render` will default to legacy synchronous rendering. diff --git a/website/docs/12.x/docs/api/render.mdx b/website/docs/12.x/docs/api/render.mdx index ee38878ff..eb6cdc9f2 100644 --- a/website/docs/12.x/docs/api/render.mdx +++ b/website/docs/12.x/docs/api/render.mdx @@ -32,7 +32,7 @@ wrapper?: React.ComponentType, This option allows you to wrap the tested component, passed as the first option to the `render()` function, in an additional wrapper component. This is useful for creating reusable custom render functions for common React Context providers. -#### `concurrentRoot` option +#### `concurrentRoot` option {#concurrent-root} Set to `true` to enable concurrent rendering used in the React Native New Architecture. Otherwise `render` will default to legacy synchronous rendering. diff --git a/website/docs/13.x-next/docs/api/misc/config.mdx b/website/docs/13.x-next/docs/api/misc/config.mdx index f08def6c5..b8566c66f 100644 --- a/website/docs/13.x-next/docs/api/misc/config.mdx +++ b/website/docs/13.x-next/docs/api/misc/config.mdx @@ -27,7 +27,7 @@ This option is also available as `defaultHidden` alias for compatibility with [R Default [debug options](#debug) to be used when calling `debug()`. These default options will be overridden by the ones you specify directly when calling `debug()`. -### `concurrentRoot` option +### `concurrentRoot` option {#concurrent-root} Set to `false` to disable concurrent rendering. Otherwise, `render` will default to using concurrent rendering used in the React Native New Architecture. diff --git a/website/docs/13.x-next/docs/api/render.mdx b/website/docs/13.x-next/docs/api/render.mdx index 1d0e45b82..f97ed2e14 100644 --- a/website/docs/13.x-next/docs/api/render.mdx +++ b/website/docs/13.x-next/docs/api/render.mdx @@ -32,7 +32,7 @@ wrapper?: React.ComponentType, This option allows you to wrap the tested component, passed as the first option to the `render()` function, in an additional wrapper component. This is useful for creating reusable custom render functions for common React Context providers. -#### `concurrentRoot` option +#### `concurrentRoot` option {#concurrent-root} Set to `false` to disable concurrent rendering. Otherwise, `render` will default to using concurrent rendering used in the React Native New Architecture. diff --git a/website/docs/13.x-next/docs/migration/v13.mdx b/website/docs/13.x-next/docs/migration/v13.mdx index efc1ce1e2..7d6b7e8ee 100644 --- a/website/docs/13.x-next/docs/migration/v13.mdx +++ b/website/docs/13.x-next/docs/migration/v13.mdx @@ -16,7 +16,7 @@ Note: at the moment there is no React Native for React 19, and React 19 is still This version introduces concurrent rendering by default. In general this should not be visible in regular tests, but it might affect your tests if you use React Suspense or similar. -You can revert to legacy rendering by passing `concurrentRoot: false` to `render` or `configure` methods. +You can revert to legacy rendering by passing `concurrentRoot: false` to [render](docs/api/render#concurrent-root) or [configure](docs/api/misc/config#concurrent-root) methods. Note: in React 19, concurrent rendering is the only supported rendering mode. @@ -35,13 +35,13 @@ import '@testing-library/react-native/extend-expect'; This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: -- [`*ByRole`](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy` +- [\*ByRole](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy` - use built-in Jest matchers to check the state of element found using some other query: - - enabled state: [`toBeEnabled()` / `toBeDisabled()`](docs/api/jest-matchers#tobeenabled) - - checked state: [`toBeChecked()` / `toBePartiallyChecked()`](docs/api/jest-matchers#tobechecked) - - selected state: [`toBeSelected()`](docs/api/jest-matchers#tobeselected) - - expanded state: [`toBeExpanded()` / `toBeCollapsed()`](docs/api/jest-matchers#tobeexpanded) - - busy state: [`toBeBusy()`](docs/api/jest-matchers#tobebusy) + - enabled state: [toBeEnabled() / toBeDisabled()](docs/api/jest-matchers#tobeenabled) + - checked state: [toBeChecked() / toBePartiallyChecked()](docs/api/jest-matchers#tobechecked) + - selected state: [toBeSelected()](docs/api/jest-matchers#tobeselected) + - expanded state: [toBeExpanded() / toBeCollapsed()](docs/api/jest-matchers#tobeexpanded) + - busy state: [toBeBusy()](docs/api/jest-matchers#tobebusy) ```ts // Replace this: @@ -59,8 +59,8 @@ expect(view).toBeDisabled(); // Assert its accessibility state This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: -- [`toHaveAccessibilityValue()`](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query -- [`*ByRole`](#by-role) query with `value` option +- [toHaveAccessibilityValue()](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query +- [\*ByRole](#by-role) query with `value` option ```ts // Replace this: @@ -119,4 +119,4 @@ This should not break any tests. ## Full Changelog -https://github.com/callstack/react-native-testing-library/compare/v12.5.2...v13.0.0-beta.0 +https://github.com/callstack/react-native-testing-library/compare/v12.8.1...v13.0.0-beta.0 From 8ee1657432fece939f3cecb73ca673bd9613ba20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 21 Nov 2024 12:42:37 +0000 Subject: [PATCH 5/5] chore: grammar --- website/docs/13.x-next/docs/migration/v13.mdx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/website/docs/13.x-next/docs/migration/v13.mdx b/website/docs/13.x-next/docs/migration/v13.mdx index 7d6b7e8ee..ad73e551c 100644 --- a/website/docs/13.x-next/docs/migration/v13.mdx +++ b/website/docs/13.x-next/docs/migration/v13.mdx @@ -1,20 +1,20 @@ # Migration to 13.x -Migration to React Native Testing Library version 13 from version 12.x. +This guide describes the migration to React Native Testing Library version 13 from version 12.x. -Overall the v13 release is relatively small, focusing on removing deprecated queries and improving the developer experience. +Overall, the v13 release is relatively small, focusing on removing deprecated queries and improving the developer experience. ## Breaking changes ### Supported React and React Native versions -This version supports only React 18+ and corresponding React Native versions (0.71+). If you use React 16 or 17, please use latest of v12 versions. +This version supports only React 18+ and corresponding React Native versions (0.71+). If you use React 16 or 17, please use the latest of v12 versions. -Note: at the moment there is no React Native for React 19, and React 19 is still in RC phase, so we test against React Native nightly builds. +Note: currently, stable React Native is unavailable for React 19, which is still in the RC phase, so we test against React Native nightly builds. ### Concurrent rendering by default -This version introduces concurrent rendering by default. In general this should not be visible in regular tests, but it might affect your tests if you use React Suspense or similar. +This version introduces concurrent rendering by default. This change should not affect regular tests, but it might affect your tests if you use React Suspense or similar. You can revert to legacy rendering by passing `concurrentRoot: false` to [render](docs/api/render#concurrent-root) or [configure](docs/api/misc/config#concurrent-root) methods. @@ -24,7 +24,7 @@ Note: in React 19, concurrent rendering is the only supported rendering mode. You can remove `import '@testing-library/react-native/extend-expect'` imports, as now Jest matchers are extended by default when you import anything from `@testing-library/react-native`. -You can avoid automatic extending of Jest matchers by importing `@testing-library/react-native/pure` instead. +You can avoid the automatic extending of Jest matchers by importing `@testing-library/react-native/pure` instead. ```tsx title=jest-setup.ts // Remove this: @@ -33,7 +33,7 @@ import '@testing-library/react-native/extend-expect'; ### Removed deprecated `*ByAccessibilityState` queries -This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: +We have removed this deprecated query as it is typically too general to give meaningful results. Use one of the following options: - [\*ByRole](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy` - use built-in Jest matchers to check the state of element found using some other query: @@ -57,7 +57,7 @@ expect(view).toBeDisabled(); // Assert its accessibility state ### Removed deprecated `*ByAccessibilityValue` queries -This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: +We have removed this deprecated query as it is typically too general to give meaningful results. Use one of the following options: - [toHaveAccessibilityValue()](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query - [\*ByRole](#by-role) query with `value` option @@ -76,7 +76,7 @@ expect(view).toHaveAccessibilityValue({ now: 50, min: 0, max: 50 }); // Assert i ### Removed Jest preset -RNTL Jest preset has been removed, so you should change you `jest.config.js` accordingly. +We have removed RNTL Jest preset, so you should change you `jest.config.js` accordingly. Replace: @@ -90,7 +90,7 @@ preset: 'react-native'; ### Removed `debug.shallow` -For a time being we didn't support shallow rendering. Now we are removing the last remains of it: `debug.shallow()`. If you are interested in shallow rendering see [here](docs/migration/previous/v2#removed-global-shallow-function). +We didn't support shallow rendering for the time being. Now, we are removing the last remains of it: `debug.shallow()`. If you are interested in shallow rendering see [here](docs/migration/previous/v2#removed-global-shallow-function). ### Changes to accessibility label calculation @@ -101,21 +101,21 @@ Explicit labels: - `aria-labelledby` - `aria-label` -now take strict priority over implicit labels derived from the text content of the element. +now take strict priority over implicit labels derived from the element's text content. ## Other changes ### Removed host component names autodetection -This should not break any tests, additionally this should make RNTL tests run 10-20% faster. +This change should not break any tests, it should also make RNTL tests run 10-20% faster. ### Use React implementation of `act` instead of React Test Renderer one -This should not break any tests. +This change should not break any tests. ### Updated `flushMicroTasks` internal method -This should not break any tests. +This change should not break any tests. ## Full Changelog