Skip to content

Unify CSSCompoundDataType with its variant#55738

Closed
NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman:export-D94347088
Closed

Unify CSSCompoundDataType with its variant#55738
NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman:export-D94347088

Conversation

@NickGerleman
Copy link
Copy Markdown
Contributor

Summary:
Previously, CSS compound data types used two separate types:
CSSCompoundDataType<T1, T2, ...> as an empty marker struct for template
parameter deduction, and CSSVariantWithTypes<CSSCompoundDataType<T1, T2, ...>>
which resolved to std::variant<T1, T2, ...> for actual storage. This resulted
in redundant type aliases like CSSTransformFunctionVariant.

This change makes CSSCompoundDataType<T1, T2, ...> a using alias for
std::variant<T1, T2, ...> directly, so one type serves both roles: template
parameter deduction for parsing AND storage.

  • Change CSSCompoundDataType from a marker struct to a using alias for
    std::variant
  • Replace CSSValidCompoundDataType concept with is_variant_of_data_types
    trait that pattern-matches std::variant where all types satisfy CSSDataType
  • Update merge_data_types and merge_variant specializations to use
    std::variant directly
  • Store AllowedTypesT directly in CSSList compound type specialization
    (since it IS now the variant)
  • Remove redundant CSSTransformFunctionVariant, CSSFilterFunctionVariant,
    and CSSBackgroundImageVariant aliases
  • Update all downstream references in conversions

Changelog: [Internal]

Differential Revision: D94347088

@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 Feb 25, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Feb 25, 2026

@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94347088.

Summary:

Previously, CSS compound data types used two separate types:
`CSSCompoundDataType<T1, T2, ...>` as an empty marker struct for template
parameter deduction, and `CSSVariantWithTypes<CSSCompoundDataType<T1, T2, ...>>`
which resolved to `std::variant<T1, T2, ...>` for actual storage. This resulted
in redundant type aliases like `CSSTransformFunctionVariant`.

This change makes `CSSCompoundDataType<T1, T2, ...>` a `using` alias for
`std::variant<T1, T2, ...>` directly, so one type serves both roles: template
parameter deduction for parsing AND storage.

- Change `CSSCompoundDataType` from a marker struct to a `using` alias for
  `std::variant`
- Replace `CSSValidCompoundDataType` concept with `is_variant_of_data_types`
  trait that pattern-matches `std::variant` where all types satisfy `CSSDataType`
- Update `merge_data_types` and `merge_variant` specializations to use
  `std::variant` directly
- Store `AllowedTypesT` directly in `CSSList` compound type specialization
  (since it IS now the variant)
- Remove redundant `CSSTransformFunctionVariant`, `CSSFilterFunctionVariant`,
  and `CSSBackgroundImageVariant` aliases
- Update all downstream references in conversions

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D94347088
@meta-codesync meta-codesync bot closed this in 36212c2 Feb 25, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 25, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @NickGerleman in 36212c2

When will my fix make it into a release? | How to file a pick request?

@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Feb 25, 2026

This pull request has been merged in 36212c2.

zoontek pushed a commit to zoontek/react-native that referenced this pull request Mar 9, 2026
Summary:
Pull Request resolved: facebook#55738

Previously, CSS compound data types used two separate types:
`CSSCompoundDataType<T1, T2, ...>` as an empty marker struct for template
parameter deduction, and `CSSVariantWithTypes<CSSCompoundDataType<T1, T2, ...>>`
which resolved to `std::variant<T1, T2, ...>` for actual storage. This resulted
in redundant type aliases like `CSSTransformFunctionVariant`.

This change makes `CSSCompoundDataType<T1, T2, ...>` a `using` alias for
`std::variant<T1, T2, ...>` directly, so one type serves both roles: template
parameter deduction for parsing AND storage.

- Change `CSSCompoundDataType` from a marker struct to a `using` alias for
  `std::variant`
- Replace `CSSValidCompoundDataType` concept with `is_variant_of_data_types`
  trait that pattern-matches `std::variant` where all types satisfy `CSSDataType`
- Update `merge_data_types` and `merge_variant` specializations to use
  `std::variant` directly
- Store `AllowedTypesT` directly in `CSSList` compound type specialization
  (since it IS now the variant)
- Remove redundant `CSSTransformFunctionVariant`, `CSSFilterFunctionVariant`,
  and `CSSBackgroundImageVariant` aliases
- Update all downstream references in conversions

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D94347088

fbshipit-source-id: 99cfe13400325c36682297263aa87d00ac13de13
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. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants