Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56367
Adds support for regex in the `exclude_symbols` field in the C++ API parser config. This enables better scoped definitions of symbols that should be matched.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D99844594
fbshipit-source-id: 0d2b4f9970c535afa6af8712c9435bdb06c50779
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56341
Exclude members from .api snapshots when their types (return type, parameter types, variable type, typedef target, property type) reference excluded symbols. Previously, only compounds whose names matched exclude_symbols patterns were excluded — but members of non-excluded compounds could still reference excluded types, causing dangling type references (e.g., `facebook::yoga::ExperimentalFeature`) to appear in the snapshot.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D99434605
fbshipit-source-id: 24d304754161ca891316061dbfee8c2be08d5d40
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56253
Renames flag for verifying that the C++ public API snapshot is with sync with the actual public API surface to match the JS API command.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D98484129
fbshipit-source-id: ec806353f263b00e5060d9e7f0333bcf4cced148
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56243
Modifies C++ API parser config to accept `exclude_symbols` at the platform level and sets `Android` symbols to be excluded from the ReactApple snapshot.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D98298766
fbshipit-source-id: 70b39fe4935e6791701c173e7c9e12532c2817a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56240
There are cases in which we want to strip particular symbols from the snapshot. This diff adds `exclude_symbols` to the parser config to enable definitions of symbol patterns that should be excluded from the snapshot.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D98295409
fbshipit-source-id: 47414c1e5060a01dce76d1fc4fdd8ea355bb8d37
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56238
Currently, all xml artifacts generated by doxygen are stored in the tmp dir and deleted at the end of the snapshot generation. For debugging reasons, this diff adds `--xml` flag to persist generated artifacts, so that they can be analyzed.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D98289956
fbshipit-source-id: 73eb0185f7112389e589d3e8f8a2004efe325e8d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56248
Refactor and add global exclude patterns to the C++ stable API snapshot config. This enables better modularization of shared exclude patterns coming from the assumption that ReactAndroid and ReactApple consists of ReactCommon in their inputs and some paths should not be processed on each platform.
Changelog:
[Internal]
Reviewed By: cortinico
Differential Revision: D97465431
fbshipit-source-id: e71daef90853dad8003a0f41b1ea78b8c56bee02
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56042
Adds CI workflow for validating whether the current C++ API snapshot is equivalent with the generated one.
Changelog:
[Internal]
Reviewed By: cortinico
Differential Revision: D95963515
fbshipit-source-id: 4629999e2d09dbdcfb9fd3e6308a9254dd4f0237
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56220
Changelog: [Internal]
Conversion operators like `operator jsi::Array` contain a type reference in their name that was not being fully qualified.
This diff adds a `_qualify_conversion_operator_type` step to `FunctionMember.close()` that detects conversion operators and qualifies the type portion of the name using the same mechanism already used for return types and arguments.
Reviewed By: cipolleschi
Differential Revision: D98124781
fbshipit-source-id: 7baf2b6f31fcbf2fdab43457b5792558d774b043
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56219
Changelog: [Internal]
Doxygen has a bug where it incorrectly embeds the parameter name of pointer-to-member-function parameters with ref-qualifiers (& or &&) into the type string instead of providing a separate <declname> element.
This caused the snapshot to output `R(folly::dynamic::*)() const asFoo&` instead of the correct `R(folly::dynamic::*asFoo)() const &`.
This diff detects the misplaced name in the type string and reconstructs the correct pointer-to-member declarator.
Reviewed By: cipolleschi
Differential Revision: D98123353
fbshipit-source-id: a3a92c5d3897721f0b97a232fdaa59379b408b29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56218
Changelog: [Internal]
When a class inherits constructors via `using Base::Base;`, Doxygen incorrectly emits duplicate `basecompoundref` entries for the same base class. This caused base classes like `ConverterBase` to appear twice in the snapshot output.
This diff deduplicates base classes by name in `get_base_classes()`.
Reviewed By: cipolleschi
Differential Revision: D98118659
fbshipit-source-id: c81f663480fda48c89e6dd625a504a78eb9d7c41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56217
Changelog: [Internal]
Doxygen may incorrectly cross-reference parameter names inside function
pointer types to member variables of the enclosing class. For example,
`void (*cb)(const void* data)` inside a class that has a `data` member
would produce `const void* Class::data` instead of
`const void* data` in the snapshot. This diff addresses two issues:
1. In `get_doxygen_params`, re-parse function pointer type strings
through `parse_type_with_argstrings` which delegates to
`_parse_single_argument` that already strips "::" from parameter
names.
2. In `parse_type_with_argstrings`, recognize complex declarator groups
starting with `*` or `&` (e.g. `*(*fp)(int)`) as non-argument-list
parenthesized sections, preventing incorrect name extraction from
nested function pointer declarators.
Reviewed By: cipolleschi
Differential Revision: D98118629
fbshipit-source-id: a8532e2adaec1dd2b50be8a20eae1068ac49d548
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56214
Changelog: [Internal]
Snapshot generator was putting `[]` in wrong place when generating array type - it was adding it to the type name instead of the variable name. This diff addresses that.
Reviewed By: cipolleschi
Differential Revision: D98102328
fbshipit-source-id: c5b1f290da3c94ad4834a9756d849ae879733033
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56213
Changelog: [Internal]
When a class has multiple base classes, all defining a constructor with the same signature, the inherited constructors were being duplicated in the snapshot (for each base class).
This diff deduplicates them.
Reviewed By: cipolleschi
Differential Revision: D98102286
fbshipit-source-id: 2086645880afab8ec30d245b7cae5caa5e19679e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56184
Changelog: [Internal]
Updates the snapshot generator script to run generation steps for all snapshots in parallel instead of in sequence, significantly improving the generation time.
Reviewed By: cortinico
Differential Revision: D97714334
fbshipit-source-id: b643dd7bb2fa4f3f9db1495bc7a44c0069a25274
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56177
Changelog: [Internal]
Makes doxygen input filers opt-in via the config file. Those are only needed for objective c files, so there's no need to run them for ReactCommon or ReactAndroid.
Reviewed By: cortinico
Differential Revision: D97489420
fbshipit-source-id: 0503801de60d6c2ae58506f20fcc06feec0501ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56091
Changelog: [Internal]
When qualifying a member, prevent taking itself as a target for qualification, to prevent types referencing themselves.
Reviewed By: cipolleschi
Differential Revision: D96455842
fbshipit-source-id: 2ed59a4688d0daa98db603a734283f41ffbe4ead
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56076
Changelog: [Internal]
Updates the C++ API snapshot generator to extract specializations from name when a member is created, instead of relying on the one stored in the name string.
It also makes out-of-class definitions of members to be skipped in the snapshot as those were essentially duplicated between their declaration inside the class, and the initialization outside of it.
Reviewed By: cipolleschi
Differential Revision: D96303740
fbshipit-source-id: d649cb04bd7370af55ce707d607a372d7b4115b4
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56071
Changelog: [Internal]
Adds `--view` argument to the snapshot generator, which allows to generate a single snapshot view instead of all of them.
Reviewed By: cipolleschi
Differential Revision: D96280524
fbshipit-source-id: 6ebf3689e7b0256ba54c3d5a8e1dd602b044ec02
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56069
Changelog: [Internal]
Fixes handling of member function pointers in the C++ Api snapshot.
Reviewed By: cipolleschi
Differential Revision: D96279461
fbshipit-source-id: 42e7b004878eedfbbb8504345165bb1d60acde78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56068
Changelog: [Internal]
Adds support for templates in variable declaration to the c++ API snapshot generator
Reviewed By: cipolleschi
Differential Revision: D96279463
fbshipit-source-id: eb68f97f926e4a407d6c7fa2dda6edf7e43e23ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56060
There are Objective-C files located in the `packages/react-native/Libraries` paths. This diff modifies the config to tell doxygen to parse them and fixes problem with parsing interfaces and protocols that share the same name.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D96141632
fbshipit-source-id: 76c5873574108eb0f610637ce2bd2eeb54b8537c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56058
Changelog: [Internal]
Doxygen may incorrectly resolve reference to a friend declaration or inherited constructor instead of the actual friend or the base class.
This diff updates the qualification algorithm to try to requalify cases like these.
Reviewed By: cipolleschi
Differential Revision: D96129278
fbshipit-source-id: fba4c78c74d43870a2a14f5eedce061ba6f2793d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56032
Changelog: [Internal]
When generating xml output, doxygen replaces template arguments in specialized base classes with the default values:
```
template <typename T = int>
class Test : public Base<T> {};
```
becomes
```
template <typename T = int>
class Test : public Base<int> {};
```
To work around this issue, this diff adds reverse mapping for template params in the base classes. In the above case, the map would be: `{ "int" -> "T" }`, and `int` in `Base<int>` would be replaced with T.
This approach assumes that none of the default values are used directly in the base class specialization, which holds for the React Native codebase.
Reviewed By: cortinico
Differential Revision: D95933835
fbshipit-source-id: c1dd79a09f0f368fb106330409e15d54ebad2b4f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56027
Changelog: [Internal]
The current implementation swaps the ordering of `const` and `mutable` keywords. This diff fixes it.
Reviewed By: cortinico
Differential Revision: D95912404
fbshipit-source-id: 6f726f0793b129fdd85b34b4c92dd22cf11bfb41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56033
Changelog: [Internal]
Currently, if the source code uses globally qualified identifiers, those will be kept in the snapshot without changes. Since in the output, everything is fully qualified, the leading `::` can be stripped from those.
Reviewed By: cortinico
Differential Revision: D95947334
fbshipit-source-id: 9592b00bd896679dda90ed56d32024b22752d2b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56030
Changelog: [Internal]
Currently, the parser ignores all private sections, which causes private type aliases definitions not to be present in the snapshot. The refereces to those types can still appear in the public API, if they are resolvable to public types.
This diff updates the parser to track private type definitions, and inline them when referenced from the public API.
Reviewed By: cortinico
Differential Revision: D95920125
fbshipit-source-id: 054786987c266ac1062c0fa3ba1631cb179fb6ef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55997
Changelog: [Internal]
Updates the C++ API snapshot generator to invoke codegen automatically for each created API view, generating for the specific platform that's being considered.
Reviewed By: cipolleschi
Differential Revision: D95788766
fbshipit-source-id: 8b376542f7822b73e44399c2615c327332378830
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56031
Changelog: [Internal]
Doxygen uses base class name for inherited constructors. This diff adds a guard to replace them with the derived class name in the final API snapshot.
Reviewed By: cipolleschi
Differential Revision: D95939080
fbshipit-source-id: 918135b8c5c603423e3a13537d9723e54ed4f035
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55979
Fixes issue with parsing lightweight objective-c generics. Doxygen produces malformed xml output due to incorrect handling of interfaces such as:
```obj-c
interface Foo<T> : NSObject
end
```
The solution is to encode the interface into the form of `interface Foo__GENERICS_T_ENDGENERICS`, then produce the snapshot and finally decode it back to `interface Foo<T>`.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D95567196
fbshipit-source-id: c8ae97f99e893ecd48ded21f24a650286d708c60
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55971
Changelog: [Internal]
Doxygen incorrectly transforms parameter names to references if they match a member. This diff strips the resulting invalid qualification from the type.
Reviewed By: cipolleschi
Differential Revision: D95548542
fbshipit-source-id: c1e475f10e07af6a4076336cab0d3cbe0da342e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55973
Adds input filter for stripping methods marked as `NS_UNAVAILABLE` which shouldn't be part of the public API.
Changelog:
[Internal]
Reviewed By: cipolleschi
Differential Revision: D95552298
fbshipit-source-id: 2e5b33f047bfda259733b92b187ce86d9967cf93