Skip to content

Commit a7fa320

Browse files
docs: default to v14 (#1916)
1 parent e53adb1 commit a7fa320

5 files changed

Lines changed: 17 additions & 47 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ React Native Testing Library consists of following APIs:
9494

9595
## Migration Guides
9696

97-
- **[Migration to 14.0](https://oss.callstack.com/react-native-testing-library/docs/migration/v14)** - Drops React 18, async APIs by default
97+
- **[Migration to 14.0](https://oss.callstack.com/react-native-testing-library/docs/start/migration-v14)** - Drops React 18, async APIs by default
9898

9999
## Troubleshooting
100100

docs/guides/quick-start.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Open a Terminal in your project's folder and run:
88

99
<PackageManagerTabs
1010
command={{
11-
npm: 'npm install -D @testing-library/react-native@next',
12-
yarn: 'yarn add -D @testing-library/react-native@next',
13-
pnpm: 'pnpm add -D @testing-library/react-native@next',
14-
bun: 'bun add -D @testing-library/react-native@next',
11+
npm: 'npm install -D @testing-library/react-native',
12+
yarn: 'yarn add -D @testing-library/react-native',
13+
pnpm: 'pnpm add -D @testing-library/react-native',
14+
bun: 'bun add -D @testing-library/react-native',
1515
}}
1616
/>
1717

website/docs/14.x/docs/start/quick-start.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Open a Terminal in your project's folder and run:
88

99
<PackageManagerTabs
1010
command={{
11-
npm: 'npm install -D @testing-library/react-native@next',
12-
yarn: 'yarn add -D @testing-library/react-native@next',
13-
pnpm: 'pnpm add -D @testing-library/react-native@next',
14-
bun: 'bun add -D @testing-library/react-native@next',
11+
npm: 'npm install -D @testing-library/react-native',
12+
yarn: 'yarn add -D @testing-library/react-native',
13+
pnpm: 'pnpm add -D @testing-library/react-native',
14+
bun: 'bun add -D @testing-library/react-native',
1515
}}
1616
/>
1717

website/rspress.config.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,15 @@ const sidebar14x = {
208208
],
209209
};
210210

211-
// Default version (13.x) sidebar without version prefix
211+
// Default version (14.x) sidebar without version prefix
212212
const sidebarDefault = {
213213
'/docs/': [
214214
{
215215
text: 'Getting started',
216216
items: [
217217
{ text: 'Introduction', link: '/docs/start/intro' },
218218
{ text: 'Quick Start', link: '/docs/start/quick-start' },
219+
{ text: 'v14 Migration', link: '/docs/start/migration-v14' },
219220
],
220221
},
221222
{
@@ -250,7 +251,6 @@ const sidebarDefault = {
250251
{ text: 'How to Query', link: '/docs/guides/how-to-query' },
251252
{ text: 'Common Mistakes', link: '/docs/guides/common-mistakes' },
252253
{ text: 'LLM Guidelines', link: '/docs/guides/llm-guidelines' },
253-
{ text: 'React 19', link: '/docs/guides/react-19' },
254254
{ text: 'Troubleshooting', link: '/docs/guides/troubleshooting' },
255255
{ text: 'FAQ', link: '/docs/guides/faq' },
256256
{
@@ -270,32 +270,13 @@ const sidebarDefault = {
270270
{ text: 'Understanding Act', link: '/docs/advanced/understanding-act' },
271271
],
272272
},
273-
{
274-
text: 'Migration Guides',
275-
collapsed: true,
276-
items: [
277-
{ text: 'v13 Migration', link: '/docs/migration/v13' },
278-
{ text: 'Jest Matchers', link: '/docs/migration/jest-matchers' },
279-
{
280-
text: 'Previous versions',
281-
collapsed: true,
282-
items: [
283-
{ text: 'v12', link: '/docs/migration/previous/v12' },
284-
{ text: 'v11', link: '/docs/migration/previous/v11' },
285-
{ text: 'v9', link: '/docs/migration/previous/v9' },
286-
{ text: 'v7', link: '/docs/migration/previous/v7' },
287-
{ text: 'v2', link: '/docs/migration/previous/v2' },
288-
],
289-
},
290-
],
291-
},
292273
],
293274
'/cookbook/': [
294275
{ text: 'Cookbook', link: '/cookbook/' },
295276
{
296277
text: 'Basic Recipes',
297278
items: [
298-
{ text: 'Async Tests', link: '/cookbook/basics/async-tests' },
279+
{ text: 'Async Events', link: '/cookbook/basics/async-events' },
299280
{ text: 'Custom Render', link: '/cookbook/basics/custom-render' },
300281
],
301282
},
@@ -332,7 +313,7 @@ export default defineConfig({
332313
// Shiki is now the default code highlighter
333314
},
334315
multiVersion: {
335-
default: '13.x',
316+
default: '14.x',
336317
versions: ['12.x', '13.x', '14.x'],
337318
},
338319
route: {

website/theme/index.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { useLocation } from '@rspress/core/runtime';
22
import { Link, Layout as RspressLayout } from '@rspress/core/theme-original';
33

4-
const LATEST_VERSION = '13.x';
5-
6-
const PreReleaseBanner = () => (
7-
<div className="pre-release-banner">
8-
<span>
9-
You are viewing documentation for <strong>v14 RC</strong>.
10-
</span>
11-
</div>
12-
);
4+
const LATEST_VERSION = '14.x';
135

146
const OldVersionBanner = ({ version }: { version: string }) => (
157
<div className="old-version-banner">
@@ -26,12 +18,9 @@ const OldVersionBanner = ({ version }: { version: string }) => (
2618
const AnnouncementBanner = () => {
2719
const { pathname } = useLocation();
2820

29-
if (pathname.includes('/14.x/')) {
30-
return <PreReleaseBanner />;
31-
}
32-
33-
if (pathname.includes('/12.x/')) {
34-
return <OldVersionBanner version="12.x" />;
21+
if (pathname.includes('/12.x/') || pathname.includes('/13.x/')) {
22+
const version = pathname.includes('/12.x/') ? '12.x' : '13.x';
23+
return <OldVersionBanner version={version} />;
3524
}
3625

3726
return null;

0 commit comments

Comments
 (0)