forked from react/react-native-website
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathversions.js
More file actions
140 lines (130 loc) · 4.59 KB
/
Copy pathversions.js
File metadata and controls
140 lines (130 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/**
* Copyright (c) Meta Platforms, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import Layout from '@theme/Layout';
import useBaseUrl from '@docusaurus/useBaseUrl';
const versions = require('../../versions.json');
const VersionItem = ({version, currentVersion}) => {
const versionName = version === 'next' ? 'Master' : version;
const isCurrentVersion = currentVersion === version;
const isNext = version === 'next';
const isRC = version.toUpperCase().indexOf('-RC') !== -1;
const latestMajorVersion = versions[0].toUpperCase().replace('-RC', '');
const documentationLink = (
<a
href={useBaseUrl(
'docs/' + (isCurrentVersion ? '' : version + '/') + 'getting-started'
)}>
Documentation
</a>
);
let releaseNotesURL = 'https://github.com/facebook/react-native/releases';
let releaseNotesTitle = 'Changelog';
if (isNext) {
releaseNotesURL = `https://github.com/facebook/react-native/compare/${latestMajorVersion}-stable...main`;
releaseNotesTitle = 'Commits since ' + latestMajorVersion;
} else if (!isRC) {
releaseNotesURL = `https://github.com/facebook/react-native/releases/tag/v${version}.0`;
}
const releaseNotesLink = <a href={releaseNotesURL}>{releaseNotesTitle}</a>;
return (
<tr>
<th>{versionName}</th>
<td>{documentationLink}</td>
<td>{releaseNotesLink}</td>
</tr>
);
};
const Versions = () => {
const currentVersion = versions.length > 0 ? versions[0] : null;
const latestVersions = ['next'].concat(
versions.filter(version => version.indexOf('-RC') !== -1)
);
const stableVersions = versions.filter(
version => version.indexOf('-RC') === -1 && version !== currentVersion
);
return (
<Layout title="Versions" wrapperClassName="versions-page">
<h1>React Native versions</h1>
<p>
Open source React Native releases follow a release train that is
coordinated on GitHub through the{' '}
<a
href={'https://github.com/reactwg/react-native-releases/discussions'}>
<code>react-native-releases</code>
</a>{' '}
repository. New releases are created off the <code>main</code> branch of{' '}
<a href={'https://github.com/facebook/react-native'}>
<code>facebook/react-native</code>
</a>
. They will follow a Release Candidate process to allow contributors
like yourself to{' '}
<a href={useBaseUrl('docs/upgrading')}>verify the changes</a> and to
identify any issues by{' '}
<a href="https://github.com/facebook/react-native/issues">
writing clear, actionable bug reports
</a>
. Eventually, the release candidate will be promoted to stable.
</p>
<h2>Next version (Unreleased)</h2>
<p>
To see what changes are coming and provide better feedback to React
Native contributors, use the latest release candidate when possible.
Changes introduced in a release candidate will have been shipped to
production Facebook apps for over two weeks by the time the release
candidate is cut.
</p>
<table className="versions">
<tbody>
{latestVersions.map(version => (
<VersionItem
key={'version_' + version}
version={version}
currentVersion={currentVersion}
/>
))}
</tbody>
</table>
<h2>Latest version</h2>
<p>
The most recent stable version will be used automatically whenever a new
project is created using the <code>npx react-native init</code> command.
</p>
<table className="versions">
<tbody>
<VersionItem
key={'version_' + currentVersion}
version={currentVersion}
currentVersion={currentVersion}
/>
</tbody>
</table>
<h2>Previous versions</h2>
<table className="versions">
<tbody>
{stableVersions.map(version => (
<VersionItem
key={'version_' + version}
version={version}
currentVersion={currentVersion}
/>
))}
</tbody>
</table>
<h2>Archived versions</h2>
<p>
The documentation for versions below <code>0.60</code> can be found on
the separate website called{' '}
<a href="https://archive.reactnative.dev/versions">
React Native Archive
</a>
.
</p>
</Layout>
);
};
export default Versions;