Skip to content

feat(style): remove experimental_ prefix from backgroundSize, backgroundPosition and backgroundRepeat#57563

Open
intergalacticspacehighway wants to merge 7 commits into
react:mainfrom
intergalacticspacehighway:feat/graduate-background-size-position-repeat
Open

feat(style): remove experimental_ prefix from backgroundSize, backgroundPosition and backgroundRepeat#57563
intergalacticspacehighway wants to merge 7 commits into
react:mainfrom
intergalacticspacehighway:feat/graduate-background-size-position-repeat

Conversation

@intergalacticspacehighway

@intergalacticspacehighway intergalacticspacehighway commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary:

Promote backgroundSize, backgroundPosition and backgroundRepeat from their experimental_ prefixed names to stable style props, following backgroundImage which was recently graduated in #57165.

They have been available in experimental mode alongside backgroundImage for some time with no reported issues.

Changelog:

[GENERAL][CHANGED] - Remove experimental_ prefix from backgroundSize, backgroundPosition and backgroundRepeat

Test Plan:

Built and ran RNTester on Android and iOS. Migrated the Background Image example (size / position / repeat) to the graduated prop names.

cc - @jorge-cab

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@intergalacticspacehighway
intergalacticspacehighway marked this pull request as ready for review July 15, 2026 13:16
…und-size-position-repeat

# Conflicts:
#	packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js
#	packages/react-native/ReactNativeApi.d.ts
@intergalacticspacehighway
intergalacticspacehighway marked this pull request as draft July 15, 2026 13:20
@intergalacticspacehighway
intergalacticspacehighway marked this pull request as ready for review July 15, 2026 13:22
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 15, 2026
@intergalacticspacehighway
intergalacticspacehighway force-pushed the feat/graduate-background-size-position-repeat branch from fa99d94 to 406620e Compare July 15, 2026 14:12
Graduating `backgroundSize`, `backgroundPosition` and `backgroundRepeat` by
renaming them outright would break any app already using the
`experimental_` prefixed names. Instead, keep the prefixed names working as
aliases alongside the new ones, so the removal can happen in a later
release. This mirrors what `backgroundImage` already does.

The non-prefixed name takes precedence when both are set.

- C++: nested `convertRawProp` fallback in the `BaseViewProps` constructor
  (this is also what registers the alias key with the raw props parser),
  plus an extra `RAW_SET_PROP_SWITCH_CASE` per prop in `setProp`. This is
  what covers iOS, which reads the typed props and never the raw names.
- JS: alias entries in `ReactNativeStyleAttributes` (used wholesale as
  `style` by `BaseViewConfig.ios.js`) and in `BaseViewConfig.android.js`,
  plus the Flow and TypeScript style types.
- Android additionally dispatches props to ViewManagers by string name, so
  each alias needs its own `ViewProps` constant and `@ReactProp` setter
  delegating to the real one.
…und-size-position-repeat

Conflict was limited to the generated `ReactNativeApi.d.ts` (SignedSource and
per-export content hashes). Resolved by regenerating with `yarn build-types`
from the merged sources rather than hand-merging hashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant