From d5096b264748df69f46f3fe09939bacb7b858529 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Thu, 3 Dec 2026 15:57:31 -0500 Subject: [PATCH 1/6] Add interactive Release Calendar page under /releases/schedule Signed-off-by: Peter Abbondanzo --- website/releases/schedule.mdx | 17 + website/sidebarsReleases.ts | 1 + .../ReleaseScheduleCalendar.module.css | 969 +++++++++ .../releases/ReleaseScheduleCalendar.tsx | 1807 +++++++++++++++++ .../components/releases/releaseSchedule.ts | 941 +++++++++ website/src/pages/versions.tsx | 1 + 6 files changed, 3736 insertions(+) create mode 100644 website/releases/schedule.mdx create mode 100644 website/src/components/releases/ReleaseScheduleCalendar.module.css create mode 100644 website/src/components/releases/ReleaseScheduleCalendar.tsx create mode 100644 website/src/components/releases/releaseSchedule.ts diff --git a/website/releases/schedule.mdx b/website/releases/schedule.mdx new file mode 100644 index 00000000000..66ffcb1f4c8 --- /dev/null +++ b/website/releases/schedule.mdx @@ -0,0 +1,17 @@ +--- +title: Release Calendar +sidebar_label: Release Calendar +hide_table_of_contents: true +--- + +import ReleaseScheduleCalendar from '@site/src/components/releases/ReleaseScheduleCalendar'; + +Explore projected React Native release dates, weekly release candidate milestones, and support windows for upcoming versions. For currently published versions and support definitions, see the [Releases Overview](/releases/overview). + + + +:::note + +Projected dates follow the standard React Native release cadence: branch cuts (`RC0`) on the **first Monday of every odd-numbered month**, followed by a **5-week RC stabilization window** (`RC4` as Golden RC) and support for the **latest 3 minor series**. Actual dates may shift for holidays or stabilization blockers. + +::: diff --git a/website/sidebarsReleases.ts b/website/sidebarsReleases.ts index 5ccef8a3cab..c30aeed47f8 100644 --- a/website/sidebarsReleases.ts +++ b/website/sidebarsReleases.ts @@ -3,6 +3,7 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; export default { releases: [ 'overview', + 'schedule', 'branches', 'versioning-policy', { diff --git a/website/src/components/releases/ReleaseScheduleCalendar.module.css b/website/src/components/releases/ReleaseScheduleCalendar.module.css new file mode 100644 index 00000000000..bea9000788a --- /dev/null +++ b/website/src/components/releases/ReleaseScheduleCalendar.module.css @@ -0,0 +1,969 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.root { + --rn-cal-dot-cut: #087ea4; + --rn-cal-dot-rc: #6f42c1; + --rn-cal-dot-golden: #d97706; + --rn-cal-dot-stable: #22863a; + --rn-cal-dot-patch: #0d9488; + --rn-cal-now: #d73a49; + + display: flex; + flex-direction: column; + gap: 1rem; + margin-bottom: 1.5rem; +} + +[data-theme="dark"] .root { + --rn-cal-dot-cut: #58c4dc; + --rn-cal-dot-rc: #a77cf7; + --rn-cal-dot-golden: #fb923c; + --rn-cal-dot-stable: #74e68f; + --rn-cal-dot-patch: #2dd4bf; + --rn-cal-now: #f46b78; +} + +.kpiGrid { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 0.75rem; +} + +.kpiBody { + display: flex; + flex-direction: column; + gap: 0.2rem; + padding: 0.75rem 1rem; +} + +.kpiLabel { + font-size: 0.78rem; + font-weight: 500; + color: var(--subtle); +} + +.kpiValue { + font-size: 1.05rem; + font-weight: 700; +} + +.kpiSub { + font-size: 0.78rem; + color: var(--subtle); +} + +.controlsRow { + display: flex; + flex-wrap: wrap; + align-items: flex-end; + gap: 0.75rem; +} + +.field { + display: flex; + flex-direction: column; + gap: 0.25rem; + min-width: 148px; +} + +.fieldLabel { + font-size: 0.78rem; + font-weight: 500; + color: var(--subtle); +} + +.selectWrap { + position: relative; + display: flex; + align-items: center; +} + +.selectCaret { + position: absolute; + right: 0.6rem; + width: 14px; + height: 14px; + color: var(--subtle); + pointer-events: none; +} + +.select, +.dateInput { + height: 36px; + width: 100%; + padding: 0 0.7rem; + border: 1px solid var(--ifm-color-emphasis-300); + border-radius: 6px; + background: var(--ifm-background-color); + color: var(--ifm-font-color-base); + font-family: inherit; + font-size: 0.85rem; +} + +.select { + appearance: none; + padding-right: 2.1rem; + cursor: pointer; +} + +[data-theme="dark"] .dateInput { + color-scheme: dark; +} + +.fieldInline { + display: flex; + align-items: center; + height: 36px; +} + +.checkboxLabel { + display: inline-flex; + align-items: center; + gap: 0.4rem; + font-size: 0.85rem; + cursor: pointer; + user-select: none; +} + +.spacer { + flex: 1 1 auto; +} + +.advancedPanel { + margin-top: 0.75rem; + padding-top: 0.75rem; + border-top: 1px solid var(--ifm-table-border-color); + display: flex; + flex-wrap: wrap; + align-items: flex-end; + gap: 0.75rem; +} + +.tabsHeader { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + margin-bottom: 0.85rem; + border-bottom: 1px solid var(--ifm-table-border-color); +} + +.tabsList { + display: flex; + flex-wrap: wrap; + align-items: stretch; + margin: 0; + padding: 0; +} + +.tabButton { + background: transparent; + border-top: 0; + border-right: 0; + border-left: 0; + font-family: inherit; + font-size: 0.9rem; + margin: 0; + line-height: 1.4; +} + +.syncBar { + display: inline-flex; + align-items: center; + gap: 0.45rem; + font-size: 0.8rem; + color: var(--subtle); + padding-bottom: 0.35rem; +} + +.syncDot { + width: 7px; + height: 7px; + border-radius: 999px; + display: inline-block; + background: var(--rn-cal-dot-stable); +} + +.syncDotPending { + background: var(--rn-cal-dot-golden); +} + +.syncDotOffline { + background: var(--subtle); +} + +.mono { + font-family: var(--ifm-font-family-monospace); + font-size: 0.84rem; +} + +.releaseRow { + cursor: pointer; +} + +.versionCell { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.versionStack { + display: flex; + flex-direction: column; + gap: 0.1rem; + line-height: 1.25; +} + +.chevron { + display: inline-flex; + align-items: center; + justify-content: center; + width: 14px; + height: 14px; + flex-shrink: 0; + color: var(--subtle); + transition: transform 0.15s ease; +} + +.chevronOpen { + transform: rotate(90deg); +} + +.externalIcon { + display: inline-block; + width: 12px; + height: 12px; + margin-left: 0.2rem; + vertical-align: -0.1em; + flex-shrink: 0; +} + +.navIcon { + display: block; + width: 14px; + height: 14px; +} + +.inlineLinks { + display: inline-flex; + align-items: center; + gap: 0.35rem; + font-size: 0.75rem; + font-weight: 400; + color: var(--subtle); +} + +.dateCellStack { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 0.25rem; +} + +.supportCellStack { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 0.2rem; +} + +.supportDates { + font-size: 0.74rem; + color: var(--subtle); + line-height: 1.3; +} + +.pill { + display: inline-flex; + align-items: center; + justify-content: center; + font-family: var(--ifm-font-family-base); + font-size: 0.74rem; + font-weight: 600; + line-height: 1.2; + padding: 0.2rem 0.55rem; + border-radius: 999px; + white-space: nowrap; + border: 1px solid transparent; + vertical-align: middle; +} + +.pillSuccess { + background: rgb(34 134 58 / 0.16); + color: #1b6b2e; + border-color: rgb(34 134 58 / 0.3); +} + +.pillInfo { + background: rgb(8 126 164 / 0.14); + color: #066382; + border-color: rgb(8 126 164 / 0.3); +} + +.pillPrimary { + background: rgb(111 66 193 / 0.14); + color: #5930a3; + border-color: rgb(111 66 193 / 0.3); +} + +.pillWarning { + background: rgb(217 119 6 / 0.15); + color: #9a4a00; + border-color: rgb(217 119 6 / 0.32); +} + +.pillDanger { + background: rgb(215 58 73 / 0.15); + color: #a41d2a; + border-color: rgb(215 58 73 / 0.32); +} + +.pillSecondary { + background: var(--ifm-table-head-background); + color: var(--ifm-font-color-base); + border-color: var(--ifm-table-border-color); +} + +[data-theme="dark"] .pillSuccess { + background: rgb(116 230 143 / 0.16); + color: #8df0a5; + border-color: rgb(116 230 143 / 0.3); +} + +[data-theme="dark"] .pillInfo { + background: rgb(88 196 220 / 0.16); + color: #7de0f5; + border-color: rgb(88 196 220 / 0.3); +} + +[data-theme="dark"] .pillPrimary { + background: rgb(167 124 247 / 0.18); + color: #c6abff; + border-color: rgb(167 124 247 / 0.35); +} + +[data-theme="dark"] .pillWarning { + background: rgb(251 146 60 / 0.18); + color: #fdba74; + border-color: rgb(251 146 60 / 0.35); +} + +[data-theme="dark"] .pillDanger { + background: rgb(244 107 120 / 0.18); + color: #fda4af; + border-color: rgb(244 107 120 / 0.35); +} + +[data-theme="dark"] .pillSecondary { + background: rgb(255 255 255 / 0.08); + color: var(--ifm-font-color-base); + border-color: var(--ifm-table-border-color); +} + +.infoPill { + cursor: help; +} + +.tooltip { + position: fixed; + z-index: 1000; + transform: translate(-50%, calc(-100% - 8px)); + padding: 0.35rem 0.6rem; + border-radius: 6px; + background: var(--deepdark); + color: #fff; + font-family: var(--ifm-font-family-base); + font-size: 0.75rem; + font-weight: 500; + line-height: 1.35; + max-width: 280px; + white-space: normal; + pointer-events: none; + box-shadow: 0 4px 12px rgb(0 0 0 / 0.25); +} + +.detailCell { + padding: 0; +} + +.detailInner { + white-space: normal; + font-weight: 400; + text-align: left; + padding: 0.85rem 1.1rem; + width: 100%; + display: flex; + flex-direction: column; + gap: 0.55rem; +} + +.detailInnerFlush { + padding: 0; +} + +.detailSummary { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + font-size: 0.8rem; + color: var(--subtle); +} + +.milestoneTimeline { + display: flex; + flex-direction: column; +} + +.milestoneRow { + display: grid; + grid-template-columns: 18px 156px 104px 116px minmax(0, 1fr); + align-items: center; + gap: 0.5rem; + padding: 0.42rem 0; + position: relative; +} + +.milestoneRow + .milestoneRow { + border-top: 1px solid var(--ifm-table-border-color); +} + +.milestoneRail { + position: relative; + display: flex; + align-items: center; + justify-content: center; + align-self: stretch; +} + +.milestoneRail:before { + content: ""; + position: absolute; + top: -0.45rem; + bottom: -0.45rem; + left: 50%; + width: 2px; + transform: translateX(-50%); + background: var(--ifm-table-border-color); +} + +.milestoneRow:first-child .milestoneRail:before { + top: 50%; +} + +.milestoneRow:last-child .milestoneRail:before { + bottom: 50%; +} + +.milestoneDot { + position: relative; + z-index: 1; + width: 9px; + height: 9px; + border-radius: 999px; +} + +.milestoneLabel { + font-size: 0.84rem; + font-weight: 600; + line-height: 1.3; +} + +.milestoneDate { + font-size: 0.82rem; + color: var(--ifm-font-color-base); + white-space: nowrap; +} + +.milestoneCode { + font-family: var(--ifm-font-family-monospace); + font-size: 0.76rem; + color: var(--subtle); + white-space: nowrap; +} + +.milestoneMeta { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.35rem; +} + +/* Calendar */ +.calToolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.75rem; + margin-bottom: 0.75rem; +} + +.calNav { + display: inline-flex; + flex-wrap: wrap; + align-items: center; + gap: 0.45rem; +} + +.calTitle { + font-size: 1rem; + font-weight: 700; + min-width: 140px; + text-align: center; +} + +.calFilters { + display: flex; + flex-wrap: wrap; + gap: 0.4rem; +} + +.filterChip { + display: inline-flex; + align-items: center; + gap: 0.35rem; +} + +.dot { + width: 8px; + height: 8px; + border-radius: 999px; + display: inline-block; + flex-shrink: 0; +} + +.dotCut { + background: var(--rn-cal-dot-cut); +} + +.dotRc { + background: var(--rn-cal-dot-rc); +} + +.dotGolden { + background: var(--rn-cal-dot-golden); +} + +.dotStable { + background: var(--rn-cal-dot-stable); +} + +.dotPatch { + background: var(--rn-cal-dot-patch); +} + +.monthGrid { + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); + border-top: 1px solid var(--ifm-table-border-color); + border-left: 1px solid var(--ifm-table-border-color); + border-radius: var(--ifm-global-radius); + overflow: hidden; +} + +.monthDow { + padding: 0.45rem; + font-size: 0.78rem; + font-weight: 600; + color: var(--subtle); + background: var(--ifm-table-head-background); + border-right: 1px solid var(--ifm-table-border-color); + border-bottom: 1px solid var(--ifm-table-border-color); + text-align: center; +} + +.dayCell { + min-height: 88px; + padding: 0.35rem; + border-right: 1px solid var(--ifm-table-border-color); + border-bottom: 1px solid var(--ifm-table-border-color); + display: flex; + flex-direction: column; + gap: 0.25rem; +} + +.dayOutside { + background: var(--ifm-table-head-background); + opacity: 0.6; +} + +.dayToday { + box-shadow: inset 0 0 0 2px var(--logo); +} + +.dayHeader { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 0.78rem; + font-weight: 600; +} + +.todayPip { + font-size: 0.68rem; + color: var(--logo); +} + +.evPill { + display: flex; + align-items: center; + gap: 0.25rem; + padding: 0.15rem 0.35rem; + border-radius: 4px; + border: 1px solid var(--ifm-table-border-color); + background: var(--ifm-table-head-background); + color: var(--ifm-font-color-base); + font-family: inherit; + font-size: 0.72rem; + font-weight: 500; + text-align: left; + width: 100%; + cursor: pointer; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.yearGrid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.75rem; +} + +.miniMonth { + border: 1px solid var(--ifm-table-border-color); + border-radius: var(--ifm-global-radius); + padding: 0.65rem; + display: flex; + flex-direction: column; + gap: 0.45rem; +} + +.miniMonthHeader { + display: flex; + justify-content: space-between; + align-items: center; +} + +.miniMonthTitle { + font-family: inherit; + font-weight: 600; + font-size: 0.88rem; + background: transparent; + border: 0; + padding: 0; + color: var(--ifm-font-color-base); + cursor: pointer; +} + +.miniGrid { + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); + gap: 2px; + text-align: center; + font-size: 0.72rem; +} + +.miniDow { + color: var(--subtle); + font-weight: 500; + padding-bottom: 2px; +} + +.miniDay { + height: 24px; + display: flex; + align-items: center; + justify-content: center; + padding: 0; + border: 1px solid transparent; + border-radius: 4px; + line-height: 1; + width: 100%; + box-sizing: border-box; +} + +.miniDayEmpty { + visibility: hidden; +} + +.miniDayToday { + box-shadow: inset 0 0 0 1.5px var(--logo); + font-weight: 700; +} + +.miniDayEv { + font-weight: 700; + cursor: pointer; + border-color: var(--ifm-table-border-color); + background: var(--ifm-table-head-background); + color: var(--ifm-font-color-base); + font-family: inherit; + font-size: inherit; +} + +.miniEvents { + display: flex; + flex-direction: column; + gap: 0.2rem; + padding-top: 0.35rem; + border-top: 1px solid var(--ifm-table-border-color); +} + +.miniEvRow { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.4rem; + font-family: inherit; + font-size: 0.72rem; + color: var(--ifm-font-color-base); + background: transparent; + border: 0; + padding: 0.15rem 0.25rem; + border-radius: 4px; + cursor: pointer; + width: 100%; + text-align: left; +} + +.miniEvRow:hover { + background: var(--ifm-table-head-background); +} + +.miniEvLeft { + display: inline-flex; + align-items: center; + gap: 0.35rem; + min-width: 0; +} + +.inspector { + margin-top: 0.85rem; + padding: 0.85rem 1rem; + border-radius: var(--ifm-global-radius); + background: var(--ifm-table-head-background); + border: 1px solid var(--ifm-table-border-color); +} + +.inspectorHeader { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + gap: 0.5rem; + margin-bottom: 0.75rem; +} + +.inspectorTitle { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.5rem; + font-size: 1rem; + font-weight: 700; + line-height: 1.2; +} + +/* Timeline */ +.timelineLegend { + display: flex; + flex-wrap: wrap; + gap: 0.85rem; + margin-bottom: 0.75rem; + font-size: 0.8rem; + color: var(--subtle); +} + +.legendItem { + display: inline-flex; + align-items: center; + gap: 0.35rem; +} + +.legendSwatch { + width: 12px; + height: 12px; + border-radius: 3px; + display: inline-block; +} + +.timelineContainer { + overflow-x: auto; + padding-bottom: 0.5rem; +} + +.timelineInner { + min-width: 640px; +} + +.timelineAxis { + display: grid; + grid-template-columns: 88px 1fr; + margin-bottom: 0.45rem; + border-bottom: 1px solid var(--ifm-table-border-color); + padding-bottom: 0.35rem; +} + +.timelineTicks { + position: relative; + height: 22px; +} + +.timelineTick { + position: absolute; + top: 0; + font-size: 0.72rem; + color: var(--subtle); + transform: translateX(-50%); + white-space: nowrap; +} + +.timelineRow { + display: grid; + grid-template-columns: 88px 1fr; + align-items: center; + height: 30px; + border-bottom: 1px solid var(--ifm-table-border-color); +} + +.timelineLabel { + font-family: var(--ifm-font-family-monospace); + font-size: 0.8rem; + font-weight: 600; + padding-right: 0.5rem; +} + +.timelineTrack { + position: relative; + height: 100%; +} + +.timelineSeg { + position: absolute; + top: 6px; + height: 18px; + border-radius: 4px; + font-size: 0.68rem; + font-weight: 600; + line-height: 18px; + padding: 0 0.35rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #fff; +} + +.segRc { + background: var(--rn-cal-dot-rc); +} + +.segActive { + background: var(--rn-cal-dot-stable); +} + +.segEoc { + background: var(--rn-cal-dot-golden); +} + +.timelineNow { + position: absolute; + top: 0; + bottom: 0; + width: 2px; + background: var(--rn-cal-now); + pointer-events: none; + z-index: 2; +} + +.timelineNowLabel { + position: absolute; + top: -2px; + transform: translateX(-50%); + background: var(--rn-cal-now); + color: #fff; + font-size: 0.68rem; + font-weight: 600; + padding: 1px 0.4rem; + border-radius: 4px; + white-space: nowrap; +} + +/* Export */ +.exportToolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.65rem; + margin-bottom: 0.75rem; +} + +.exportActions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.45rem; +} + +.exportOptions { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + margin-bottom: 0.75rem; + padding: 0.55rem 0.75rem; + background: var(--ifm-table-head-background); + border-radius: 6px; +} + +.exportPreview { + max-height: 420px; + overflow: auto; + margin: 0; +} + +@media (max-width: 996px) { + .kpiGrid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .yearGrid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } +} + +@media (max-width: 600px) { + .kpiGrid { + grid-template-columns: 1fr; + } + + .yearGrid { + grid-template-columns: 1fr; + } + + .field { + width: 100%; + } + + .dayCell { + min-height: 66px; + padding: 0.2rem; + } + + .milestoneRow { + grid-template-columns: 18px 1fr; + gap: 0.2rem 0.55rem; + } + + .milestoneRail { + grid-row: 1 / span 3; + } +} diff --git a/website/src/components/releases/ReleaseScheduleCalendar.tsx b/website/src/components/releases/ReleaseScheduleCalendar.tsx new file mode 100644 index 00000000000..80367d2c204 --- /dev/null +++ b/website/src/components/releases/ReleaseScheduleCalendar.tsx @@ -0,0 +1,1807 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import Link from '@docusaurus/Link'; +import { + Fragment, + useEffect, + useMemo, + useRef, + useState, + type ReactNode, +} from 'react'; + +import { + DOW_SHORT, + GITHUB_RELEASES_API_URL, + GITHUB_RELEASES_PAGE_URL, + MONTH_NAMES, + SSR_DEFAULT_AS_OF, + addDays, + buildCSV, + buildICS, + buildJSON, + buildOverviewMarkdown, + buildRcMarkdown, + buildReleaseSchedule, + diffDays, + formatPrettyDate, + formatShortDate, + getLocalTodayISO, + parseGitHubReleases, + parseISO, + type BreakingCadenceMode, + type GitHubReleaseApiItem, + type GitHubSeriesData, + type IcsOptions, + type MilestoneKind, + type ReleaseMilestone, + type ScheduleResult, + type ScheduledRelease, + type VersioningMode, +} from './releaseSchedule'; +import styles from './ReleaseScheduleCalendar.module.css'; + +type ActiveTab = 'schedule' | 'calendar' | 'timeline' | 'export'; +type CalendarMode = 'year' | 'month'; +type ExportFormat = 'overview-md' | 'rc-md' | 'ics' | 'csv' | 'json'; +type GitHubSyncState = 'idle' | 'loading' | 'synced' | 'error'; + +interface CalendarEvent { + version: string; + kind: MilestoneKind; + label: string; + code: string; + date: string; +} + +export interface ReleaseScheduleCalendarProps { + /** Initial number of future releases to project (default: 6). */ + defaultFutureCount?: number; + /** Whether to show published historical releases on load (default: true). */ + defaultShowHistory?: boolean; +} + +const GITHUB_CACHE_KEY = 'rn-release-schedule-gh-v1'; +const GITHUB_CACHE_TTL_MS = 15 * 60 * 1000; + +function pillVariantClass( + variant: 'success' | 'info' | 'primary' | 'warning' | 'danger' | 'secondary' +): string { + switch (variant) { + case 'success': + return styles.pillSuccess; + case 'info': + return styles.pillInfo; + case 'primary': + return styles.pillPrimary; + case 'warning': + return styles.pillWarning; + case 'danger': + return styles.pillDanger; + case 'secondary': + return styles.pillSecondary; + } +} + +function supportBadge(r: ScheduledRelease): ReactNode { + if (r.support === 'Future') { + if (r.inRC) { + return ( + + Future · In RC + + ); + } + return Future; + } + if (r.support === 'Active') { + return ( + + {r.isLatestStable ? 'Active · Latest' : 'Active'} + + ); + } + if (r.support === 'End of Cycle') { + return ( + + End of Cycle + + ); + } + return ( + + Unsupported + + ); +} + +function typeBadge(releaseType: string): ReactNode { + if (!releaseType) { + return null; + } + if (releaseType.startsWith('Major')) { + return ( + + {releaseType} + + ); + } + if (releaseType === 'Breaking') { + return ( + Breaking + ); + } + return ( + Non-breaking + ); +} + +function dotClassForKind(kind: MilestoneKind): string { + switch (kind) { + case 'cut': + return styles.dotCut; + case 'rc': + return styles.dotRc; + case 'golden': + return styles.dotGolden; + case 'stable': + return styles.dotStable; + case 'patch': + return styles.dotPatch; + } +} + +function eventShortLabel(ev: CalendarEvent): string { + if (ev.kind === 'cut') { + return `${ev.version} RC0 Cut`; + } + if (ev.kind === 'golden') { + return `${ev.version} Golden`; + } + if (ev.kind === 'stable') { + return `${ev.version}.0 Stable`; + } + if (ev.kind === 'patch') { + return `${ev.version}.1 Patch`; + } + return `${ev.version} ${ev.label}`; +} + +function SelectCaret() { + return ( + + ); +} + +function ExternalArrowIcon() { + return ( + + ); +} + +function ChevronIcon({direction = 'right'}: {direction?: 'left' | 'right'}) { + return ( + + ); +} + +const RELEASE_CREW_QA_TOOLTIP = + 'Release Crew runs manual verification on RC0, RC1, and the Golden RC before publishing.'; + +function TooltipBadge({ + tooltip, + label, + variant = 'secondary', +}: { + tooltip: string; + label?: string; + variant?: 'warning' | 'secondary' | 'info' | 'success'; +}) { + const [tipPos, setTipPos] = useState<{x: number; y: number} | null>(null); + + function showTooltip(el: HTMLElement): void { + const rect = el.getBoundingClientRect(); + setTipPos({x: rect.left + rect.width / 2, y: rect.top}); + } + + return ( + <> + e.stopPropagation()} + onMouseEnter={e => showTooltip(e.currentTarget)} + onMouseLeave={() => setTipPos(null)} + onFocus={e => showTooltip(e.currentTarget)} + onBlur={() => setTipPos(null)}> + {label ?? tooltip} + + {tipPos ? ( + + {tooltip} + + ) : null} + + ); +} + +function MilestoneStrip({ + version, + milestones, + locale, + flush = false, +}: { + version: string; + milestones: ReleaseMilestone[]; + locale: string | undefined; + flush?: boolean; +}) { + const actualCount = milestones.filter(m => m.isActual).length; + const projectedCount = milestones.length - actualCount; + + return ( +
+
+ + {version}.x release timeline + + + {actualCount > 0 && projectedCount > 0 + ? `${actualCount} published on GitHub · ${projectedCount} projected` + : actualCount > 0 + ? `${actualCount} published on GitHub` + : `${projectedCount} projected milestones`} + +
+ +
+ {milestones.map(m => ( +
+
+ +
+ +
+ {m.url ? ( + + {m.label} + + + ) : ( + {m.label} + )} +
+ + + {formatPrettyDate(m.date, locale)} + + + {m.code} + +
+ {m.isActual ? ( + + Published + + ) : null} + {m.manualTest ? ( + + ) : null} +
+
+ ))} +
+
+ ); +} + +function DateCell({ + iso, + locale, + linkHref, + linkLabel, +}: { + iso: string | null; + locale: string | undefined; + linkHref?: string | null; + linkLabel?: string; +}) { + if (!iso) { + return —; + } + const formatted = formatPrettyDate(iso, locale); + return ( +
+ {linkHref && !linkLabel ? ( + e.stopPropagation()}> + {formatted} + + + ) : ( + {formatted} + )} + {linkHref && linkLabel ? ( + e.stopPropagation()}> + {linkLabel} + + + ) : null} +
+ ); +} + +export default function ReleaseScheduleCalendar({ + defaultFutureCount = 12, + defaultShowHistory = true, +}: ReleaseScheduleCalendarProps): ReactNode { + const [futureCount, setFutureCount] = useState(defaultFutureCount); + const [asOf, setAsOf] = useState(SSR_DEFAULT_AS_OF); + const [locale, setLocale] = useState('en-US'); + const [versioning, setVersioning] = useState('zero-x'); + const [showHistory, setShowHistory] = useState(defaultShowHistory); + const [rcWeeks, setRcWeeks] = useState(5); + const [breakingMode, setBreakingMode] = + useState('alternating'); + const [includePatch, setIncludePatch] = useState(true); + const [showAdvanced, setShowAdvanced] = useState(false); + + const [activeTab, setActiveTab] = useState('schedule'); + const [expandedVersions, setExpandedVersions] = useState< + Record + >({}); + + const [calMode, setCalMode] = useState('year'); + const [calYear, setCalYear] = useState(2027); + const [calMonth, setCalMonth] = useState(0); + const [calFilters, setCalFilters] = useState>({ + cut: true, + rc: true, + golden: true, + stable: true, + patch: false, + }); + const [selectedVersion, setSelectedVersion] = useState(null); + const [inspectSeq, setInspectSeq] = useState(0); + const inspectorRef = useRef(null); + + function handleInspectVersion(version: string): void { + setSelectedVersion(version); + setInspectSeq(n => n + 1); + } + + useEffect(() => { + if (selectedVersion && inspectSeq > 0) { + inspectorRef.current?.scrollIntoView({ + behavior: 'smooth', + block: 'nearest', + }); + } + }, [selectedVersion, inspectSeq]); + + const [exportFormat, setExportFormat] = useState('overview-md'); + const [icsOptions, setIcsOptions] = useState({ + cut: true, + rc: false, + golden: true, + stable: true, + patch: false, + futureOnly: true, + }); + const [copyToast, setCopyToast] = useState(''); + const [githubBySeries, setGithubBySeries] = useState< + Map | undefined + >(undefined); + const [githubSync, setGithubSync] = useState('idle'); + const [githubTagCount, setGithubTagCount] = useState(0); + + // Sync to the visitor's local date and locale after hydration to avoid SSR mismatch. + useEffect(() => { + setAsOf(getLocalTodayISO()); + setLocale(undefined); + }, []); + + // Fetch actual RC, stable, and patch tags from GitHub Releases (cached 15m). + useEffect(() => { + const controller = new AbortController(); + + const applyItems = (items: GitHubReleaseApiItem[]) => { + const parsed = parseGitHubReleases(items); + let count = 0; + for (const s of parsed.values()) { + count += s.rcs.length + (s.stable ? 1 : 0) + s.patches.length; + } + setGithubBySeries(parsed); + setGithubTagCount(count); + setGithubSync('synced'); + }; + + try { + const cachedRaw = window.sessionStorage.getItem(GITHUB_CACHE_KEY); + if (cachedRaw) { + const cached = JSON.parse(cachedRaw) as { + ts: number; + items: GitHubReleaseApiItem[]; + }; + if ( + Array.isArray(cached.items) && + Date.now() - cached.ts < GITHUB_CACHE_TTL_MS + ) { + applyItems(cached.items); + return () => controller.abort(); + } + } + } catch { + // Ignore storage access errors in restricted browser contexts. + } + + setGithubSync('loading'); + fetch(GITHUB_RELEASES_API_URL, { + signal: controller.signal, + headers: {Accept: 'application/vnd.github+json'}, + }) + .then(res => { + if (!res.ok) { + throw new Error(`GitHub API ${res.status}`); + } + return res.json() as Promise; + }) + .then(items => { + if (!Array.isArray(items)) { + throw new Error('Unexpected GitHub response'); + } + try { + window.sessionStorage.setItem( + GITHUB_CACHE_KEY, + JSON.stringify({ts: Date.now(), items}) + ); + } catch { + // Ignore storage quota/privacy errors. + } + applyItems(items); + }) + .catch(err => { + if (err instanceof Error && err.name === 'AbortError') { + return; + } + setGithubSync('error'); + }); + + return () => controller.abort(); + }, []); + + const scheduleOptions = useMemo( + () => ({ + futureCount, + asOf, + versioning, + showHistory, + rcWeeks, + breakingMode, + includePatch, + }), + [ + futureCount, + asOf, + versioning, + showHistory, + rcWeeks, + breakingMode, + includePatch, + ] + ); + + const data: ScheduleResult = useMemo( + () => buildReleaseSchedule(scheduleOptions, githubBySeries), + [scheduleOptions, githubBySeries] + ); + + const kpis = useMemo(() => { + const nextRelease = data.allAsc.find(r => r.releaseDate > asOf) ?? null; + const nextCut = data.allAsc.find(r => r.branchCut > asOf) ?? null; + const supported = data.allAsc + .filter(r => r.support === 'Active' || r.support === 'End of Cycle') + .reverse(); + const prevCut = + data.allAsc.filter(r => r.branchCut <= asOf).slice(-1)[0] ?? null; + + return { + nextRelease, + nextCut, + supported, + prevCut, + activeVersions: supported + .filter(r => r.support === 'Active') + .map(r => r.version), + eocVersions: supported + .filter(r => r.support === 'End of Cycle') + .map(r => r.version), + }; + }, [data.allAsc, asOf]); + + const eventsByDate = useMemo(() => { + const byDate = new Map(); + for (const r of data.visibleAsc) { + for (const m of r.milestones) { + if (!calFilters[m.kind]) { + continue; + } + const existing = byDate.get(m.date) ?? []; + existing.push({ + version: r.version, + kind: m.kind, + label: m.label, + code: m.code, + date: m.date, + }); + byDate.set(m.date, existing); + } + } + return byDate; + }, [data.visibleAsc, calFilters]); + + const exportText = useMemo(() => { + switch (exportFormat) { + case 'overview-md': + return buildOverviewMarkdown(data); + case 'rc-md': + return buildRcMarkdown(data, icsOptions.futureOnly); + case 'ics': + return buildICS(data, asOf, icsOptions); + case 'csv': + return buildCSV(data); + case 'json': + return buildJSON(data, scheduleOptions); + } + }, [exportFormat, data, scheduleOptions, asOf, icsOptions]); + + const inspectedRelease = useMemo( + () => + selectedVersion + ? (data.allAsc.find(r => r.version === selectedVersion) ?? null) + : null, + [data.allAsc, selectedVersion] + ); + + const calendarBounds = useMemo(() => { + let minIso = ''; + let maxIso = ''; + for (const r of data.visibleAsc) { + for (const m of r.milestones) { + if (!minIso || m.date < minIso) { + minIso = m.date; + } + if (!maxIso || m.date > maxIso) { + maxIso = m.date; + } + } + } + const minDt = parseISO(minIso || asOf); + const maxDt = parseISO(maxIso || asOf); + const minYear = minDt.getUTCFullYear(); + const minMonth = minDt.getUTCMonth(); + const maxYear = maxDt.getUTCFullYear(); + const maxMonth = maxDt.getUTCMonth(); + return { + minYear, + minMonth, + maxYear, + maxMonth, + minTotal: minYear * 12 + minMonth, + maxTotal: maxYear * 12 + maxMonth, + }; + }, [data.visibleAsc, asOf]); + + useEffect(() => { + const currentTotal = calYear * 12 + calMonth; + if (currentTotal < calendarBounds.minTotal) { + setCalYear(calendarBounds.minYear); + setCalMonth(calendarBounds.minMonth); + } else if (currentTotal > calendarBounds.maxTotal) { + setCalYear(calendarBounds.maxYear); + setCalMonth(calendarBounds.maxMonth); + } + }, [calYear, calMonth, calendarBounds]); + + const canGoPrev = + calMode === 'year' + ? calYear > calendarBounds.minYear + : calYear * 12 + calMonth > calendarBounds.minTotal; + + const canGoNext = + calMode === 'year' + ? calYear < calendarBounds.maxYear + : calYear * 12 + calMonth < calendarBounds.maxTotal; + + function handleReset(): void { + setFutureCount(defaultFutureCount); + setAsOf(getLocalTodayISO()); + setVersioning('zero-x'); + setShowHistory(defaultShowHistory); + setRcWeeks(5); + setBreakingMode('alternating'); + setIncludePatch(true); + } + + function toggleRow(version: string): void { + setExpandedVersions(prev => ({...prev, [version]: !prev[version]})); + } + + function toggleFilter(kind: MilestoneKind): void { + setCalFilters(prev => ({...prev, [kind]: !prev[kind]})); + } + + function stepCalendar(delta: number): void { + if (calMode === 'year') { + const nextYear = Math.max( + calendarBounds.minYear, + Math.min(calendarBounds.maxYear, calYear + delta) + ); + setCalYear(nextYear); + const nextTotal = nextYear * 12 + calMonth; + if (nextTotal < calendarBounds.minTotal) { + setCalMonth(calendarBounds.minMonth); + } else if (nextTotal > calendarBounds.maxTotal) { + setCalMonth(calendarBounds.maxMonth); + } + return; + } + const nextTotal = Math.max( + calendarBounds.minTotal, + Math.min(calendarBounds.maxTotal, calYear * 12 + calMonth + delta) + ); + setCalYear(Math.floor(nextTotal / 12)); + setCalMonth(nextTotal % 12); + } + + function jumpToAsOf(): void { + const dt = parseISO(asOf); + const targetTotal = Math.max( + calendarBounds.minTotal, + Math.min( + calendarBounds.maxTotal, + dt.getUTCFullYear() * 12 + dt.getUTCMonth() + ) + ); + setCalYear(Math.floor(targetTotal / 12)); + setCalMonth(targetTotal % 12); + } + + async function handleCopy(): Promise { + let copied = false; + try { + if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) { + await navigator.clipboard.writeText(exportText); + copied = true; + } + } catch { + copied = false; + } + if (!copied && typeof document !== 'undefined') { + const ta = document.createElement('textarea'); + ta.value = exportText; + ta.setAttribute('readonly', ''); + ta.style.position = 'fixed'; + ta.style.top = '-9999px'; + document.body.appendChild(ta); + ta.select(); + try { + copied = document.execCommand('copy'); + } catch { + copied = false; + } + document.body.removeChild(ta); + } + setCopyToast(copied ? 'Copied to clipboard' : 'Select text below to copy'); + setTimeout(() => setCopyToast(''), 2200); + } + + function handleDownload(): void { + const metaByFormat: Record = { + 'overview-md': {ext: 'md', mime: 'text/markdown;charset=utf-8'}, + 'rc-md': {ext: 'md', mime: 'text/markdown;charset=utf-8'}, + ics: {ext: 'ics', mime: 'text/calendar;charset=utf-8'}, + csv: {ext: 'csv', mime: 'text/csv;charset=utf-8'}, + json: {ext: 'json', mime: 'application/json;charset=utf-8'}, + }; + const meta = metaByFormat[exportFormat]; + const blob = new Blob([exportText], {type: meta.mime}); + const url = URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = `react-native-release-schedule.${meta.ext}`; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(url); + } + + const showTypeCol = breakingMode !== 'none'; + const tableColSpan = 5 + (showTypeCol ? 1 : 0); + + return ( +
+ {/* Summary KPIs */} +
+
+
+ Next Stable Release + + {kpis.nextRelease ? `${kpis.nextRelease.version}.0` : '—'} + + + {kpis.nextRelease + ? `${formatPrettyDate(kpis.nextRelease.releaseDate, locale)} (in ${diffDays(asOf, kpis.nextRelease.releaseDate)}d)` + : '—'} + + {kpis.nextRelease?.latestRc ? ( + + Latest RC:{' '} + + {kpis.nextRelease.latestRc.tag} + + {' '} + ({formatPrettyDate(kpis.nextRelease.latestRc.date, locale)}) + + ) : null} +
+
+ +
+
+ Next Branch Cut (RC0) + + {kpis.nextCut ? `${kpis.nextCut.version}.0-rc.0` : '—'} + + + {kpis.nextCut + ? `${formatPrettyDate(kpis.nextCut.branchCut, locale)} (in ${diffDays(asOf, kpis.nextCut.branchCut)}d)` + : '—'} + +
+
+ +
+
+ Supported Series (3) + + {kpis.supported.length > 0 + ? kpis.supported.map(r => r.version).join(' · ') + : '—'} + + + {kpis.activeVersions.length > 0 + ? `${kpis.activeVersions.join(', ')} Active` + : ''} + {kpis.eocVersions.length > 0 + ? ` · ${kpis.eocVersions.join(', ')} EoC` + : ''} + +
+
+ +
+
+ Current Window on main + + {kpis.nextCut?.releaseType || 'Active development'} + + + {kpis.prevCut && kpis.nextCut + ? `${formatShortDate(kpis.prevCut.branchCut, locale)} → ${formatShortDate(kpis.nextCut.branchCut, locale)} (for ${kpis.nextCut.version}.x)` + : '—'} + +
+
+
+ + {/* Controls */} +
+
+
+
+ +
+ + +
+
+ +
+ + { + if (e.target.value) { + setAsOf(e.target.value); + } + }} + /> +
+ +
+ +
+ + +
+
+ +
+ History +
+ +
+
+ +
+ + +
+ + {showAdvanced ? ( +
+
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ First patch (.1) +
+ +
+
+ + +
+ ) : null} +
+
+ + {/* Main Tabbed Surface */} +
+
+
+ {( + [ + ['schedule', 'Schedule Table'], + ['calendar', 'Calendar'], + ['timeline', 'Support Timeline'], + ['export', 'Export / Copy'], + ] as const + ).map(([id, label]) => ( + + ))} +
+ +
+ + {githubSync === 'synced' ? ( + + GitHub Releases synced ({githubTagCount} tags) + + + ) : githubSync === 'loading' ? ( + Syncing GitHub Releases… + ) : ( + + GitHub Releases + + + )} +
+
+ + {/* View 1: Schedule Table (reuses site's .releases-schedule-table + .table-wrapper) */} + {activeTab === 'schedule' ? ( +
+
+ + + + + {showTypeCol ? : null} + + + + + + + + {data.visibleDesc.map(r => { + const isExpanded = Boolean(expandedVersions[r.version]); + return ( + + toggleRow(r.version)}> + + {showTypeCol ? ( + + ) : null} + + + + + + {isExpanded ? ( + + + + ) : null} + + ); + })} + +
VersionTypeBranch CutLatest / Golden RCRelease (.0)Support
+
+ + + +
+ + {r.version}.x + + + {r.source === 'published' ? ( + <> + {r.blog ? ( + e.stopPropagation()}> + Blog + + ) : ( + Published + )} + · + e.stopPropagation()}> + GitHub + + + + ) : r.inRC || r.latestRc ? ( + e.stopPropagation()}> + GitHub RCs + + + ) : r.source === 'overview-future' ? ( + Scheduled + ) : ( + Projected + )} + +
+
+
{typeBadge(r.releaseType)} + m.kind === 'cut' && m.isActual + )?.url + } + /> + + {r.latestRc ? ( + + ) : r.source === 'published' ? ( + — + ) : ( + + )} + + + +
+ {supportBadge(r)} + {r.eocDate || r.eolDate ? ( + + {r.eocDate + ? `EoC ${formatPrettyDate(r.eocDate, locale)}` + : ''} + {r.eocDate && r.eolDate ? ' · ' : ''} + {r.eolDate + ? `EOL ${formatPrettyDate(r.eolDate, locale)}` + : ''} + + ) : null} +
+
+ +
+
+
+ ) : null} + + {/* View 2: Calendar */} + {activeTab === 'calendar' ? ( +
+
+
+ + + {calMode === 'month' + ? `${MONTH_NAMES[calMonth]} ${calYear}` + : String(calYear)} + + + +
+ + +
+
+ +
+ {( + [ + ['cut', 'Branch Cut (RC0)'], + ['rc', 'RC1–RC3'], + ['golden', 'Golden RC'], + ['stable', 'Stable (.0)'], + ['patch', 'Patch (.1)'], + ] as const + ).map(([kind, label]) => ( + + ))} +
+
+ + {calMode === 'year' ? ( + { + setCalMonth(m); + setCalMode('month'); + }} + onInspectVersion={handleInspectVersion} + /> + ) : ( + + )} + + {inspectedRelease ? ( +
+
+ + React Native {inspectedRelease.version}.x + {typeBadge(inspectedRelease.releaseType)} + {supportBadge(inspectedRelease)} + + +
+ +
+ ) : null} +
+ ) : null} + + {/* View 3: Support Timeline */} + {activeTab === 'timeline' ? ( + + ) : null} + + {/* View 4: Export / Copy */} + {activeTab === 'export' ? ( +
+
+
+ {( + [ + ['overview-md', 'reactnative.dev MD'], + ['rc-md', 'Full RC Schedule MD'], + ['ics', 'iCalendar (.ics)'], + ['csv', 'CSV'], + ['json', 'JSON'], + ] as const + ).map(([fmt, label]) => ( + + ))} +
+ +
+ {copyToast ? ( + + {copyToast} + + ) : null} + + +
+
+ + {exportFormat === 'ics' || exportFormat === 'rc-md' ? ( +
+ {exportFormat === 'ics' ? ( + <> + {( + [ + ['cut', 'Branch Cuts (RC0)'], + ['rc', 'Intermediate RCs'], + ['golden', 'Golden RC'], + ['stable', 'Stable Releases (.0)'], + ['patch', 'First Patch (.1)'], + ] as const + ).map(([key, label]) => ( + + ))} + + ) : null} + +
+ ) : null} + +
+              {exportText}
+            
+
+ ) : null} +
+
+ ); +} + +function YearGrid({ + year, + asOf, + locale, + eventsByDate, + onOpenMonth, + onInspectVersion, +}: { + year: number; + asOf: string; + locale: string | undefined; + eventsByDate: Map; + onOpenMonth: (month0: number) => void; + onInspectVersion: (version: string) => void; +}) { + const priority: MilestoneKind[] = ['stable', 'cut', 'golden', 'rc', 'patch']; + + return ( +
+ {MONTH_NAMES.map((monthName, month0) => { + const firstDay = new Date(Date.UTC(year, month0, 1)); + const startDow = firstDay.getUTCDay(); + const daysInMonth = new Date( + Date.UTC(year, month0 + 1, 0) + ).getUTCDate(); + const monthEvents: CalendarEvent[] = []; + + const cells: ReactNode[] = []; + for (const d of DOW_SHORT) { + cells.push( +
+ {d.charAt(0)} +
+ ); + } + for (let i = 0; i < startDow; i++) { + cells.push( +
+ . +
+ ); + } + + for (let day = 1; day <= daysInMonth; day++) { + const iso = `${year}-${String(month0 + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; + const evs = eventsByDate.get(iso) ?? []; + const isToday = iso === asOf; + + if (evs.length > 0) { + const top = + priority + .map(k => evs.find(e => e.kind === k)) + .find((x): x is CalendarEvent => Boolean(x)) ?? evs[0]; + monthEvents.push(...evs); + cells.push( + + ); + } else { + cells.push( +
+ {day} +
+ ); + } + } + + return ( +
+
+ + {monthEvents.length > 0 ? ( + + {monthEvents.length} event + {monthEvents.length === 1 ? '' : 's'} + + ) : null} +
+
{cells}
+ {monthEvents.length > 0 ? ( +
+ {monthEvents.map(ev => ( + + ))} +
+ ) : null} +
+ ); + })} +
+ ); +} + +function MonthGrid({ + year, + month0, + asOf, + eventsByDate, + onInspectVersion, +}: { + year: number; + month0: number; + asOf: string; + eventsByDate: Map; + onInspectVersion: (version: string) => void; +}) { + const firstDay = new Date(Date.UTC(year, month0, 1)); + const startDow = firstDay.getUTCDay(); + const daysInMonth = new Date(Date.UTC(year, month0 + 1, 0)).getUTCDate(); + const prevMonthDays = new Date(Date.UTC(year, month0, 0)).getUTCDate(); + const totalCells = Math.ceil((startDow + daysInMonth) / 7) * 7; + + const cells: ReactNode[] = []; + for (let c = 0; c < totalCells; c++) { + let cellYear = year; + let cellMonth0 = month0; + let dayNum: number; + let isOutside = false; + + if (c < startDow) { + dayNum = prevMonthDays - startDow + 1 + c; + cellMonth0 = month0 - 1; + if (cellMonth0 < 0) { + cellMonth0 = 11; + cellYear -= 1; + } + isOutside = true; + } else if (c >= startDow + daysInMonth) { + dayNum = c - (startDow + daysInMonth) + 1; + cellMonth0 = month0 + 1; + if (cellMonth0 > 11) { + cellMonth0 = 0; + cellYear += 1; + } + isOutside = true; + } else { + dayNum = c - startDow + 1; + } + + const iso = `${cellYear}-${String(cellMonth0 + 1).padStart(2, '0')}-${String(dayNum).padStart(2, '0')}`; + const isToday = iso === asOf; + const evs = eventsByDate.get(iso) ?? []; + + cells.push( +
+
+ {dayNum} + {isToday ? As of : null} +
+ {evs.map(ev => ( + + ))} +
+ ); + } + + return ( +
+ {DOW_SHORT.map(d => ( +
+ {d} +
+ ))} + {cells} +
+ ); +} + +function SupportTimeline({ + rows, + asOf, + locale, +}: { + rows: ScheduledRelease[]; + asOf: string; + locale: string | undefined; +}) { + if (rows.length === 0) { + return

No releases to display.

; + } + + const minDate = rows[0].branchCut; + const lastRow = rows[rows.length - 1]; + const maxDate = lastRow.eolDate ?? addDays(lastRow.releaseDate, 180); + const totalSpan = Math.max(1, diffDays(minDate, maxDate)); + + const pct = (iso: string): number => { + const clamped = Math.max(0, Math.min(totalSpan, diffDays(minDate, iso))); + return (clamped / totalSpan) * 100; + }; + + const startYear = parseISO(minDate).getUTCFullYear(); + const endYear = parseISO(maxDate).getUTCFullYear(); + const ticks: Array<{iso: string; label: string; left: number}> = []; + for (let y = startYear; y <= endYear + 1; y++) { + for (const m of [1, 4, 7, 10]) { + const iso = `${y}-${String(m).padStart(2, '0')}-01`; + if (iso >= minDate && iso <= maxDate) { + ticks.push({ + iso, + label: + m === 1 ? String(y) : `Q${Math.ceil(m / 3)} '${String(y).slice(2)}`, + left: pct(iso), + }); + } + } + } + + const asOfLeft = pct(asOf); + const showAsOf = asOf >= minDate && asOf <= maxDate; + + return ( +
+
+ + + RC Stabilization (Branch Cut → .0) + + + + Active Support (latest 2 minor series) + + + + End of Cycle (3rd minor series) + +
+ +
+
+
+
Series
+
+ {ticks.map(t => ( + + {t.label} + + ))} + {showAsOf ? ( + + As of {formatPrettyDate(asOf, locale)} + + ) : null} +
+
+ + {[...rows].reverse().map(r => { + const rcStart = pct(r.branchCut); + const relStart = pct(r.releaseDate); + const eocStart = r.eocDate ? pct(r.eocDate) : relStart; + const eolStart = r.eolDate ? pct(r.eolDate) : eocStart; + + const rcW = Math.max(0.8, relStart - rcStart); + const activeW = Math.max(0.8, eocStart - relStart); + const eocW = Math.max(0.8, eolStart - eocStart); + + return ( +
+
{r.version}.x
+
+
+ RC +
+
+ Active +
+
+ EoC +
+ {showAsOf ? ( +
+ ) : null} +
+
+ ); + })} +
+
+
+ ); +} diff --git a/website/src/components/releases/releaseSchedule.ts b/website/src/components/releases/releaseSchedule.ts new file mode 100644 index 00000000000..c7500c05a54 --- /dev/null +++ b/website/src/components/releases/releaseSchedule.ts @@ -0,0 +1,941 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export type SupportStatus = + 'Future' | 'Active' | 'End of Cycle' | 'Unsupported'; + +export type MilestoneKind = 'cut' | 'rc' | 'golden' | 'stable' | 'patch'; + +export type VersioningMode = 'zero-x' | 'semver-1-2027'; + +export type BreakingCadenceMode = 'alternating' | 'major-2x' | 'none'; + +export type ReleaseSource = 'published' | 'overview-future' | 'projected'; + +export interface ReleaseMilestone { + kind: MilestoneKind; + code: string; + label: string; + date: string; + manualTest: boolean; + /** Direct GitHub Releases URL when this tag has been published. */ + url?: string; + /** True when the date comes from an actual published GitHub release. */ + isActual?: boolean; +} + +export interface GitHubReleaseApiItem { + tag_name: string; + published_at?: string | null; + created_at?: string | null; + html_url: string; + prerelease?: boolean; + draft?: boolean; +} + +export interface GitHubTagInfo { + tag: string; + code: string; + date: string; + url: string; + rcNumber?: number; + patchNumber?: number; +} + +export interface GitHubSeriesData { + rcs: GitHubTagInfo[]; + stable: GitHubTagInfo | null; + patches: GitHubTagInfo[]; +} + +export interface PublishedReleaseAnchor { + minorNum: number; + version: string; + branchCut: string; + releaseDate: string; + blog: string; + releaseType: 'Breaking' | 'Non-breaking'; +} + +export interface ScheduledRelease { + minorNum: number; + version: string; + branchCut: string; + goldenDate: string; + releaseDate: string; + patchDate: string; + eocDate: string | null; + eolDate: string | null; + blog: string; + githubSearchUrl: string; + latestRc: GitHubTagInfo | null; + stableReleaseUrl: string | null; + releaseType: string; + source: ReleaseSource; + support: SupportStatus; + inRC: boolean; + isLatestStable: boolean; + milestones: ReleaseMilestone[]; +} + +export interface ScheduleOptions { + futureCount: number; + asOf: string; + versioning: VersioningMode; + showHistory: boolean; + rcWeeks: number; + breakingMode: BreakingCadenceMode; + includePatch: boolean; +} + +export interface IcsOptions { + cut: boolean; + rc: boolean; + golden: boolean; + stable: boolean; + patch: boolean; + futureOnly: boolean; +} + +export interface ScheduleResult { + allAsc: ScheduledRelease[]; + visibleAsc: ScheduledRelease[]; + visibleDesc: ScheduledRelease[]; + futureOnlyAsc: ScheduledRelease[]; +} + +export const GITHUB_RELEASES_API_URL = + 'https://api.github.com/repos/react/react-native/releases?per_page=100'; + +export const GITHUB_RELEASES_PAGE_URL = + 'https://github.com/react/react-native/releases'; + +/** + * Published release history synced with + * `website/src/components/releases/_releases-table.md`. + */ +export const HISTORICAL_RELEASES: readonly PublishedReleaseAnchor[] = [ + { + minorNum: 77, + version: '0.77', + branchCut: '2024-11-26', + releaseDate: '2025-01-21', + blog: '/blog/2025/01/21/version-0.77', + releaseType: 'Breaking', + }, + { + minorNum: 78, + version: '0.78', + branchCut: '2025-01-15', + releaseDate: '2025-02-19', + blog: '/blog/2025/02/19/react-native-0.78', + releaseType: 'Breaking', + }, + { + minorNum: 79, + version: '0.79', + branchCut: '2025-03-04', + releaseDate: '2025-04-08', + blog: '/blog/2025/04/08/react-native-0.79', + releaseType: 'Breaking', + }, + { + minorNum: 80, + version: '0.80', + branchCut: '2025-05-07', + releaseDate: '2025-06-12', + blog: '/blog/2025/06/12/react-native-0.80', + releaseType: 'Breaking', + }, + { + minorNum: 81, + version: '0.81', + branchCut: '2025-07-10', + releaseDate: '2025-08-12', + blog: '/blog/2025/08/12/react-native-0.81', + releaseType: 'Breaking', + }, + { + minorNum: 82, + version: '0.82', + branchCut: '2025-09-01', + releaseDate: '2025-10-06', + blog: '/blog/2025/10/08/react-native-0.82', + releaseType: 'Breaking', + }, + { + minorNum: 83, + version: '0.83', + branchCut: '2025-11-03', + releaseDate: '2025-12-10', + blog: '/blog/2025/12/10/react-native-0.83', + releaseType: 'Non-breaking', + }, + { + minorNum: 84, + version: '0.84', + branchCut: '2026-01-05', + releaseDate: '2026-02-09', + blog: '/blog/2026/02/11/react-native-0.84', + releaseType: 'Breaking', + }, + { + minorNum: 85, + version: '0.85', + branchCut: '2026-03-02', + releaseDate: '2026-04-06', + blog: '/blog/2026/04/07/react-native-0.85', + releaseType: 'Breaking', + }, + { + minorNum: 86, + version: '0.86', + branchCut: '2026-05-04', + releaseDate: '2026-06-09', + blog: '/blog/2026/06/11/react-native-0.86', + releaseType: 'Non-breaking', + }, + { + minorNum: 87, + version: '0.87', + branchCut: '2026-07-06', + releaseDate: '2026-08-11', + blog: '/blog/2026/08/11/react-native-0.87', + releaseType: 'Breaking', + }, + { + minorNum: 88, + version: '0.88', + branchCut: '2026-09-07', + releaseDate: '2026-10-15', + blog: '/blog/2026/10/19/react-native-0.88', + releaseType: 'Non-breaking', + }, +]; + +/** + * First upcoming release slot (0.89 begins Nov 2026). + * 0.89 and 0.90 are published as Future rows in `_releases-table.md`. + */ +export const ANCHOR_START = { + year: 2026, + month: 11, + minorNum: 89, +} as const; + +export const PUBLISHED_FUTURE_SLOTS = 2; + +/** + * Deterministic SSR baseline date; updated to the visitor's local date on + * client mount to avoid React hydration mismatches. + */ +export const SSR_DEFAULT_AS_OF = '2026-12-03'; + +export const MONTH_NAMES = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', +] as const; + +export const MONTH_SHORT = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', +] as const; + +export const DOW_SHORT = [ + 'Sun', + 'Mon', + 'Tue', + 'Wed', + 'Thu', + 'Fri', + 'Sat', +] as const; + +export function parseISO(iso: string): Date { + const [year, month, day] = iso.split('-').map(Number); + return new Date(Date.UTC(year, month - 1, day)); +} + +export function toISO(date: Date): string { + const y = date.getUTCFullYear(); + const m = String(date.getUTCMonth() + 1).padStart(2, '0'); + const d = String(date.getUTCDate()).padStart(2, '0'); + return `${y}-${m}-${d}`; +} + +export function addDays(iso: string, days: number): string { + const dt = parseISO(iso); + dt.setUTCDate(dt.getUTCDate() + days); + return toISO(dt); +} + +export function diffDays(isoA: string, isoB: string): number { + return Math.round( + (parseISO(isoB).getTime() - parseISO(isoA).getTime()) / 86400000 + ); +} + +export function formatPrettyDate( + iso: string | null, + locale: string | undefined = 'en-US' +): string { + if (!iso) { + return '—'; + } + const dt = parseISO(iso); + return new Intl.DateTimeFormat(locale, { + year: 'numeric', + month: 'short', + day: 'numeric', + timeZone: 'UTC', + }).format(dt); +} + +export function formatShortDate( + iso: string | null, + locale: string | undefined = 'en-US' +): string { + if (!iso) { + return '—'; + } + const dt = parseISO(iso); + return new Intl.DateTimeFormat(locale, { + month: 'short', + day: 'numeric', + timeZone: 'UTC', + }).format(dt); +} + +export function getLocalTodayISO(): string { + const now = new Date(); + const y = now.getFullYear(); + const m = String(now.getMonth() + 1).padStart(2, '0'); + const d = String(now.getDate()).padStart(2, '0'); + return `${y}-${m}-${d}`; +} + +export function firstMondayOfMonth(year: number, month1Based: number): string { + const first = new Date(Date.UTC(year, month1Based - 1, 1)); + const dow = first.getUTCDay(); + const offset = (8 - dow) % 7; + first.setUTCDate(1 + offset); + return toISO(first); +} + +/** + * Parses GitHub Releases API rows from `react/react-native` into per-series + * RC, stable, and patch records sorted ascending by version number. + */ +export function parseGitHubReleases( + items: readonly GitHubReleaseApiItem[] +): Map { + const map = new Map(); + + const getOrCreate = (series: string): GitHubSeriesData => { + let entry = map.get(series); + if (!entry) { + entry = {rcs: [], stable: null, patches: []}; + map.set(series, entry); + } + return entry; + }; + + for (const item of items) { + if (item.draft || !item.tag_name) { + continue; + } + const rawDate = item.published_at ?? item.created_at; + if (!rawDate || rawDate.length < 10) { + continue; + } + const date = rawDate.slice(0, 10); + const url = + item.html_url || `${GITHUB_RELEASES_PAGE_URL}/tag/${item.tag_name}`; + + const rcMatch = /^v(\d+\.\d+)\.0-rc\.(\d+)$/.exec(item.tag_name); + if (rcMatch) { + const series = rcMatch[1]; + const rcNumber = Number(rcMatch[2]); + const entry = getOrCreate(series); + entry.rcs.push({ + tag: item.tag_name, + code: `${series}.0-rc.${rcNumber}`, + date, + url, + rcNumber, + }); + continue; + } + + const stableMatch = /^v(\d+\.\d+)\.(\d+)$/.exec(item.tag_name); + if (stableMatch) { + const series = stableMatch[1]; + const patchNumber = Number(stableMatch[2]); + const entry = getOrCreate(series); + const info: GitHubTagInfo = { + tag: item.tag_name, + code: `${series}.${patchNumber}`, + date, + url, + patchNumber, + }; + if (patchNumber === 0) { + entry.stable = info; + } else { + entry.patches.push(info); + } + } + } + + for (const entry of map.values()) { + entry.rcs.sort((a, b) => (a.rcNumber ?? 0) - (b.rcNumber ?? 0)); + entry.patches.sort((a, b) => (a.patchNumber ?? 0) - (b.patchNumber ?? 0)); + } + + return map; +} + +function buildFutureMilestones( + version: string, + branchCut: string, + releaseDate: string, + patchDate: string, + options: ScheduleOptions, + ghSeries?: GitHubSeriesData +): ReleaseMilestone[] { + const actualRcByIndex = new Map(); + if (ghSeries) { + for (const rc of ghSeries.rcs) { + if (rc.rcNumber !== undefined) { + actualRcByIndex.set(rc.rcNumber, rc); + } + } + } + + const maxActualRc = + ghSeries && ghSeries.rcs.length > 0 + ? Math.max(...ghSeries.rcs.map(r => r.rcNumber ?? 0)) + : -1; + const rcCount = Math.max(options.rcWeeks, maxActualRc + 1); + const goldenIdx = options.rcWeeks - 1; + + const milestones: ReleaseMilestone[] = []; + for (let w = 0; w < rcCount; w++) { + const actual = actualRcByIndex.get(w); + const dt = actual ? actual.date : addDays(branchCut, w * 7); + const isCut = w === 0; + const isGolden = w === goldenIdx; + const manualTest = w === 0 || w === 1 || isGolden; + const label = isCut + ? 'RC0 (Branch Cut)' + : isGolden + ? `RC${w} (Golden RC)` + : `RC${w}`; + milestones.push({ + kind: isCut ? 'cut' : isGolden ? 'golden' : 'rc', + code: `${version}.0-rc.${w}`, + label, + date: dt, + manualTest, + url: actual?.url, + isActual: Boolean(actual), + }); + } + + const actualStable = ghSeries?.stable ?? null; + const stableDate = actualStable ? actualStable.date : releaseDate; + milestones.push({ + kind: 'stable', + code: `${version}.0`, + label: `${version}.0 (Stable)`, + date: stableDate, + manualTest: false, + url: actualStable?.url, + isActual: Boolean(actualStable), + }); + + if (ghSeries && ghSeries.patches.length > 0) { + for (const patch of ghSeries.patches) { + milestones.push({ + kind: 'patch', + code: patch.code, + label: `${patch.code} (Patch)`, + date: patch.date, + manualTest: false, + url: patch.url, + isActual: true, + }); + } + } else if (options.includePatch) { + milestones.push({ + kind: 'patch', + code: `${version}.1`, + label: `${version}.1 (First Patch)`, + date: patchDate, + manualTest: false, + isActual: false, + }); + } + + return milestones; +} + +function buildHistoricalMilestones( + h: PublishedReleaseAnchor, + ghSeries?: GitHubSeriesData +): ReleaseMilestone[] { + const defaultStableUrl = `${GITHUB_RELEASES_PAGE_URL}/tag/v${h.version}.0`; + + if (!ghSeries || (ghSeries.rcs.length === 0 && !ghSeries.stable)) { + return [ + { + kind: 'cut', + code: `${h.version}.0-rc.0`, + label: 'RC0 (Branch Cut)', + date: h.branchCut, + manualTest: true, + url: `${GITHUB_RELEASES_PAGE_URL}/tag/v${h.version}.0-rc.0`, + isActual: true, + }, + { + kind: 'stable', + code: `${h.version}.0`, + label: `${h.version}.0 (Stable)`, + date: h.releaseDate, + manualTest: false, + url: defaultStableUrl, + isActual: true, + }, + ]; + } + + const milestones: ReleaseMilestone[] = []; + const lastRcNumber = + ghSeries.rcs.length > 0 + ? ghSeries.rcs[ghSeries.rcs.length - 1].rcNumber + : undefined; + + for (const rc of ghSeries.rcs) { + const n = rc.rcNumber ?? 0; + const isCut = n === 0; + const isGolden = !isCut && n === lastRcNumber; + milestones.push({ + kind: isCut ? 'cut' : isGolden ? 'golden' : 'rc', + code: rc.code, + label: isCut + ? 'RC0 (Branch Cut)' + : isGolden + ? `RC${n} (Final RC)` + : `RC${n}`, + date: rc.date, + manualTest: n === 0 || n === 1 || isGolden, + url: rc.url, + isActual: true, + }); + } + + milestones.push({ + kind: 'stable', + code: `${h.version}.0`, + label: `${h.version}.0 (Stable)`, + date: ghSeries.stable?.date ?? h.releaseDate, + manualTest: false, + url: ghSeries.stable?.url ?? defaultStableUrl, + isActual: true, + }); + + for (const patch of ghSeries.patches) { + milestones.push({ + kind: 'patch', + code: patch.code, + label: `${patch.code} (Patch)`, + date: patch.date, + manualTest: false, + url: patch.url, + isActual: true, + }); + } + + return milestones; +} + +function generateFutureSeries( + count: number, + options: ScheduleOptions, + githubBySeries?: Map +): ScheduledRelease[] { + const result: ScheduledRelease[] = []; + let year: number = ANCHOR_START.year; + let month: number = ANCHOR_START.month; + + for (let i = 0; i < count; i++) { + const minorNum = ANCHOR_START.minorNum + i; + const branchCut = firstMondayOfMonth(year, month); + const releaseDate = addDays(branchCut, options.rcWeeks * 7); + const patchDate = addDays(releaseDate, 7); + const goldenDate = addDays(branchCut, (options.rcWeeks - 1) * 7); + + let version = `0.${minorNum}`; + let releaseType = 'Breaking'; + + if (options.versioning === 'semver-1-2027' && i >= 3) { + const semverIdx = i - 3; + const major = Math.floor(semverIdx / 3) + 1; + const minor = semverIdx % 3; + version = `${major}.${minor}`; + releaseType = minor === 0 ? 'Major (Breaking)' : 'Non-breaking'; + } else if (options.breakingMode === 'alternating') { + releaseType = i % 2 === 0 ? 'Breaking' : 'Non-breaking'; + } else if (options.breakingMode === 'major-2x') { + if (i === 0) { + releaseType = 'Breaking'; + } else if (i === 1) { + releaseType = 'Non-breaking'; + } else { + releaseType = (i - 2) % 3 === 0 ? 'Breaking' : 'Non-breaking'; + } + } else { + releaseType = ''; + } + + const ghSeries = githubBySeries?.get(version); + const milestones = buildFutureMilestones( + version, + branchCut, + releaseDate, + patchDate, + options, + ghSeries + ); + const latestRc = + ghSeries && ghSeries.rcs.length > 0 + ? ghSeries.rcs[ghSeries.rcs.length - 1] + : null; + const effectiveReleaseDate = ghSeries?.stable?.date ?? releaseDate; + const effectiveGoldenDate = + ghSeries?.rcs.find(r => r.rcNumber === options.rcWeeks - 1)?.date ?? + goldenDate; + const effectivePatchDate = ghSeries?.patches[0]?.date ?? patchDate; + + const isPublishedFuture = + i < PUBLISHED_FUTURE_SLOTS && + options.rcWeeks === 5 && + options.versioning === 'zero-x'; + + result.push({ + minorNum, + version, + branchCut, + goldenDate: effectiveGoldenDate, + releaseDate: effectiveReleaseDate, + patchDate: effectivePatchDate, + eocDate: null, + eolDate: null, + blog: '', + githubSearchUrl: `${GITHUB_RELEASES_PAGE_URL}?q=v${version}`, + latestRc, + stableReleaseUrl: ghSeries?.stable?.url ?? null, + releaseType, + source: isPublishedFuture ? 'overview-future' : 'projected', + support: 'Future', + inRC: false, + isLatestStable: false, + milestones, + }); + + month += 2; + if (month > 12) { + month -= 12; + year += 1; + } + } + + return result; +} + +export function buildReleaseSchedule( + options: ScheduleOptions, + githubBySeries?: Map +): ScheduleResult { + // Generate 3 extra lookahead releases so End of Cycle and Unsupported dates + // are available for every visible row. + const futureWithLookahead = generateFutureSeries( + options.futureCount + 3, + options, + githubBySeries + ); + + const history: ScheduledRelease[] = HISTORICAL_RELEASES.map(h => { + const ghSeries = githubBySeries?.get(h.version); + const latestRc = + ghSeries && ghSeries.rcs.length > 0 + ? ghSeries.rcs[ghSeries.rcs.length - 1] + : null; + const firstPatch = ghSeries?.patches[0] ?? null; + + return { + minorNum: h.minorNum, + version: h.version, + branchCut: h.branchCut, + goldenDate: latestRc ? latestRc.date : addDays(h.releaseDate, -7), + releaseDate: h.releaseDate, + patchDate: firstPatch ? firstPatch.date : addDays(h.releaseDate, 7), + eocDate: null, + eolDate: null, + blog: h.blog, + githubSearchUrl: `${GITHUB_RELEASES_PAGE_URL}?q=v${h.version}`, + latestRc, + stableReleaseUrl: + ghSeries?.stable?.url ?? + `${GITHUB_RELEASES_PAGE_URL}/tag/v${h.version}.0`, + releaseType: options.breakingMode === 'none' ? '' : h.releaseType, + source: 'published', + support: 'Unsupported', + inRC: false, + isLatestStable: false, + milestones: buildHistoricalMilestones(h, ghSeries), + }; + }); + + const allAsc = [...history, ...futureWithLookahead]; + + for (let i = 0; i < allAsc.length; i++) { + allAsc[i].eocDate = allAsc[i + 2]?.releaseDate ?? null; + allAsc[i].eolDate = allAsc[i + 3]?.releaseDate ?? null; + } + + const releasedAsc = allAsc.filter(r => r.releaseDate <= options.asOf); + const rankByVersion = new Map(); + releasedAsc.forEach((r, idx) => { + rankByVersion.set(r.version, releasedAsc.length - 1 - idx); + }); + + for (const r of allAsc) { + if (r.releaseDate > options.asOf) { + r.support = 'Future'; + r.inRC = r.branchCut <= options.asOf || r.latestRc !== null; + r.isLatestStable = false; + } else { + const rank = rankByVersion.get(r.version) ?? 99; + r.inRC = false; + r.isLatestStable = rank === 0; + if (rank === 0 || rank === 1) { + r.support = 'Active'; + } else if (rank === 2) { + r.support = 'End of Cycle'; + } else { + r.support = 'Unsupported'; + } + } + } + + const futureOnlyAsc = futureWithLookahead.slice(0, options.futureCount); + const visibleAsc = options.showHistory + ? [...history, ...futureOnlyAsc] + : futureOnlyAsc; + const visibleDesc = [...visibleAsc].reverse(); + + return { + allAsc, + visibleAsc, + visibleDesc, + futureOnlyAsc, + }; +} + +export function buildOverviewMarkdown(data: ScheduleResult): string { + const lines = [ + '| Version | Branch cut date | Release date | Support | Blog post |', + '| --- | --- | --- | --- | --- |', + ]; + for (const r of data.visibleDesc) { + const blog = r.blog ? `[Details](${r.blog})` : ''; + lines.push( + `| ${r.version}.x | ${r.branchCut} | ${r.releaseDate} | ${r.support} | ${blog} |` + ); + } + return lines.join('\n'); +} + +export function buildRcMarkdown( + data: ScheduleResult, + futureOnly: boolean +): string { + const rows = futureOnly ? data.futureOnlyAsc : data.visibleAsc; + const lines = [ + '| Release Series | Type | Date | Event | Notes |', + '| --- | --- | --- | --- | --- |', + ]; + for (const r of rows) { + r.milestones.forEach((m, idx) => { + const seriesCell = idx === 0 ? `**${r.version}.x**` : ''; + const typeCell = idx === 0 ? r.releaseType : ''; + const eventCell = m.url ? `[${m.label}](${m.url})` : m.label; + const notes: string[] = []; + if (m.isActual) { + notes.push('Published'); + } + if (m.manualTest) { + notes.push('Release Crew QA'); + } + lines.push( + `| ${seriesCell} | ${typeCell} | ${m.date} | ${eventCell} | ${notes.join('; ')} |` + ); + }); + } + return lines.join('\n'); +} + +export function buildICS( + data: ScheduleResult, + asOf: string, + icsOptions: IcsOptions +): string { + const rows = icsOptions.futureOnly ? data.futureOnlyAsc : data.visibleAsc; + const stamp = `${asOf.replace(/-/g, '')}T000000Z`; + const lines = [ + 'BEGIN:VCALENDAR', + 'VERSION:2.0', + 'PRODID:-//React Native//Release Schedule Calendar//EN', + 'CALSCALE:GREGORIAN', + 'METHOD:PUBLISH', + 'X-WR-CALNAME:React Native Release Schedule', + ]; + + for (const r of rows) { + for (const m of r.milestones) { + if (!icsOptions[m.kind]) { + continue; + } + const dtStart = m.date.replace(/-/g, ''); + const dtEnd = addDays(m.date, 1).replace(/-/g, ''); + const uid = `rn-${m.code.replace(/[^a-zA-Z0-9.-]/g, '')}-${dtStart}@reactnative.dev`; + const summary = `React Native ${r.version} — ${m.label}`; + const descParts = [ + `Series: ${r.version}.x`, + r.releaseType ? `Type: ${r.releaseType}` : '', + `Target version: ${m.code}`, + m.url ? `GitHub Release: ${m.url}` : '', + m.manualTest ? 'Release Crew manual QA milestone.' : '', + 'Schedule reference: https://reactnative.dev/releases/overview', + ].filter(Boolean); + + lines.push('BEGIN:VEVENT'); + lines.push(`UID:${uid}`); + lines.push(`DTSTAMP:${stamp}`); + lines.push(`DTSTART;VALUE=DATE:${dtStart}`); + lines.push(`DTEND;VALUE=DATE:${dtEnd}`); + lines.push(`SUMMARY:${summary}`); + lines.push(`DESCRIPTION:${descParts.join('\\n')}`); + if (m.url) { + lines.push(`URL:${m.url}`); + } + lines.push('END:VEVENT'); + } + } + + lines.push('END:VCALENDAR'); + return lines.join('\r\n'); +} + +export function buildCSV(data: ScheduleResult): string { + const header = [ + 'version', + 'release_type', + 'branch_cut', + 'golden_rc', + 'release_date', + 'first_patch', + 'end_of_cycle', + 'unsupported', + 'support_status', + 'latest_rc', + 'source', + ]; + const lines = [header.join(',')]; + for (const r of data.visibleDesc) { + const cells = [ + `${r.version}.x`, + r.releaseType, + r.branchCut, + r.source === 'published' && !r.latestRc ? '' : r.goldenDate, + r.releaseDate, + r.source === 'published' && !r.milestones.some(m => m.kind === 'patch') + ? '' + : r.patchDate, + r.eocDate ?? '', + r.eolDate ?? '', + r.support, + r.latestRc?.tag ?? '', + r.source, + ].map(value => + value.includes(',') ? `"${value.replace(/"/g, '""')}"` : value + ); + lines.push(cells.join(',')); + } + return lines.join('\n'); +} + +export function buildJSON( + data: ScheduleResult, + options: ScheduleOptions +): string { + const payload = { + generatedAsOf: options.asOf, + source: 'https://reactnative.dev/releases/overview', + githubReleases: GITHUB_RELEASES_PAGE_URL, + cadence: { + branchCutRule: 'First Monday of every odd-numbered month', + stabilizationWeeks: options.rcWeeks, + supportedMinorSeries: 3, + }, + releases: data.visibleDesc.map(r => ({ + version: `${r.version}.x`, + releaseType: r.releaseType || undefined, + branchCut: r.branchCut, + goldenRc: r.goldenDate, + releaseDate: r.releaseDate, + firstPatch: r.patchDate, + endOfCycle: r.eocDate, + unsupported: r.eolDate, + support: r.support, + latestRc: r.latestRc + ? {tag: r.latestRc.tag, date: r.latestRc.date, url: r.latestRc.url} + : undefined, + source: r.source, + milestones: r.milestones.map(m => ({ + code: m.code, + label: m.label, + date: m.date, + manualTest: m.manualTest, + isActual: Boolean(m.isActual), + url: m.url, + })), + })), + }; + return JSON.stringify(payload, null, 2); +} diff --git a/website/src/pages/versions.tsx b/website/src/pages/versions.tsx index 0c889b7f0eb..dd9dbc3ee8b 100644 --- a/website/src/pages/versions.tsx +++ b/website/src/pages/versions.tsx @@ -63,6 +63,7 @@ const VersionItem = ({ // (a standalone React page, not a doc) renders the same sidebar. Keep in sync. const releasesSidebar: PropSidebar = [ {type: 'link', href: '/releases/overview', label: 'Overview'}, + {type: 'link', href: '/releases/schedule', label: 'Release Calendar'}, {type: 'link', href: '/releases/branches', label: 'Branches'}, { type: 'link', From 49442e66187673969e1e6f08261708bf1df33a16 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Thu, 3 Dec 2026 15:58:57 -0500 Subject: [PATCH 2/6] Default future versions to 6 and clamp YearGrid months to schedule bounds Signed-off-by: Peter Abbondanzo --- .../components/releases/ReleaseScheduleCalendar.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/src/components/releases/ReleaseScheduleCalendar.tsx b/website/src/components/releases/ReleaseScheduleCalendar.tsx index 80367d2c204..ddcba52ee29 100644 --- a/website/src/components/releases/ReleaseScheduleCalendar.tsx +++ b/website/src/components/releases/ReleaseScheduleCalendar.tsx @@ -397,7 +397,7 @@ function DateCell({ } export default function ReleaseScheduleCalendar({ - defaultFutureCount = 12, + defaultFutureCount = 6, defaultShowHistory = true, }: ReleaseScheduleCalendarProps): ReactNode { const [futureCount, setFutureCount] = useState(defaultFutureCount); @@ -1463,6 +1463,8 @@ function YearGrid({ year, asOf, locale, + minTotal, + maxTotal, eventsByDate, onOpenMonth, onInspectVersion, @@ -1470,6 +1472,8 @@ function YearGrid({ year: number; asOf: string; locale: string | undefined; + minTotal: number; + maxTotal: number; eventsByDate: Map; onOpenMonth: (month0: number) => void; onInspectVersion: (version: string) => void; @@ -1479,6 +1483,10 @@ function YearGrid({ return (
{MONTH_NAMES.map((monthName, month0) => { + const monthTotal = year * 12 + month0; + if (monthTotal < minTotal || monthTotal > maxTotal) { + return null; + } const firstDay = new Date(Date.UTC(year, month0, 1)); const startDow = firstDay.getUTCDay(); const daysInMonth = new Date( From df792896e09ef1565bbbe0f6220a0828e68b50f5 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Thu, 3 Dec 2026 16:12:52 -0500 Subject: [PATCH 3/6] Share single releasesData.ts source of truth across overview and schedule calendar Signed-off-by: Peter Abbondanzo --- .../src/components/releases/ReleasesTable.tsx | 68 ++++- .../components/releases/_releases-table.md | 16 -- .../components/releases/releaseSchedule.ts | 265 +++++++----------- .../src/components/releases/releasesData.ts | 144 ++++++++++ 4 files changed, 304 insertions(+), 189 deletions(-) delete mode 100644 website/src/components/releases/_releases-table.md create mode 100644 website/src/components/releases/releasesData.ts diff --git a/website/src/components/releases/ReleasesTable.tsx b/website/src/components/releases/ReleasesTable.tsx index d1022b3d822..9687fe9aeb0 100644 --- a/website/src/components/releases/ReleasesTable.tsx +++ b/website/src/components/releases/ReleasesTable.tsx @@ -1,5 +1,67 @@ -import ReleasesTableMD from './_releases-table.md'; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ -export default function ReleasesTable() { - return ; +import Link from '@docusaurus/Link'; +import type {ReactNode} from 'react'; + +import {RELEASES, type ReleaseRecord} from './releasesData'; +import type {SupportStatus} from './releaseSchedule'; + +function getSupportStatus( + release: ReleaseRecord, + releasedRank: number +): SupportStatus { + if (!release.released) { + return 'Future'; + } + if (releasedRank === 0 || releasedRank === 1) { + return 'Active'; + } + if (releasedRank === 2) { + return 'End of Cycle'; + } + return 'Unsupported'; +} + +export default function ReleasesTable(): ReactNode { + let releasedRank = 0; + + return ( +
+ + + + + + + + + + + + {RELEASES.map(release => { + const support = getSupportStatus(release, releasedRank); + if (release.released) { + releasedRank += 1; + } + return ( + + + + + + + + ); + })} + +
VersionBranch cut dateRelease dateSupportBlog post
{release.version}.x{release.branchCut}{release.releaseDate}{support} + {release.blog ? Details : null} +
+
+ ); } diff --git a/website/src/components/releases/_releases-table.md b/website/src/components/releases/_releases-table.md deleted file mode 100644 index 9a323d1d7f1..00000000000 --- a/website/src/components/releases/_releases-table.md +++ /dev/null @@ -1,16 +0,0 @@ -| Version | Branch cut date | Release date | Support | Blog post | -| ------- | --------------- | ------------ | ------------ | --------------------------------------------- | -| 0.90.x | 2027-01-04 | 2027-02-08 | Future | | -| 0.89.x | 2026-11-02 | 2026-12-07 | Future | | -| 0.88.x | 2026-09-07 | 2026-10-15 | Active | [Details](/blog/2026/10/19/react-native-0.88) | -| 0.87.x | 2026-07-06 | 2026-08-11 | Active | [Details](/blog/2026/08/11/react-native-0.87) | -| 0.86.x | 2026-05-04 | 2026-06-09 | End of Cycle | [Details](/blog/2026/06/11/react-native-0.86) | -| 0.85.x | 2026-03-02 | 2026-04-06 | Unsupported | [Details](/blog/2026/04/07/react-native-0.85) | -| 0.84.x | 2026-01-05 | 2026-02-09 | Unsupported | [Details](/blog/2026/02/11/react-native-0.84) | -| 0.83.x | 2025-11-03 | 2025-12-10 | Unsupported | [Details](/blog/2025/12/10/react-native-0.83) | -| 0.82.x | 2025-09-01 | 2025-10-06 | Unsupported | [Details](/blog/2025/10/08/react-native-0.82) | -| 0.81.x | 2025-07-10 | 2025-08-12 | Unsupported | [Details](/blog/2025/08/12/react-native-0.81) | -| 0.80.x | 2025-05-07 | 2025-06-12 | Unsupported | [Details](/blog/2025/06/12/react-native-0.80) | -| 0.79.x | 2025-03-04 | 2025-04-08 | Unsupported | [Details](/blog/2025/04/08/react-native-0.79) | -| 0.78.x | 2025-01-15 | 2025-02-19 | Unsupported | [Details](/blog/2025/02/19/react-native-0.78) | -| 0.77.x | 2024-11-26 | 2025-01-21 | Unsupported | [Details](/blog/2025/01/21/version-0.77) | diff --git a/website/src/components/releases/releaseSchedule.ts b/website/src/components/releases/releaseSchedule.ts index c7500c05a54..190a1f041fd 100644 --- a/website/src/components/releases/releaseSchedule.ts +++ b/website/src/components/releases/releaseSchedule.ts @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +import {RELEASES, type ReleaseRecord} from './releasesData'; + export type SupportStatus = 'Future' | 'Active' | 'End of Cycle' | 'Unsupported'; @@ -52,15 +54,6 @@ export interface GitHubSeriesData { patches: GitHubTagInfo[]; } -export interface PublishedReleaseAnchor { - minorNum: number; - version: string; - branchCut: string; - releaseDate: string; - blog: string; - releaseType: 'Breaking' | 'Non-breaking'; -} - export interface ScheduledRelease { minorNum: number; version: string; @@ -114,121 +107,6 @@ export const GITHUB_RELEASES_API_URL = export const GITHUB_RELEASES_PAGE_URL = 'https://github.com/react/react-native/releases'; -/** - * Published release history synced with - * `website/src/components/releases/_releases-table.md`. - */ -export const HISTORICAL_RELEASES: readonly PublishedReleaseAnchor[] = [ - { - minorNum: 77, - version: '0.77', - branchCut: '2024-11-26', - releaseDate: '2025-01-21', - blog: '/blog/2025/01/21/version-0.77', - releaseType: 'Breaking', - }, - { - minorNum: 78, - version: '0.78', - branchCut: '2025-01-15', - releaseDate: '2025-02-19', - blog: '/blog/2025/02/19/react-native-0.78', - releaseType: 'Breaking', - }, - { - minorNum: 79, - version: '0.79', - branchCut: '2025-03-04', - releaseDate: '2025-04-08', - blog: '/blog/2025/04/08/react-native-0.79', - releaseType: 'Breaking', - }, - { - minorNum: 80, - version: '0.80', - branchCut: '2025-05-07', - releaseDate: '2025-06-12', - blog: '/blog/2025/06/12/react-native-0.80', - releaseType: 'Breaking', - }, - { - minorNum: 81, - version: '0.81', - branchCut: '2025-07-10', - releaseDate: '2025-08-12', - blog: '/blog/2025/08/12/react-native-0.81', - releaseType: 'Breaking', - }, - { - minorNum: 82, - version: '0.82', - branchCut: '2025-09-01', - releaseDate: '2025-10-06', - blog: '/blog/2025/10/08/react-native-0.82', - releaseType: 'Breaking', - }, - { - minorNum: 83, - version: '0.83', - branchCut: '2025-11-03', - releaseDate: '2025-12-10', - blog: '/blog/2025/12/10/react-native-0.83', - releaseType: 'Non-breaking', - }, - { - minorNum: 84, - version: '0.84', - branchCut: '2026-01-05', - releaseDate: '2026-02-09', - blog: '/blog/2026/02/11/react-native-0.84', - releaseType: 'Breaking', - }, - { - minorNum: 85, - version: '0.85', - branchCut: '2026-03-02', - releaseDate: '2026-04-06', - blog: '/blog/2026/04/07/react-native-0.85', - releaseType: 'Breaking', - }, - { - minorNum: 86, - version: '0.86', - branchCut: '2026-05-04', - releaseDate: '2026-06-09', - blog: '/blog/2026/06/11/react-native-0.86', - releaseType: 'Non-breaking', - }, - { - minorNum: 87, - version: '0.87', - branchCut: '2026-07-06', - releaseDate: '2026-08-11', - blog: '/blog/2026/08/11/react-native-0.87', - releaseType: 'Breaking', - }, - { - minorNum: 88, - version: '0.88', - branchCut: '2026-09-07', - releaseDate: '2026-10-15', - blog: '/blog/2026/10/19/react-native-0.88', - releaseType: 'Non-breaking', - }, -]; - -/** - * First upcoming release slot (0.89 begins Nov 2026). - * 0.89 and 0.90 are published as Future rows in `_releases-table.md`. - */ -export const ANCHOR_START = { - year: 2026, - month: 11, - minorNum: 89, -} as const; - -export const PUBLISHED_FUTURE_SLOTS = 2; - /** * Deterministic SSR baseline date; updated to the visitor's local date on * client mount to avoid React hydration mismatches. @@ -250,21 +128,6 @@ export const MONTH_NAMES = [ 'December', ] as const; -export const MONTH_SHORT = [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'May', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Oct', - 'Nov', - 'Dec', -] as const; - export const DOW_SHORT = [ 'Sun', 'Mon', @@ -346,6 +209,27 @@ export function firstMondayOfMonth(year: number, month1Based: number): string { return toISO(first); } +function parseMinorNumber(version: string): number { + const parts = version.split('.').map(Number); + return parts[1] ?? 0; +} + +function nextOddMonth( + year: number, + month1Based: number +): { + year: number; + month: number; +} { + let nextMonth = month1Based % 2 === 1 ? month1Based + 2 : month1Based + 1; + let nextYear = year; + if (nextMonth > 12) { + nextMonth -= 12; + nextYear += 1; + } + return {year: nextYear, month: nextMonth}; +} + /** * Parses GitHub Releases API rows from `react/react-native` into per-series * RC, stable, and patch records sorted ascending by version number. @@ -505,7 +389,7 @@ function buildFutureMilestones( } function buildHistoricalMilestones( - h: PublishedReleaseAnchor, + h: ReleaseRecord, ghSeries?: GitHubSeriesData ): ReleaseMilestone[] { const defaultStableUrl = `${GITHUB_RELEASES_PAGE_URL}/tag/v${h.version}.0`; @@ -586,40 +470,82 @@ function buildHistoricalMilestones( function generateFutureSeries( count: number, options: ScheduleOptions, + publishedAsc: readonly ReleaseRecord[], + scheduledFutureAsc: readonly ReleaseRecord[], githubBySeries?: Map ): ScheduledRelease[] { const result: ScheduledRelease[] = []; - let year: number = ANCHOR_START.year; - let month: number = ANCHOR_START.month; + + const lastPublished = publishedAsc[publishedAsc.length - 1]; + const firstScheduled = scheduledFutureAsc[0]; + + let startMinor: number; + let year: number; + let month: number; + + if (firstScheduled) { + startMinor = parseMinorNumber(firstScheduled.version); + const dt = parseISO(firstScheduled.branchCut); + year = dt.getUTCFullYear(); + month = dt.getUTCMonth() + 1; + } else if (lastPublished) { + startMinor = parseMinorNumber(lastPublished.version) + 1; + const dt = parseISO(lastPublished.branchCut); + const next = nextOddMonth(dt.getUTCFullYear(), dt.getUTCMonth() + 1); + year = next.year; + month = next.month; + } else { + startMinor = 89; + year = 2026; + month = 11; + } + + const firstFutureIsBreaking = firstScheduled + ? firstScheduled.releaseType === 'Breaking' + : lastPublished?.releaseType !== 'Breaking'; for (let i = 0; i < count; i++) { - const minorNum = ANCHOR_START.minorNum + i; - const branchCut = firstMondayOfMonth(year, month); - const releaseDate = addDays(branchCut, options.rcWeeks * 7); + const scheduledAnchor = scheduledFutureAsc[i]; + const minorNum = startMinor + i; + const defaultBranchCut = firstMondayOfMonth(year, month); + const useScheduledAnchor = + Boolean(scheduledAnchor) && + options.rcWeeks === 5 && + options.versioning === 'zero-x'; + + const branchCut = useScheduledAnchor + ? scheduledAnchor.branchCut + : defaultBranchCut; + const releaseDate = useScheduledAnchor + ? scheduledAnchor.releaseDate + : addDays(branchCut, options.rcWeeks * 7); const patchDate = addDays(releaseDate, 7); const goldenDate = addDays(branchCut, (options.rcWeeks - 1) * 7); let version = `0.${minorNum}`; - let releaseType = 'Breaking'; + let releaseType = ''; - if (options.versioning === 'semver-1-2027' && i >= 3) { - const semverIdx = i - 3; + // Semver 1.0+ RFC mode: transitions to 1.0 starting from May 2027 (0.92 slot) + if (options.versioning === 'semver-1-2027' && minorNum >= 92) { + const semverIdx = minorNum - 92; const major = Math.floor(semverIdx / 3) + 1; const minor = semverIdx % 3; version = `${major}.${minor}`; releaseType = minor === 0 ? 'Major (Breaking)' : 'Non-breaking'; } else if (options.breakingMode === 'alternating') { - releaseType = i % 2 === 0 ? 'Breaking' : 'Non-breaking'; + if (scheduledAnchor) { + releaseType = scheduledAnchor.releaseType; + } else { + const isBreaking = + i % 2 === 0 ? firstFutureIsBreaking : !firstFutureIsBreaking; + releaseType = isBreaking ? 'Breaking' : 'Non-breaking'; + } } else if (options.breakingMode === 'major-2x') { - if (i === 0) { - releaseType = 'Breaking'; - } else if (i === 1) { - releaseType = 'Non-breaking'; + if (scheduledAnchor) { + releaseType = scheduledAnchor.releaseType; } else { - releaseType = (i - 2) % 3 === 0 ? 'Breaking' : 'Non-breaking'; + releaseType = (minorNum - 91) % 3 === 0 ? 'Breaking' : 'Non-breaking'; } - } else { - releaseType = ''; } const ghSeries = githubBySeries?.get(version); @@ -641,11 +567,6 @@ function generateFutureSeries( goldenDate; const effectivePatchDate = ghSeries?.patches[0]?.date ?? patchDate; - const isPublishedFuture = - i < PUBLISHED_FUTURE_SLOTS && - options.rcWeeks === 5 && - options.versioning === 'zero-x'; - result.push({ minorNum, version, @@ -660,18 +581,16 @@ function generateFutureSeries( latestRc, stableReleaseUrl: ghSeries?.stable?.url ?? null, releaseType, - source: isPublishedFuture ? 'overview-future' : 'projected', + source: useScheduledAnchor ? 'overview-future' : 'projected', support: 'Future', inRC: false, isLatestStable: false, milestones, }); - month += 2; - if (month > 12) { - month -= 12; - year += 1; - } + const next = nextOddMonth(year, month); + year = next.year; + month = next.month; } return result; @@ -681,15 +600,21 @@ export function buildReleaseSchedule( options: ScheduleOptions, githubBySeries?: Map ): ScheduleResult { + const recordsAsc = [...RELEASES].reverse(); + const publishedAsc = recordsAsc.filter(r => r.released); + const scheduledFutureAsc = recordsAsc.filter(r => !r.released); + // Generate 3 extra lookahead releases so End of Cycle and Unsupported dates // are available for every visible row. const futureWithLookahead = generateFutureSeries( options.futureCount + 3, options, + publishedAsc, + scheduledFutureAsc, githubBySeries ); - const history: ScheduledRelease[] = HISTORICAL_RELEASES.map(h => { + const history: ScheduledRelease[] = publishedAsc.map(h => { const ghSeries = githubBySeries?.get(h.version); const latestRc = ghSeries && ghSeries.rcs.length > 0 @@ -698,7 +623,7 @@ export function buildReleaseSchedule( const firstPatch = ghSeries?.patches[0] ?? null; return { - minorNum: h.minorNum, + minorNum: parseMinorNumber(h.version), version: h.version, branchCut: h.branchCut, goldenDate: latestRc ? latestRc.date : addDays(h.releaseDate, -7), @@ -706,7 +631,7 @@ export function buildReleaseSchedule( patchDate: firstPatch ? firstPatch.date : addDays(h.releaseDate, 7), eocDate: null, eolDate: null, - blog: h.blog, + blog: h.blog ?? '', githubSearchUrl: `${GITHUB_RELEASES_PAGE_URL}?q=v${h.version}`, latestRc, stableReleaseUrl: diff --git a/website/src/components/releases/releasesData.ts b/website/src/components/releases/releasesData.ts new file mode 100644 index 00000000000..ca5b0a8f431 --- /dev/null +++ b/website/src/components/releases/releasesData.ts @@ -0,0 +1,144 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +export type ReleaseType = 'Breaking' | 'Non-breaking'; + +export interface ReleaseRecord { + /** Minor series version, e.g. '0.89' (rendered as '0.89.x'). */ + version: string; + /** ISO date (YYYY-MM-DD) when the release branch was or will be cut. */ + branchCut: string; + /** ISO date (YYYY-MM-DD) when the .0 release was or will be published. */ + releaseDate: string; + /** True once .0 has shipped; omit or false for upcoming Future releases. */ + released?: boolean; + /** Path to the release announcement blog post once published. */ + blog?: string; + /** Breaking vs. non-breaking classification for the release cadence. */ + releaseType: ReleaseType; +} + +/** + * Single source of truth for React Native release dates used by both + * `/releases/overview` (`ReleasesTable`) and `/releases/schedule` + * (`ReleaseScheduleCalendar`). + * + * Keep entries ordered newest-first. Support status (`Future`, `Active`, + * `End of Cycle`, `Unsupported`) is derived automatically from `released` + * (the latest 2 released series are Active, the 3rd is End of Cycle, and + * older series are Unsupported). + */ +export const RELEASES: readonly ReleaseRecord[] = [ + { + version: '0.90', + branchCut: '2027-01-04', + releaseDate: '2027-02-08', + releaseType: 'Non-breaking', + }, + { + version: '0.89', + branchCut: '2026-11-02', + releaseDate: '2026-12-07', + releaseType: 'Breaking', + }, + { + version: '0.88', + branchCut: '2026-09-07', + releaseDate: '2026-10-15', + released: true, + blog: '/blog/2026/10/19/react-native-0.88', + releaseType: 'Non-breaking', + }, + { + version: '0.87', + branchCut: '2026-07-06', + releaseDate: '2026-08-11', + released: true, + blog: '/blog/2026/08/11/react-native-0.87', + releaseType: 'Breaking', + }, + { + version: '0.86', + branchCut: '2026-05-04', + releaseDate: '2026-06-09', + released: true, + blog: '/blog/2026/06/11/react-native-0.86', + releaseType: 'Non-breaking', + }, + { + version: '0.85', + branchCut: '2026-03-02', + releaseDate: '2026-04-06', + released: true, + blog: '/blog/2026/04/07/react-native-0.85', + releaseType: 'Breaking', + }, + { + version: '0.84', + branchCut: '2026-01-05', + releaseDate: '2026-02-09', + released: true, + blog: '/blog/2026/02/11/react-native-0.84', + releaseType: 'Breaking', + }, + { + version: '0.83', + branchCut: '2025-11-03', + releaseDate: '2025-12-10', + released: true, + blog: '/blog/2025/12/10/react-native-0.83', + releaseType: 'Non-breaking', + }, + { + version: '0.82', + branchCut: '2025-09-01', + releaseDate: '2025-10-06', + released: true, + blog: '/blog/2025/10/08/react-native-0.82', + releaseType: 'Breaking', + }, + { + version: '0.81', + branchCut: '2025-07-10', + releaseDate: '2025-08-12', + released: true, + blog: '/blog/2025/08/12/react-native-0.81', + releaseType: 'Breaking', + }, + { + version: '0.80', + branchCut: '2025-05-07', + releaseDate: '2025-06-12', + released: true, + blog: '/blog/2025/06/12/react-native-0.80', + releaseType: 'Breaking', + }, + { + version: '0.79', + branchCut: '2025-03-04', + releaseDate: '2025-04-08', + released: true, + blog: '/blog/2025/04/08/react-native-0.79', + releaseType: 'Breaking', + }, + { + version: '0.78', + branchCut: '2025-01-15', + releaseDate: '2025-02-19', + released: true, + blog: '/blog/2025/02/19/react-native-0.78', + releaseType: 'Breaking', + }, + { + version: '0.77', + branchCut: '2024-11-26', + releaseDate: '2025-01-21', + released: true, + blog: '/blog/2025/01/21/version-0.77', + releaseType: 'Breaking', + }, +]; From 8f0f89df3106a0c4e36faa4b97d29a4f95dd7cb7 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Fri, 4 Dec 2026 11:53:06 -0500 Subject: [PATCH 4/6] Hardcode release calendar from shared data and align styles with site theme Remove the future-version projection controls; the calendar now renders only the releases listed in releasesData.ts, enriched with GitHub Releases tags. Reuse the home page button palette and site theme variables for buttons, tabs, cards, pills, calendar cells and the support timeline in light and dark mode. Signed-off-by: Peter Abbondanzo --- website/releases/schedule.mdx | 4 +- .../ReleaseScheduleCalendar.module.css | 481 ++++++++----- .../releases/ReleaseScheduleCalendar.tsx | 673 ++++++------------ .../src/components/releases/ReleasesTable.tsx | 24 +- .../components/releases/releaseSchedule.ts | 412 +++-------- .../src/components/releases/releasesData.ts | 19 + 6 files changed, 654 insertions(+), 959 deletions(-) diff --git a/website/releases/schedule.mdx b/website/releases/schedule.mdx index 66ffcb1f4c8..90aa5ccab84 100644 --- a/website/releases/schedule.mdx +++ b/website/releases/schedule.mdx @@ -6,12 +6,12 @@ hide_table_of_contents: true import ReleaseScheduleCalendar from '@site/src/components/releases/ReleaseScheduleCalendar'; -Explore projected React Native release dates, weekly release candidate milestones, and support windows for upcoming versions. For currently published versions and support definitions, see the [Releases Overview](/releases/overview). +View upcoming and recent React Native releases, release candidate milestones, and support windows. For support level definitions and release channels, see the [Releases Overview](/releases/overview). :::note -Projected dates follow the standard React Native release cadence: branch cuts (`RC0`) on the **first Monday of every odd-numbered month**, followed by a **5-week RC stabilization window** (`RC4` as Golden RC) and support for the **latest 3 minor series**. Actual dates may shift for holidays or stabilization blockers. +Release dates are shared with the [Releases Overview](/releases/overview) table and enriched with published release candidate tags from [GitHub Releases](https://github.com/react/react-native/releases). Actual dates may shift for stabilization blockers. ::: diff --git a/website/src/components/releases/ReleaseScheduleCalendar.module.css b/website/src/components/releases/ReleaseScheduleCalendar.module.css index bea9000788a..ffd04d7d0bb 100644 --- a/website/src/components/releases/ReleaseScheduleCalendar.module.css +++ b/website/src/components/releases/ReleaseScheduleCalendar.module.css @@ -6,39 +6,60 @@ */ .root { - --rn-cal-dot-cut: #087ea4; - --rn-cal-dot-rc: #6f42c1; - --rn-cal-dot-golden: #d97706; - --rn-cal-dot-stable: #22863a; - --rn-cal-dot-patch: #0d9488; - --rn-cal-now: #d73a49; + --rn-cal-dot-cut: var(--home-button-primary); + --rn-cal-dot-rc: var(--home-code-purple); + --rn-cal-dot-golden: #c87400; + --rn-cal-dot-stable: var(--home-code-green); + --rn-cal-dot-patch: #0f8b8d; + --rn-cal-now: var(--home-code-red); + --rn-cal-seg-rc-bg: var(--home-feature-background-1); + --rn-cal-seg-rc-fg: #5930a3; + --rn-cal-seg-rc-border: rgb(111 66 193 / 0.35); + --rn-cal-seg-active-bg: var(--home-feature-background-3); + --rn-cal-seg-active-fg: #155d27; + --rn-cal-seg-active-border: rgb(34 134 58 / 0.35); + --rn-cal-seg-eoc-bg: rgb(255 229 100 / 0.35); + --rn-cal-seg-eoc-fg: #7c4a00; + --rn-cal-seg-eoc-border: rgb(200 116 0 / 0.38); + --ifm-tabs-color-active: var(--home-button-primary); + --ifm-tabs-color-active-border: var(--home-button-primary); display: flex; flex-direction: column; - gap: 1rem; + gap: 1.25rem; margin-bottom: 1.5rem; } [data-theme="dark"] .root { - --rn-cal-dot-cut: #58c4dc; - --rn-cal-dot-rc: #a77cf7; --rn-cal-dot-golden: #fb923c; - --rn-cal-dot-stable: #74e68f; --rn-cal-dot-patch: #2dd4bf; - --rn-cal-now: #f46b78; -} - + --rn-cal-seg-rc-bg: var(--home-feature-background-1); + --rn-cal-seg-rc-fg: #d4bfff; + --rn-cal-seg-rc-border: rgb(167 124 247 / 0.4); + --rn-cal-seg-active-bg: var(--home-feature-background-3); + --rn-cal-seg-active-fg: #8df0a5; + --rn-cal-seg-active-border: rgb(116 230 143 / 0.38); + --rn-cal-seg-eoc-bg: rgb(251 146 60 / 0.16); + --rn-cal-seg-eoc-fg: #fdba74; + --rn-cal-seg-eoc-border: rgb(251 146 60 / 0.38); +} + +/* Summary KPIs */ .kpiGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; } -.kpiBody { +.kpiCard { + background-color: var(--home-background); + border: 1px solid var(--home-border); + border-radius: var(--ifm-global-radius); + box-shadow: var(--ifm-table-box-shadow); + padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; - padding: 0.75rem 1rem; } .kpiLabel { @@ -50,6 +71,7 @@ .kpiValue { font-size: 1.05rem; font-weight: 700; + color: var(--ifm-font-color-base); } .kpiSub { @@ -57,100 +79,129 @@ color: var(--subtle); } -.controlsRow { - display: flex; - flex-wrap: wrap; - align-items: flex-end; - gap: 0.75rem; +/* Buttons — match Home page "Get Started" & "Learn the Basics" shades */ +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.35rem; + height: 32px; + padding: 0 0.75rem; + border-radius: 7px; + border: 1px solid var(--home-button-secondary-border); + background-color: var(--home-button-secondary); + color: var(--home-button-secondary-text); + font-family: inherit; + font-size: 0.82rem; + font-weight: 500; + line-height: 1; + cursor: pointer; + white-space: nowrap; + transition: + background-color 150ms ease, + border-color 150ms ease, + color 150ms ease; } -.field { - display: flex; - flex-direction: column; - gap: 0.25rem; - min-width: 148px; +.btn:hover:not(:disabled) { + background-color: var(--home-button-secondary-hover); + border-color: var(--ifm-color-emphasis-500); } -.fieldLabel { - font-size: 0.78rem; - font-weight: 500; - color: var(--subtle); +.btn:disabled { + opacity: 0.42; + cursor: not-allowed; } -.selectWrap { - position: relative; - display: flex; - align-items: center; +.btnIcon { + padding: 0 0.5rem; } -.selectCaret { - position: absolute; - right: 0.6rem; - width: 14px; - height: 14px; - color: var(--subtle); - pointer-events: none; +.btnPrimary { + background-color: var(--home-button-primary); + border-color: var(--home-button-primary); + color: var(--home-button-primary-text); + font-weight: 600; } -.select, -.dateInput { - height: 36px; - width: 100%; - padding: 0 0.7rem; - border: 1px solid var(--ifm-color-emphasis-300); - border-radius: 6px; - background: var(--ifm-background-color); - color: var(--ifm-font-color-base); - font-family: inherit; - font-size: 0.85rem; +.btnPrimary:hover:not(:disabled) { + background-color: var(--home-button-primary-hover); + border-color: var(--home-button-primary-hover); + color: var(--home-button-primary-text); } -.select { - appearance: none; - padding-right: 2.1rem; - cursor: pointer; +.btnGroup { + display: inline-flex; + align-items: center; } -[data-theme="dark"] .dateInput { - color-scheme: dark; +.btnGroup .btn { + border-radius: 0; + margin-left: -1px; } -.fieldInline { - display: flex; - align-items: center; - height: 36px; +.btnGroup .btn:first-child { + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + margin-left: 0; } -.checkboxLabel { +.btnGroup .btn:last-child { + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; +} + +.btnGroup .btnPrimary { + position: relative; + z-index: 1; +} + +.filterChip { display: inline-flex; align-items: center; - gap: 0.4rem; - font-size: 0.85rem; + gap: 0.38rem; + height: 30px; + padding: 0 0.65rem; + border-radius: 999px; + border: 1px solid var(--home-button-secondary-border); + background-color: var(--home-button-secondary); + color: var(--subtle); + font-family: inherit; + font-size: 0.78rem; + font-weight: 500; cursor: pointer; - user-select: none; + white-space: nowrap; + transition: + background-color 150ms ease, + border-color 150ms ease, + color 150ms ease; } -.spacer { - flex: 1 1 auto; +.filterChip:hover { + background-color: var(--home-button-secondary-hover); + color: var(--ifm-font-color-base); } -.advancedPanel { - margin-top: 0.75rem; - padding-top: 0.75rem; - border-top: 1px solid var(--ifm-table-border-color); - display: flex; - flex-wrap: wrap; - align-items: flex-end; - gap: 0.75rem; +.filterChipActive { + background-color: var(--sidebar-active-item-background); + border-color: var(--home-button-primary); + color: var(--ifm-font-color-base); + font-weight: 600; +} + +.filterChipActive:hover { + background-color: var(--sidebar-active-item-background); + border-color: var(--home-button-primary-hover); } +/* Tabs header */ .tabsHeader { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; - gap: 0.5rem; - margin-bottom: 0.85rem; + gap: 0.75rem; + margin-bottom: 1rem; border-bottom: 1px solid var(--ifm-table-border-color); } @@ -160,6 +211,7 @@ align-items: stretch; margin: 0; padding: 0; + border-bottom: 0; } .tabButton { @@ -173,13 +225,30 @@ line-height: 1.4; } +.tabsRight { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.85rem; + padding-bottom: 0.4rem; +} + +.checkboxLabel { + display: inline-flex; + align-items: center; + gap: 0.4rem; + font-size: 0.82rem; + color: var(--subtle); + cursor: pointer; + user-select: none; +} + .syncBar { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--subtle); - padding-bottom: 0.35rem; } .syncDot { @@ -203,10 +272,15 @@ font-size: 0.84rem; } +/* Table */ .releaseRow { cursor: pointer; } +.releaseRow:hover td { + background-color: var(--ifm-menu-color-background-hover); +} + .versionCell { display: flex; align-items: center; @@ -263,7 +337,7 @@ display: flex; flex-direction: column; align-items: flex-start; - gap: 0.25rem; + gap: 0.2rem; } .supportCellStack { @@ -279,6 +353,7 @@ line-height: 1.3; } +/* Pills — aligned with website light & dark palette */ .pill { display: inline-flex; align-items: center; @@ -295,75 +370,63 @@ } .pillSuccess { - background: rgb(34 134 58 / 0.16); - color: #1b6b2e; - border-color: rgb(34 134 58 / 0.3); + background: var(--home-feature-background-3); + color: #155d27; + border-color: rgb(34 134 58 / 0.25); } .pillInfo { - background: rgb(8 126 164 / 0.14); - color: #066382; - border-color: rgb(8 126 164 / 0.3); + background: var(--sidebar-active-item-background); + color: var(--home-button-primary); + border-color: rgb(8 126 164 / 0.25); } .pillPrimary { - background: rgb(111 66 193 / 0.14); - color: #5930a3; - border-color: rgb(111 66 193 / 0.3); + background: var(--home-feature-background-1); + color: var(--home-code-purple); + border-color: rgb(111 66 193 / 0.25); } .pillWarning { - background: rgb(217 119 6 / 0.15); - color: #9a4a00; - border-color: rgb(217 119 6 / 0.32); -} - -.pillDanger { - background: rgb(215 58 73 / 0.15); - color: #a41d2a; - border-color: rgb(215 58 73 / 0.32); + background: var(--rn-note-background); + color: #8a5300; + border-color: rgb(200 116 0 / 0.3); } .pillSecondary { - background: var(--ifm-table-head-background); - color: var(--ifm-font-color-base); - border-color: var(--ifm-table-border-color); + background: var(--home-secondary-background); + color: var(--subtle); + border-color: var(--home-border); } [data-theme="dark"] .pillSuccess { - background: rgb(116 230 143 / 0.16); - color: #8df0a5; + background: var(--home-feature-background-3); + color: var(--home-code-green); border-color: rgb(116 230 143 / 0.3); } [data-theme="dark"] .pillInfo { - background: rgb(88 196 220 / 0.16); - color: #7de0f5; - border-color: rgb(88 196 220 / 0.3); + background: var(--home-feature-background-2); + color: var(--home-button-primary); + border-color: rgb(88 196 220 / 0.32); } [data-theme="dark"] .pillPrimary { - background: rgb(167 124 247 / 0.18); - color: #c6abff; - border-color: rgb(167 124 247 / 0.35); + background: var(--home-feature-background-1); + color: #c4a7fb; + border-color: rgb(167 124 247 / 0.32); } [data-theme="dark"] .pillWarning { - background: rgb(251 146 60 / 0.18); + background: rgb(251 146 60 / 0.14); color: #fdba74; - border-color: rgb(251 146 60 / 0.35); -} - -[data-theme="dark"] .pillDanger { - background: rgb(244 107 120 / 0.18); - color: #fda4af; - border-color: rgb(244 107 120 / 0.35); + border-color: rgb(251 146 60 / 0.32); } [data-theme="dark"] .pillSecondary { - background: rgb(255 255 255 / 0.08); - color: var(--ifm-font-color-base); - border-color: var(--ifm-table-border-color); + background: var(--deepdark); + color: var(--subtle); + border-color: var(--home-border); } .infoPill { @@ -374,10 +437,11 @@ position: fixed; z-index: 1000; transform: translate(-50%, calc(-100% - 8px)); - padding: 0.35rem 0.6rem; + padding: 0.38rem 0.65rem; border-radius: 6px; background: var(--deepdark); color: #fff; + border: 1px solid var(--dark); font-family: var(--ifm-font-family-base); font-size: 0.75rem; font-weight: 500; @@ -385,9 +449,16 @@ max-width: 280px; white-space: normal; pointer-events: none; - box-shadow: 0 4px 12px rgb(0 0 0 / 0.25); + box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); } +[data-theme="dark"] .tooltip { + background: #2b2f3a; + color: #f6f7f9; + border-color: var(--home-border); +} + +/* Expanded release timeline */ .detailCell { padding: 0; } @@ -396,7 +467,7 @@ white-space: normal; font-weight: 400; text-align: left; - padding: 0.85rem 1.1rem; + padding: 0.9rem 1.15rem; width: 100%; display: flex; flex-direction: column; @@ -503,14 +574,14 @@ align-items: center; justify-content: space-between; gap: 0.75rem; - margin-bottom: 0.75rem; + margin-bottom: 0.85rem; } .calNav { display: inline-flex; flex-wrap: wrap; align-items: center; - gap: 0.45rem; + gap: 0.5rem; } .calTitle { @@ -526,12 +597,6 @@ gap: 0.4rem; } -.filterChip { - display: inline-flex; - align-items: center; - gap: 0.35rem; -} - .dot { width: 8px; height: 8px; @@ -563,9 +628,11 @@ .monthGrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); - border-top: 1px solid var(--ifm-table-border-color); - border-left: 1px solid var(--ifm-table-border-color); + background-color: var(--home-background); + border-top: 1px solid var(--home-border); + border-left: 1px solid var(--home-border); border-radius: var(--ifm-global-radius); + box-shadow: var(--ifm-table-box-shadow); overflow: hidden; } @@ -575,28 +642,32 @@ font-weight: 600; color: var(--subtle); background: var(--ifm-table-head-background); - border-right: 1px solid var(--ifm-table-border-color); - border-bottom: 1px solid var(--ifm-table-border-color); + border-right: 1px solid var(--home-border); + border-bottom: 1px solid var(--home-border); text-align: center; } .dayCell { min-height: 88px; padding: 0.35rem; - border-right: 1px solid var(--ifm-table-border-color); - border-bottom: 1px solid var(--ifm-table-border-color); + border-right: 1px solid var(--home-border); + border-bottom: 1px solid var(--home-border); display: flex; flex-direction: column; gap: 0.25rem; } .dayOutside { - background: var(--ifm-table-head-background); - opacity: 0.6; + background: var(--home-secondary-background); + opacity: 0.65; +} + +[data-theme="dark"] .dayOutside { + background: var(--deepdark); } .dayToday { - box-shadow: inset 0 0 0 2px var(--logo); + box-shadow: inset 0 0 0 1.5px var(--home-button-primary); } .dayHeader { @@ -609,17 +680,17 @@ .todayPip { font-size: 0.68rem; - color: var(--logo); + color: var(--home-button-primary); } .evPill { display: flex; align-items: center; - gap: 0.25rem; - padding: 0.15rem 0.35rem; - border-radius: 4px; - border: 1px solid var(--ifm-table-border-color); - background: var(--ifm-table-head-background); + gap: 0.3rem; + padding: 0.18rem 0.4rem; + border-radius: 5px; + border: 1px solid var(--home-border); + background: var(--home-secondary-background); color: var(--ifm-font-color-base); font-family: inherit; font-size: 0.72rem; @@ -630,6 +701,18 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + transition: + background-color 150ms ease, + border-color 150ms ease; +} + +[data-theme="dark"] .evPill { + background: var(--deepdark); +} + +.evPill:hover { + background: var(--sidebar-active-item-background); + border-color: var(--home-button-primary); } .yearGrid { @@ -639,9 +722,11 @@ } .miniMonth { - border: 1px solid var(--ifm-table-border-color); + background-color: var(--home-background); + border: 1px solid var(--home-border); border-radius: var(--ifm-global-radius); - padding: 0.65rem; + box-shadow: var(--ifm-table-box-shadow); + padding: 0.7rem; display: flex; flex-direction: column; gap: 0.45rem; @@ -664,6 +749,10 @@ cursor: pointer; } +.miniMonthTitle:hover { + color: var(--home-button-primary); +} + .miniGrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); @@ -685,7 +774,7 @@ justify-content: center; padding: 0; border: 1px solid transparent; - border-radius: 4px; + border-radius: 5px; line-height: 1; width: 100%; box-sizing: border-box; @@ -696,25 +785,36 @@ } .miniDayToday { - box-shadow: inset 0 0 0 1.5px var(--logo); + box-shadow: inset 0 0 0 1.5px var(--home-button-primary); font-weight: 700; } .miniDayEv { font-weight: 700; cursor: pointer; - border-color: var(--ifm-table-border-color); - background: var(--ifm-table-head-background); + border-color: rgb(8 126 164 / 0.3); + background: var(--sidebar-active-item-background); color: var(--ifm-font-color-base); font-family: inherit; font-size: inherit; + transition: + background-color 150ms ease, + border-color 150ms ease; +} + +[data-theme="dark"] .miniDayEv { + border-color: rgb(88 196 220 / 0.32); +} + +.miniDayEv:hover { + border-color: var(--home-button-primary); } .miniEvents { display: flex; flex-direction: column; gap: 0.2rem; - padding-top: 0.35rem; + padding-top: 0.4rem; border-top: 1px solid var(--ifm-table-border-color); } @@ -728,15 +828,15 @@ color: var(--ifm-font-color-base); background: transparent; border: 0; - padding: 0.15rem 0.25rem; - border-radius: 4px; + padding: 0.18rem 0.3rem; + border-radius: 5px; cursor: pointer; width: 100%; text-align: left; } .miniEvRow:hover { - background: var(--ifm-table-head-background); + background: var(--ifm-menu-color-background-hover); } .miniEvLeft { @@ -747,11 +847,15 @@ } .inspector { - margin-top: 0.85rem; - padding: 0.85rem 1rem; + margin-top: 0.9rem; + padding: 0.95rem 1.1rem; border-radius: var(--ifm-global-radius); - background: var(--ifm-table-head-background); - border: 1px solid var(--ifm-table-border-color); + background: var(--home-secondary-background); + border: 1px solid var(--home-border); +} + +[data-theme="dark"] .inspector { + background: var(--deepdark); } .inspectorHeader { @@ -773,12 +877,12 @@ line-height: 1.2; } -/* Timeline */ +/* Support Timeline */ .timelineLegend { display: flex; flex-wrap: wrap; - gap: 0.85rem; - margin-bottom: 0.75rem; + gap: 1rem; + margin-bottom: 0.85rem; font-size: 0.8rem; color: var(--subtle); } @@ -786,13 +890,14 @@ .legendItem { display: inline-flex; align-items: center; - gap: 0.35rem; + gap: 0.4rem; } .legendSwatch { width: 12px; height: 12px; border-radius: 3px; + border: 1px solid transparent; display: inline-block; } @@ -831,7 +936,7 @@ display: grid; grid-template-columns: 88px 1fr; align-items: center; - height: 30px; + height: 32px; border-bottom: 1px solid var(--ifm-table-border-color); } @@ -850,28 +955,34 @@ .timelineSeg { position: absolute; top: 6px; - height: 18px; - border-radius: 4px; + height: 20px; + border-radius: 5px; + border: 1px solid transparent; font-size: 0.68rem; font-weight: 600; line-height: 18px; - padding: 0 0.35rem; + padding: 0 0.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - color: #fff; } .segRc { - background: var(--rn-cal-dot-rc); + background: var(--rn-cal-seg-rc-bg); + color: var(--rn-cal-seg-rc-fg); + border-color: var(--rn-cal-seg-rc-border); } .segActive { - background: var(--rn-cal-dot-stable); + background: var(--rn-cal-seg-active-bg); + color: var(--rn-cal-seg-active-fg); + border-color: var(--rn-cal-seg-active-border); } .segEoc { - background: var(--rn-cal-dot-golden); + background: var(--rn-cal-seg-eoc-bg); + color: var(--rn-cal-seg-eoc-fg); + border-color: var(--rn-cal-seg-eoc-border); } .timelineNow { @@ -892,11 +1003,15 @@ color: #fff; font-size: 0.68rem; font-weight: 600; - padding: 1px 0.4rem; + padding: 1px 0.45rem; border-radius: 4px; white-space: nowrap; } +[data-theme="dark"] .timelineNowLabel { + color: #1b1b1d; +} + /* Export */ .exportToolbar { display: flex; @@ -917,17 +1032,27 @@ .exportOptions { display: flex; flex-wrap: wrap; - gap: 0.75rem; + gap: 0.85rem; margin-bottom: 0.75rem; - padding: 0.55rem 0.75rem; - background: var(--ifm-table-head-background); - border-radius: 6px; + padding: 0.6rem 0.85rem; + background: var(--home-secondary-background); + border: 1px solid var(--home-border); + border-radius: var(--ifm-global-radius); +} + +[data-theme="dark"] .exportOptions { + background: var(--deepdark); } .exportPreview { max-height: 420px; overflow: auto; margin: 0; + padding: 0.9rem 1rem; + background: var(--rn-prism-background-color); + color: var(--rn-prism-color); + border: 1px solid var(--home-border); + border-radius: var(--ifm-global-radius); } @media (max-width: 996px) { @@ -949,10 +1074,6 @@ grid-template-columns: 1fr; } - .field { - width: 100%; - } - .dayCell { min-height: 66px; padding: 0.2rem; diff --git a/website/src/components/releases/ReleaseScheduleCalendar.tsx b/website/src/components/releases/ReleaseScheduleCalendar.tsx index ddcba52ee29..936f2432d8b 100644 --- a/website/src/components/releases/ReleaseScheduleCalendar.tsx +++ b/website/src/components/releases/ReleaseScheduleCalendar.tsx @@ -20,7 +20,7 @@ import { GITHUB_RELEASES_API_URL, GITHUB_RELEASES_PAGE_URL, MONTH_NAMES, - SSR_DEFAULT_AS_OF, + SSR_DEFAULT_TODAY, addDays, buildCSV, buildICS, @@ -34,15 +34,14 @@ import { getLocalTodayISO, parseGitHubReleases, parseISO, - type BreakingCadenceMode, type GitHubReleaseApiItem, type GitHubSeriesData, type IcsOptions, type MilestoneKind, type ReleaseMilestone, + type ReleaseType, type ScheduleResult, type ScheduledRelease, - type VersioningMode, } from './releaseSchedule'; import styles from './ReleaseScheduleCalendar.module.css'; @@ -59,18 +58,14 @@ interface CalendarEvent { date: string; } -export interface ReleaseScheduleCalendarProps { - /** Initial number of future releases to project (default: 6). */ - defaultFutureCount?: number; - /** Whether to show published historical releases on load (default: true). */ - defaultShowHistory?: boolean; -} - const GITHUB_CACHE_KEY = 'rn-release-schedule-gh-v1'; const GITHUB_CACHE_TTL_MS = 15 * 60 * 1000; +const RELEASE_CREW_QA_TOOLTIP = + 'Release Crew runs manual verification on RC0, RC1, and the Golden RC before publishing.'; + function pillVariantClass( - variant: 'success' | 'info' | 'primary' | 'warning' | 'danger' | 'secondary' + variant: 'success' | 'info' | 'primary' | 'warning' | 'secondary' ): string { switch (variant) { case 'success': @@ -81,8 +76,6 @@ function pillVariantClass( return styles.pillPrimary; case 'warning': return styles.pillWarning; - case 'danger': - return styles.pillDanger; case 'secondary': return styles.pillSecondary; } @@ -120,17 +113,7 @@ function supportBadge(r: ScheduledRelease): ReactNode { ); } -function typeBadge(releaseType: string): ReactNode { - if (!releaseType) { - return null; - } - if (releaseType.startsWith('Major')) { - return ( - - {releaseType} - - ); - } +function typeBadge(releaseType: ReleaseType): ReactNode { if (releaseType === 'Breaking') { return ( Breaking @@ -172,24 +155,6 @@ function eventShortLabel(ev: CalendarEvent): string { return `${ev.version} ${ev.label}`; } -function SelectCaret() { - return ( - - ); -} - function ExternalArrowIcon() { return ( m.isActual).length; - const projectedCount = milestones.length - actualCount; + const scheduledCount = milestones.length - actualCount; return (
{version}.x release timeline - {actualCount > 0 && projectedCount > 0 - ? `${actualCount} published on GitHub · ${projectedCount} projected` + {actualCount > 0 && scheduledCount > 0 + ? `${actualCount} published on GitHub · ${scheduledCount} scheduled` : actualCount > 0 ? `${actualCount} published on GitHub` - : `${projectedCount} projected milestones`} + : `${scheduledCount} scheduled milestones`}
@@ -396,20 +358,10 @@ function DateCell({ ); } -export default function ReleaseScheduleCalendar({ - defaultFutureCount = 6, - defaultShowHistory = true, -}: ReleaseScheduleCalendarProps): ReactNode { - const [futureCount, setFutureCount] = useState(defaultFutureCount); - const [asOf, setAsOf] = useState(SSR_DEFAULT_AS_OF); +export default function ReleaseScheduleCalendar(): ReactNode { + const [today, setToday] = useState(SSR_DEFAULT_TODAY); const [locale, setLocale] = useState('en-US'); - const [versioning, setVersioning] = useState('zero-x'); - const [showHistory, setShowHistory] = useState(defaultShowHistory); - const [rcWeeks, setRcWeeks] = useState(5); - const [breakingMode, setBreakingMode] = - useState('alternating'); - const [includePatch, setIncludePatch] = useState(true); - const [showAdvanced, setShowAdvanced] = useState(false); + const [showUnsupported, setShowUnsupported] = useState(true); const [activeTab, setActiveTab] = useState('schedule'); const [expandedVersions, setExpandedVersions] = useState< @@ -417,8 +369,8 @@ export default function ReleaseScheduleCalendar({ >({}); const [calMode, setCalMode] = useState('year'); - const [calYear, setCalYear] = useState(2027); - const [calMonth, setCalMonth] = useState(0); + const [calYear, setCalYear] = useState(2026); + const [calMonth, setCalMonth] = useState(11); const [calFilters, setCalFilters] = useState>({ cut: true, rc: true, @@ -430,20 +382,6 @@ export default function ReleaseScheduleCalendar({ const [inspectSeq, setInspectSeq] = useState(0); const inspectorRef = useRef(null); - function handleInspectVersion(version: string): void { - setSelectedVersion(version); - setInspectSeq(n => n + 1); - } - - useEffect(() => { - if (selectedVersion && inspectSeq > 0) { - inspectorRef.current?.scrollIntoView({ - behavior: 'smooth', - block: 'nearest', - }); - } - }, [selectedVersion, inspectSeq]); - const [exportFormat, setExportFormat] = useState('overview-md'); const [icsOptions, setIcsOptions] = useState({ cut: true, @@ -451,7 +389,7 @@ export default function ReleaseScheduleCalendar({ golden: true, stable: true, patch: false, - futureOnly: true, + upcomingOnly: true, }); const [copyToast, setCopyToast] = useState(''); const [githubBySeries, setGithubBySeries] = useState< @@ -462,10 +400,23 @@ export default function ReleaseScheduleCalendar({ // Sync to the visitor's local date and locale after hydration to avoid SSR mismatch. useEffect(() => { - setAsOf(getLocalTodayISO()); + const localToday = getLocalTodayISO(); + setToday(localToday); setLocale(undefined); + const dt = parseISO(localToday); + setCalYear(dt.getUTCFullYear()); + setCalMonth(dt.getUTCMonth()); }, []); + useEffect(() => { + if (selectedVersion && inspectSeq > 0) { + inspectorRef.current?.scrollIntoView({ + behavior: 'smooth', + block: 'nearest', + }); + } + }, [selectedVersion, inspectSeq]); + // Fetch actual RC, stable, and patch tags from GitHub Releases (cached 15m). useEffect(() => { const controller = new AbortController(); @@ -535,40 +486,20 @@ export default function ReleaseScheduleCalendar({ return () => controller.abort(); }, []); - const scheduleOptions = useMemo( - () => ({ - futureCount, - asOf, - versioning, - showHistory, - rcWeeks, - breakingMode, - includePatch, - }), - [ - futureCount, - asOf, - versioning, - showHistory, - rcWeeks, - breakingMode, - includePatch, - ] - ); - const data: ScheduleResult = useMemo( - () => buildReleaseSchedule(scheduleOptions, githubBySeries), - [scheduleOptions, githubBySeries] + () => buildReleaseSchedule(today, githubBySeries, showUnsupported), + [today, githubBySeries, showUnsupported] ); const kpis = useMemo(() => { - const nextRelease = data.allAsc.find(r => r.releaseDate > asOf) ?? null; - const nextCut = data.allAsc.find(r => r.branchCut > asOf) ?? null; + const nextRelease = data.allAsc.find(r => !r.released) ?? null; + const nextCut = + data.allAsc.find(r => !r.released && r.branchCut > today) ?? null; const supported = data.allAsc .filter(r => r.support === 'Active' || r.support === 'End of Cycle') .reverse(); const prevCut = - data.allAsc.filter(r => r.branchCut <= asOf).slice(-1)[0] ?? null; + data.allAsc.filter(r => r.branchCut <= today).slice(-1)[0] ?? null; return { nextRelease, @@ -582,7 +513,7 @@ export default function ReleaseScheduleCalendar({ .filter(r => r.support === 'End of Cycle') .map(r => r.version), }; - }, [data.allAsc, asOf]); + }, [data.allAsc, today]); const eventsByDate = useMemo(() => { const byDate = new Map(); @@ -610,15 +541,15 @@ export default function ReleaseScheduleCalendar({ case 'overview-md': return buildOverviewMarkdown(data); case 'rc-md': - return buildRcMarkdown(data, icsOptions.futureOnly); + return buildRcMarkdown(data, icsOptions.upcomingOnly); case 'ics': - return buildICS(data, asOf, icsOptions); + return buildICS(data, today, icsOptions); case 'csv': return buildCSV(data); case 'json': - return buildJSON(data, scheduleOptions); + return buildJSON(data); } - }, [exportFormat, data, scheduleOptions, asOf, icsOptions]); + }, [exportFormat, data, today, icsOptions]); const inspectedRelease = useMemo( () => @@ -641,8 +572,8 @@ export default function ReleaseScheduleCalendar({ } } } - const minDt = parseISO(minIso || asOf); - const maxDt = parseISO(maxIso || asOf); + const minDt = parseISO(minIso || today); + const maxDt = parseISO(maxIso || today); const minYear = minDt.getUTCFullYear(); const minMonth = minDt.getUTCMonth(); const maxYear = maxDt.getUTCFullYear(); @@ -655,7 +586,7 @@ export default function ReleaseScheduleCalendar({ minTotal: minYear * 12 + minMonth, maxTotal: maxYear * 12 + maxMonth, }; - }, [data.visibleAsc, asOf]); + }, [data.visibleAsc, today]); useEffect(() => { const currentTotal = calYear * 12 + calMonth; @@ -678,14 +609,9 @@ export default function ReleaseScheduleCalendar({ ? calYear < calendarBounds.maxYear : calYear * 12 + calMonth < calendarBounds.maxTotal; - function handleReset(): void { - setFutureCount(defaultFutureCount); - setAsOf(getLocalTodayISO()); - setVersioning('zero-x'); - setShowHistory(defaultShowHistory); - setRcWeeks(5); - setBreakingMode('alternating'); - setIncludePatch(true); + function handleInspectVersion(version: string): void { + setSelectedVersion(version); + setInspectSeq(n => n + 1); } function toggleRow(version: string): void { @@ -719,8 +645,8 @@ export default function ReleaseScheduleCalendar({ setCalMonth(nextTotal % 12); } - function jumpToAsOf(): void { - const dt = parseISO(asOf); + function jumpToToday(): void { + const dt = parseISO(today); const targetTotal = Math.max( calendarBounds.minTotal, Math.min( @@ -781,243 +707,89 @@ export default function ReleaseScheduleCalendar({ URL.revokeObjectURL(url); } - const showTypeCol = breakingMode !== 'none'; - const tableColSpan = 5 + (showTypeCol ? 1 : 0); + const nextReleaseDays = kpis.nextRelease + ? diffDays(today, kpis.nextRelease.releaseDate) + : null; + const nextCutDays = kpis.nextCut + ? diffDays(today, kpis.nextCut.branchCut) + : null; return (
{/* Summary KPIs */}
-
-
- Next Stable Release - - {kpis.nextRelease ? `${kpis.nextRelease.version}.0` : '—'} - +
+ Next Stable Release + + {kpis.nextRelease ? `${kpis.nextRelease.version}.0` : '—'} + + + {kpis.nextRelease + ? `${formatPrettyDate(kpis.nextRelease.releaseDate, locale)}${ + nextReleaseDays !== null && nextReleaseDays >= 0 + ? ` (in ${nextReleaseDays}d)` + : '' + }` + : '—'} + + {kpis.nextRelease?.latestRc ? ( - {kpis.nextRelease - ? `${formatPrettyDate(kpis.nextRelease.releaseDate, locale)} (in ${diffDays(asOf, kpis.nextRelease.releaseDate)}d)` - : '—'} + Latest RC:{' '} + + {kpis.nextRelease.latestRc.tag} + + {' '} + ({formatPrettyDate(kpis.nextRelease.latestRc.date, locale)}) - {kpis.nextRelease?.latestRc ? ( - - Latest RC:{' '} - - {kpis.nextRelease.latestRc.tag} - - {' '} - ({formatPrettyDate(kpis.nextRelease.latestRc.date, locale)}) - - ) : null} -
+ ) : null}
-
-
- Next Branch Cut (RC0) - - {kpis.nextCut ? `${kpis.nextCut.version}.0-rc.0` : '—'} - - - {kpis.nextCut - ? `${formatPrettyDate(kpis.nextCut.branchCut, locale)} (in ${diffDays(asOf, kpis.nextCut.branchCut)}d)` - : '—'} - -
+
+ Next Branch Cut (RC0) + + {kpis.nextCut ? `${kpis.nextCut.version}.0-rc.0` : '—'} + + + {kpis.nextCut + ? `${formatPrettyDate(kpis.nextCut.branchCut, locale)}${ + nextCutDays !== null && nextCutDays >= 0 + ? ` (in ${nextCutDays}d)` + : '' + }` + : '—'} +
-
-
- Supported Series (3) - - {kpis.supported.length > 0 - ? kpis.supported.map(r => r.version).join(' · ') - : '—'} - - - {kpis.activeVersions.length > 0 - ? `${kpis.activeVersions.join(', ')} Active` - : ''} - {kpis.eocVersions.length > 0 - ? ` · ${kpis.eocVersions.join(', ')} EoC` - : ''} - -
+
+ Supported Series (3) + + {kpis.supported.length > 0 + ? kpis.supported.map(r => r.version).join(' · ') + : '—'} + + + {kpis.activeVersions.length > 0 + ? `${kpis.activeVersions.join(', ')} Active` + : ''} + {kpis.eocVersions.length > 0 + ? ` · ${kpis.eocVersions.join(', ')} EoC` + : ''} +
-
-
- Current Window on main - - {kpis.nextCut?.releaseType || 'Active development'} - - - {kpis.prevCut && kpis.nextCut - ? `${formatShortDate(kpis.prevCut.branchCut, locale)} → ${formatShortDate(kpis.nextCut.branchCut, locale)} (for ${kpis.nextCut.version}.x)` - : '—'} - -
-
-
- - {/* Controls */} -
-
-
-
- -
- - -
-
- -
- - { - if (e.target.value) { - setAsOf(e.target.value); - } - }} - /> -
- -
- -
- - -
-
- -
- History -
- -
-
- -
- - -
- - {showAdvanced ? ( -
-
- -
- - -
-
- -
- -
- - -
-
- -
- First patch (.1) -
- -
-
- - -
- ) : null} +
+ Current Window on main + + {kpis.nextCut?.releaseType || 'Active development'} + + + {kpis.prevCut && kpis.nextCut + ? `${formatShortDate(kpis.prevCut.branchCut, locale)} → ${formatShortDate(kpis.nextCut.branchCut, locale)} (for ${kpis.nextCut.version}.x)` + : '—'} +
@@ -1048,39 +820,50 @@ export default function ReleaseScheduleCalendar({ ))}
-
- - {githubSync === 'synced' ? ( - - GitHub Releases synced ({githubTagCount} tags) - - - ) : githubSync === 'loading' ? ( - Syncing GitHub Releases… - ) : ( - - GitHub Releases - - - )} +
+ + +
+ + {githubSync === 'synced' ? ( + + GitHub Releases synced ({githubTagCount} tags) + + + ) : githubSync === 'loading' ? ( + Syncing GitHub Releases… + ) : ( + + GitHub Releases + + + )} +
- {/* View 1: Schedule Table (reuses site's .releases-schedule-table + .table-wrapper) */} + {/* View 1: Schedule Table */} {activeTab === 'schedule' ? (
@@ -1088,7 +871,7 @@ export default function ReleaseScheduleCalendar({ Version - {showTypeCol ? Type : null} + Type Branch Cut Latest / Golden RC Release (.0) @@ -1114,7 +897,7 @@ export default function ReleaseScheduleCalendar({ {r.version}.x - {r.source === 'published' ? ( + {r.released ? ( <> {r.blog ? ( - ) : r.source === 'overview-future' ? ( - Scheduled ) : ( - Projected + Scheduled )}
- {showTypeCol ? ( - {typeBadge(r.releaseType)} - ) : null} + {typeBadge(r.releaseType)} - ) : r.source === 'published' ? ( + ) : r.released ? ( — ) : ( @@ -1207,9 +986,7 @@ export default function ReleaseScheduleCalendar({ {isExpanded ? ( - + -
+
@@ -1282,14 +1059,14 @@ export default function ReleaseScheduleCalendar({ ['rc', 'RC1–RC3'], ['golden', 'Golden RC'], ['stable', 'Stable (.0)'], - ['patch', 'Patch (.1)'], + ['patch', 'Patch (.1+)'], ] as const ).map(([kind, label]) => ( @@ -1352,14 +1129,21 @@ export default function ReleaseScheduleCalendar({ {/* View 3: Support Timeline */} {activeTab === 'timeline' ? ( - + ) : null} {/* View 4: Export / Copy */} {activeTab === 'export' ? (
-
+
{( [ ['overview-md', 'reactnative.dev MD'], @@ -1374,7 +1158,7 @@ export default function ReleaseScheduleCalendar({ type="button" role="tab" aria-selected={exportFormat === fmt} - className={`button button--sm ${exportFormat === fmt ? 'button--primary' : 'button--secondary button--outline'}`} + className={`${styles.btn} ${exportFormat === fmt ? styles.btnPrimary : ''}`} onClick={() => setExportFormat(fmt)}> {label} @@ -1389,7 +1173,7 @@ export default function ReleaseScheduleCalendar({ ) : null} @@ -1414,7 +1198,7 @@ export default function ReleaseScheduleCalendar({ ['rc', 'Intermediate RCs'], ['golden', 'Golden RC'], ['stable', 'Stable Releases (.0)'], - ['patch', 'First Patch (.1)'], + ['patch', 'Patches (.1+)'], ] as const ).map(([key, label]) => (
) : null} @@ -1461,7 +1245,7 @@ export default function ReleaseScheduleCalendar({ function YearGrid({ year, - asOf, + today, locale, minTotal, maxTotal, @@ -1470,7 +1254,7 @@ function YearGrid({ onInspectVersion, }: { year: number; - asOf: string; + today: string; locale: string | undefined; minTotal: number; maxTotal: number; @@ -1515,7 +1299,7 @@ function YearGrid({ for (let day = 1; day <= daysInMonth; day++) { const iso = `${year}-${String(month0 + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; const evs = eventsByDate.get(iso) ?? []; - const isToday = iso === asOf; + const isToday = iso === today; if (evs.length > 0) { const top = @@ -1592,13 +1376,13 @@ function YearGrid({ function MonthGrid({ year, month0, - asOf, + today, eventsByDate, onInspectVersion, }: { year: number; month0: number; - asOf: string; + today: string; eventsByDate: Map; onInspectVersion: (version: string) => void; }) { @@ -1636,7 +1420,7 @@ function MonthGrid({ } const iso = `${cellYear}-${String(cellMonth0 + 1).padStart(2, '0')}-${String(dayNum).padStart(2, '0')}`; - const isToday = iso === asOf; + const isToday = iso === today; const evs = eventsByDate.get(iso) ?? []; cells.push( @@ -1645,7 +1429,7 @@ function MonthGrid({ className={`${styles.dayCell} ${isOutside ? styles.dayOutside : ''} ${isToday ? styles.dayToday : ''}`}>
{dayNum} - {isToday ? As of : null} + {isToday ? Today : null}
{evs.map(ev => (