This repository was archived by the owner on Aug 5, 2026. It is now read-only.
[major-43-regression] Major release regression branch - #4639
Closed
Richard-Shen (RichardSyq) wants to merge 43 commits into
Closed
[major-43-regression] Major release regression branch#4639Richard-Shen (RichardSyq) wants to merge 43 commits into
Richard-Shen (RichardSyq) wants to merge 43 commits into
Conversation
Run preset-19 minus refobject-defaults and useRef-required-initial — those two emit code that only typechecks against @types/react@19, so defer to the future bump PR. 34 files. ReactElement -> ReactElement<any>, scoped JSX imports, and deprecated-* type aliases replaced. License headers preserved. Manual fixups: array-type lint rule (3 sites: ReactElement<any>[] -> Array<ReactElement<any>>) and single-quote style on 2 new JSX imports.
Custom jscodeshift transform at scripts/react-19/transforms/strip-proptypes.js,
applied in two passes:
- .ts/.tsx (--parser=tsx): remove prop-types imports, .propTypes assignments,
static propTypes class fields, AND migrate function-component .defaultProps
into ES6 destructure defaults.
- .js/.jsx (--parser=babylon): only the defaultProps migration. Keep prop-types
in place; the project's react/prop-types rule wants validation and most .js
components rely on prop-types. React 19 ignores propTypes silently so this
is safe; full removal happens in the future TS migration.
Skipped (manual follow-up):
- 26 .tsx class components with static defaultProps (Phase C reports them).
- ~38 implicit-return story arrow components with .defaultProps left in place.
- Files where PropTypes is used as a const export (e.g. common-types.ts).
Manual fixups: 1 eslint-disable for an unused destructured rest sibling
(ignoreRestSiblings only allows when there's no default), and 2 dead-import
cleanups in tsx files.
License headers preserved everywhere. 27 files: +70 / -243. Lint 0 errors,
typecheck clean, jest 172 tests pass on touched packages.
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 6.0.3. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v5.9.3...v6.0.3) --- updated-dependencies: - dependency-name: typescript dependency-version: 6.0.3 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
packages/package.json: peerDep range narrowed-and-shifted from "17.0.2 - 18.3.1" to "18.3.1 - 19.2.5" (drops React 17, adds 19; lockfile updated). React 17 is unsupported upstream and has no consumers; dropping it shrinks the test/CI surface. .github/workflows/_build.yml: new React19 job runs typecheck + jest with react@19.2.5 and @types/react@19 installed --no-save into the cached node_modules. continue-on-error: true while the migration lands; flip to required once Repo 1 is released and consumers can opt in. packages/react-version-test.js: regex widened from /^18/ to /^(18|19)\./ so the runtime version test passes under both supported versions. REACT_19_MIGRATION.md: documents the peerDep decision + a runbook note on the drop-17 call vs the widen-to-3 default. Verified on React 18.3.1: typecheck clean, lint clean, check-react-versions + check-bpk-dependencies pass, full jest suite (2402 tests, 380 suites, 825 snapshots) passes.
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 6.2.0 to 7.2.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](release-drafter/release-drafter@6db134d...563bf13) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-version: 7.2.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Removes codemod@1.9.1 and types-react-codemod@3.5.3 from devDependencies (step 11 of the master plan recipe). The custom transform at scripts/react-19/transforms/strip-proptypes.js stays in the repo for reviewer traceability; scripts/react-19/README.md explains how to re-install jscodeshift on demand and notes the long-term home in web-migration-scripts/migrations/2026-05-react-19/. REACT_19_MIGRATION.md: recipe checklist marked complete; new "Deferred to follow-up PRs" section captures the 35 class-component static defaultProps migrations, 13 .js story/HOC files with leftover .defaultProps, full .js (Flow) prop-types removal, the @types/react@19 bump (which unlocks refobject-defaults + useRef-required-initial), the React19 CI matrix failure tracking, and moving the transform to web-migration-scripts. 2402 tests pass on React 18.3.1 after the uninstall.
RefObject<T | null>), add @types/prop-types to the override install (R19's @types/react no longer pulls it in transitively), and overlay the React 19 install into packages/node_modules so jest sees a single React version across both module trees. Remaining R19 jest failures (continue-on-error: true) are react-transition-group findDOMNode usage and useId() snapshot format drift — separate migration work.
…serializer and rewrites R19's _r_X_ useId format back to R18's :rX: so a single set of snapshots serves both versions
…o destructure defaults
Coupled-calendar pair, first commit of the class-component defaultProps migration:
- BpkCalendarContainer: extract DEFAULT_MARK_TODAY / DEFAULT_MAX_DATE / DEFAULT_MIN_DATE
as exported module-level constants (preserving the prior 'frozen at module load'
semantics — moving new Date() into per-render destructure defaults would re-evaluate
on every render). Apply destructure-with-defaults at every access site (constructor,
componentDidUpdate, handleDateFocus, handleDateSelect, render).
- BpkDatepicker: import the calendar defaults instead of reading
DefaultCalendar.defaultProps.{markToday,maxDate,minDate}; migrate own defaults to
destructure pattern. Make calendarComponent / inputComponent / nextMonthLabel /
previousMonthLabel optional in Props (they were typed required but defaultProps was
silently filling them in).
- BpkCalendarWeek: migrate; hoist DEFAULT_SELECTION_CONFIGURATION and a noop helper
to module scope so destructure defaults don't allocate per render.
- BpkCalendarWeek-test.tsx + BpkCalendar.stories.js: drop ...BpkCalendarWeek.defaultProps
spread (the migrated class applies the same defaults internally now).
R18 typecheck clean, jest green for both packages (60 tests / 23 snapshots).
The 5 composeCalendar-test snapshot failures are a pre-existing timezone-locale
string drift on this machine ('Coordinated Universal Time' vs 'Greenwich Mean Time'),
not caused by this change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ucture defaults Eight class components whose defaulted props are read only inside render() (or trivially null-safe lifecycle paths). Mechanical migration matching the function- component pattern from #4455: - withAccordionItemState - BpkCalendarDate (lifecycle reads also gain destructure-defaults; isToday is filtered out via the existing buttonProps delete pattern) - BpkCalendarGridHeader - withLazyLoading - BpkInput (defaults sourced from common-types: type, valid, large, docked*, inputRef, clearButton*; type now passed to <input> explicitly since the destructure pulls it out of {...rest}) - BpkInputField - BpkSplitInput (multi-method reads of inputLength, type, large, placeholder use destructure-defaults at each access site) - withInteractiveStarRatingState (Flow) Where Props had previously-required fields kept alive only by static defaultProps, they're typed optional now (consistent with the destructure default). Typecheck clean. Tests green: 98/98 with 72 snapshots. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…mponent defaultProps Symmetric edits to the four near-identical class components shared between banner-alert and info-banner: - AnimateAndFade (both packages): destructure-defaults at constructor and render for animateOnEnter / animateOnLeave; Props makes both optional. - withBannerAlertState (both packages): destructure-defaults at render for animateOnLeave / children; constructor uses ?? false for the expanded init (the existing if-guards in onDismiss/onExpandToggle/onHide already handle undefined callbacks safely). R18 typecheck clean, jest green: 71 tests / 50 snapshots. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Thirteen files (9 .tsx + 4 Flow .js external-assignment patterns):
TypeScript:
- BpkCalendarGrid (local DEFAULT_MAX_DATE / DEFAULT_MIN_DATE constants — keeping
module-eval-frozen semantics; can't import from BpkCalendarContainer because
that creates an import cycle via BpkCalendarGridWithTransition)
- BpkCalendarGridTransition (only static defaultProps removal — destructure-defaults
were already in place from a prior pass)
- BpkBackgroundImage, BpkImage (lifecycle reads of inView gain destructure-defaults)
- withOpenEvents (HAS_TOUCH_SUPPORT hoisted to module-level const so the destructure
default doesn't re-evaluate per render)
- BpkMobileScrollContainer
- withScrim (DEFAULT_IS_IPHONE / DEFAULT_IS_IPAD module-level consts; dialogRef +
closeOnScrimClick already-handled-as-truthy semantics preserved)
Flow .js (external Component.defaultProps = {...} assignment pattern):
- BpkBarchart (computed defaults hoisted to module-level: DEFAULT_X/Y_AXIS_MARGIN,
DEFAULT_Y_AXIS_DOMAIN, DEFAULT_GET_BAR_LABEL, DEFAULT_GET_BAR_SELECTION — preserves
function-reference stability that downstream sCU/memo may rely on)
- withInfiniteScroll (Flow `Config<Props, typeof defaultProps>` external type
preserved; internal access sites use `?? defaultProps.X` to apply defaults at
runtime since static defaultProps no longer fills them in)
- BpkGridToggle, BpkHorizontalNav, BpkHorizontalNavItem
- BpkProgress (componentDidUpdate restructured: `onComplete` was previously truthy-
checked because the static default was () => null; without the default it was
undefined and `onCompleteTransitionEnd` never fired. Restructured to call
destructure-defaulted onComplete unconditionally, then conditional
onCompleteTransitionEnd as before — fixes a test failure caught by the existing
suite)
R18 typecheck clean, lint clean, jest green for all touched packages
(228 tests / 111 snapshots, plus the pre-existing composeCalendar-test
timezone-locale failure that's unrelated to this migration).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…aults Largest single migration in the class-component sweep. ~22 this.props reads across 5 methods (componentDidMount, componentDidUpdate, onDocumentMouseUp, onDocumentKeyDown, open). - Module-level `noop = () => null` for the three callable defaults (onClose / onOpen / onRender) — the original `static defaultProps` value was the same shared `() => null`, so a single hoisted reference preserves identity-equality semantics. - Destructure-defaults applied at every method that calls these: must call unconditionally without a default would TypeError on undefined. - closeOnEscPressed default `true` is load-bearing — without the destructure default, omitting the prop would mean ESC never closes the portal. - Props type widened: required fields with prior static defaults are now optional. Affects 7 fields; consumers (BpkTooltip, BpkScrim, BpkModalV3, withScrimmedPortal) all already omit one or more of these. R18 typecheck clean, lint clean, jest green for Portal + all its consumers (174 tests / 31 snapshots). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
release-drafter v7 no longer reads the GITHUB_TOKEN env var; passing it that way silently falls back to the default `github.token`, which lacks the GitHub App permissions we use for drafting releases. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
react-window v2 is a major rewrite: List replaces VariableSizeList, render-prop becomes rowComponent + rowProps, auto-sizing is built-in (no more AutoSizer), resetAfterIndex is gone (rowProps changes are auto-detected), initialScrollOffset is replaced by listRef.scrollToRow, and TS types ship with the package. - Bump react-window ^1.8.7 -> ^2.0.0 - Drop react-virtualized-auto-sizer (v2 has built-in sizing) - Drop @types/react-window (v2 ships its own types) - Rewrite BpkScrollableCalendarGridList for v2 API - Preserve sentinelRef + ResizeObserver font-scaling logic Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Skyscanner Artifactory's X-Ray policy returns 403 for react-window@2.2.7 (and its transitive color@5/color-convert@3/color-name@2/color-string@2 deps that we don't already cache). Local install resolved through artifactory because of user-level npm config; the project .npmrc points to the public registry. Rewrite the resolved URLs in packages/package-lock.json from artifactory.skyscannertools.net to registry.npmjs.org for these 5 deps. Integrity hashes are unchanged (verified the public tarball produces the same sha512), and @skyscanner/* scoped packages keep their artifactory URLs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
react-window v2's List uses ResizeObserver internally for auto-sizing, which jsdom does not provide. Three test files (BpkScrollableCalendar, BpkScrollableCalendarGridList, accessibility) need the mock; reusing the per-file pattern already used elsewhere in the repo (bpk-component-chatbot-input, bpk-component-price-range, bpk-component-slider). v2 also defaults the outer element to role="list", but our rows render calendar grids (role="grid") and headings, not listitems — axe flagged this as aria-required-children. Pass role="presentation" to opt out of the implicit list semantics. Snapshots still need regenerating (v2 emits different DOM); that is left for the next jest -u pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
react-window v2 emits a different DOM tree than v1's AutoSizer + List combination. In jsdom the new defaultHeight path also renders more month rows than the v1 0x0 AutoSizer fallback did, so the snapshots grow even though the rendered output is correct. Verified manually: - role="presentation" appears on the v2 List outer div (our override) - rows are tagged with data-react-window-index - bpk-scrollable-calendar-grid contents are unchanged Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) from 6.0.2 to 7.0.5. - [Release notes](https://github.com/yahoo/serialize-javascript/releases) - [Commits](yahoo/serialize-javascript@v6.0.2...v7.0.5) --- updated-dependencies: - dependency-name: serialize-javascript dependency-version: 7.0.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
The prop relied on scrollIntoView from a useEffect on mount, which silently no-ops when the carousel is rendered inside a parent that hasn't laid out yet (e.g. AnimateHeight at display: none). The sole intended consumer (ExpandedPricingOption in web-platform) hit exactly this and has since switched to a manual ref-based scroll triggered after its parent's animation completes (IRN-6568). No other consumers exist, so the prop is dead weight with a misleading API. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…m 6.2.0 to 7.2.1
…dep for @nx/eslint
Contributor
|
Visit https://backpack.github.io/storybook-prs/4639 to see this build running in a browser. |
Add ignoreDeprecations: "6.0" to silence TS5107 errors for target=ES5 and moduleResolution=node10 introduced by TypeScript 6.0.3 bump.
Contributor
|
Visit https://backpack.github.io/storybook-prs/4639 to see this build running in a browser. |
- tsconfig.declaration.json: add "types": ["node"] so process/require globals are available (TS2591) - packages/backpack-web/package.json: bump react-window 1.8.7 → 2.0.0 to match v2 API used in BpkScrollableCalendarGridList (TS7016) - BpkFloatingNotification: use if-guard instead of && for clearTimeout to fix EffectCallback return type (TS2345) - BpkProgress: guard onComplete call with null check (TS2721) - package-lock.json: regenerated after react-window version bump Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Visit https://backpack.github.io/storybook-prs/4639 to see this build running in a browser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major 43 Regression Branch
This is an automated regression branch combining all PRs labelled
major.Skipped PRs
🤖 Generated with Claude Code