5 Commits
Author SHA1 Message Date
Dawid Małecki d920d109cf Fix Doxygen merging base classes from primary templates into specializations (#56239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56239

Doxygen incorrectly merges base classes from primary templates into their partial specializations. In C++, a specialization's inheritance list completely replaces the primary template's, but Doxygen combines both into a single basecompoundref list.

- **Contradictory type traits** — is_optional<std::optional<T>> and is_variant_of_data_types<std::variant<Ts...>> showed inheritance from both std::false_type (primary) and std::true_type (specialization)

- **Duplicate base classes** — Converter<jsi::Object> listed ConverterBase<jsi::Object> twice (once from the primary template after substitution, once from the specialization)

This diff fixes both issues with two complementary mechanisms:

- **Dedup-by-name (Extendable._deduplicate_base_classes)**: removes exact duplicate base classes, keeping the last occurrence. Handles cases where Doxygen's template argument substitution produces identical names.
- **Primary template base subtraction (StructLikeScopeKind._remove_merged_primary_bases)**: for partial specializations, looks up the primary template among sibling scopes and performs count-based subtraction of its bases. Count-based (rather than set-based) subtraction correctly preserves bases that a specialization explicitly re-inherits from the same class as the primary.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D98291360

fbshipit-source-id: 82b34969b13c7df8babf2c5efc222b29979d6361
2026-03-31 08:32:57 -07:00
Dawid Małecki 20cf9bca83 Move scope string generation logic to the base class (#56085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56085

Changelog: [Internal]

Moves the logic responsible for generating a string view of the scope's body to the base class to reduce duplication.

Similarly, moves the logic responsible for qualifying template arguments to the `Extensible` class.

Reviewed By: cipolleschi

Differential Revision: D96455746

fbshipit-source-id: 1d800c7992080e02831f61fee4aaa9cb31f8fc9a
2026-03-18 09:29:02 -07:00
Dawid Małecki 140509f7d4 Extract class specializations from name (#56075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56075

Changelog: [Internal]

Updates the parser to extract the template specializations from name string in order to avoid repeated operations on the name string.

Reviewed By: cipolleschi

Differential Revision: D96303732

fbshipit-source-id: 08ff8ba34522426adccd53129590c5a7d59e0438
2026-03-18 09:29:02 -07:00
Dawid Małecki 4391a5f4b0 Move inheritance logic to a separate class (#56074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56074

Changelog: [Internal]

Extracts the duplicated handling of inheritance and base classes to a separate, reusable class.

Reviewed By: cipolleschi

Differential Revision: D96287394

fbshipit-source-id: 6075b5dafb754167b6f78abbaee60c1243c99bb5
2026-03-18 09:29:02 -07:00
Dawid Małecki 62ce98db99 Split scope definitions into smaller files (#56073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56073

Changelog: [Internal]

Splits `scope.py` into multiple smaller files, each containing a separate defitnition.

Reviewed By: cipolleschi

Differential Revision: D96284004

fbshipit-source-id: f99275cc9b5f8844f9a14f9d6207ae988aa9ccd7
2026-03-18 09:29:02 -07:00