Unify CSSCompoundDataType with its variant#55738
Closed
NickGerleman wants to merge 1 commit intofacebook:mainfrom
Closed
Unify CSSCompoundDataType with its variant#55738NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@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
54452d0 to
14f7705
Compare
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? |
|
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
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
Previously, CSS compound data types used two separate types:
CSSCompoundDataType<T1, T2, ...>as an empty marker struct for templateparameter deduction, and
CSSVariantWithTypes<CSSCompoundDataType<T1, T2, ...>>which resolved to
std::variant<T1, T2, ...>for actual storage. This resultedin redundant type aliases like
CSSTransformFunctionVariant.This change makes
CSSCompoundDataType<T1, T2, ...>ausingalias forstd::variant<T1, T2, ...>directly, so one type serves both roles: templateparameter deduction for parsing AND storage.
CSSCompoundDataTypefrom a marker struct to ausingalias forstd::variantCSSValidCompoundDataTypeconcept withis_variant_of_data_typestrait that pattern-matches
std::variantwhere all types satisfyCSSDataTypemerge_data_typesandmerge_variantspecializations to usestd::variantdirectlyAllowedTypesTdirectly inCSSListcompound type specialization(since it IS now the variant)
CSSTransformFunctionVariant,CSSFilterFunctionVariant,and
CSSBackgroundImageVariantaliasesChangelog: [Internal]
Differential Revision: D94347088