72 Commits
Author SHA1 Message Date
Dawid Małecki b60f0c9f04 Change parser config to accept regex in exclude symbols field. (#56367)
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
2026-04-09 07:04:52 -07:00
Dawid Małecki 8bf151f532 Remove members that reference excluded symbols (#56341)
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
2026-04-09 07:04:52 -07:00
Dawid Małecki fd150efa29 Exclude Android specific symbols from the ReactApple snapshot (#56243)
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
2026-03-31 08:32:57 -07:00
Dawid Małecki d513096133 Add exclude_symbols to the cxx-api parser config (#56240)
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
2026-03-31 08:32:57 -07:00
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 b0b30b5a22 Add global exclude patterns to the cxx api config (#56248)
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
2026-03-31 08:32:57 -07:00
generatedunixname907704562031852 b8149bc438 Fix CSFImportlibAbc issues [A] (#56283)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56283

Reviewed By: bowiechen

Differential Revision: D97588841

fbshipit-source-id: 5a6beef9c6eb6861030e175c7942ea8835c2407e
2026-03-30 21:53:55 -07:00
Jakub Piasecki 7b3277f358 Qualify conversion operator type names in the snapshot (#56220)
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
2026-03-26 08:40:54 -07:00
Jakub Piasecki f516811a95 Fix pointer-to-member-function param with ref-qualifier (#56219)
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
2026-03-26 08:40:54 -07:00
Jakub Piasecki 015cd13ab1 Deduplicate base classes from Doxygen using declaration (#56218)
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
2026-03-26 08:40:54 -07:00
Jakub Piasecki 31f262ed2e Fix function pointer param args being qualified to outer class (#56217)
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
2026-03-26 08:40:54 -07:00
Jakub Piasecki cc9d06bef7 Fix array brackets appearing in the wrong place in the snapshot (#56214)
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
2026-03-26 08:40:54 -07:00
Jakub Piasecki e59957137a Deduplicate constructors when a class has multiple base classes (#56213)
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
2026-03-26 08:40:54 -07:00
Jakub Piasecki 33158cb18d Handle member array types in the snapshot (#56206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56206

Changelog: [Internal]

Correctly handles array types in member definitions in the API snapshot.

Reviewed By: cipolleschi

Differential Revision: D97923375

fbshipit-source-id: b8b9ca07e819bfaa7cbaf7ad6506fd32a9719a9d
2026-03-26 08:40:54 -07:00
Dawid Małecki 0b1ce70b62 Prevent identifiers being qualified to themselves (#56091)
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
2026-03-18 09:29:02 -07:00
Dawid Małecki 78a7718d6c Extract member specializations from name (#56076)
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
2026-03-18 09:29:02 -07:00
Dawid Małecki 248d38e5c1 Fix qualification of enum values in template specialization args (#56070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56070

Changelog: [Internal]

Fixes qualification of unscoped enum values used as template specialization arguments.

Reviewed By: cipolleschi

Differential Revision: D96279462

fbshipit-source-id: d151b069124b352451964a31da0385744d21013f
2026-03-18 09:29:02 -07:00
Dawid Małecki d0ec2956f8 Fix handling of member function pointers in the API snapshot (#56069)
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
2026-03-18 09:29:02 -07:00
Dawid Małecki 882dbe0118 Handle template variables in the API snapshot (#56068)
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
2026-03-18 09:29:02 -07:00
Jakub Piasecki 150377caf0 Move input_filters inside the parser package (#56054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56054

Changelog: [Internal]

Moves `input_filers` inside the `parser` package. Imports outside of the package were causing errors when running the snapshot generator in OSS.

Reviewed By: cipolleschi

Differential Revision: D96109755

fbshipit-source-id: c29d70c895057fd51a92c1a073b331d27c0b289b
2026-03-11 23:58:46 -07:00
Jakub Piasecki 4e1a8777ba Requalify incorrect references produced by doxygen (#56058)
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
2026-03-11 23:51:12 -07:00
Jakub Piasecki f1ac82ca93 Don't include private compound objects in the snapshot (#56028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56028

Changelog: [Internal]

Updates the snapshot generator to ignore compound objects with visibility set to `private`.

Reviewed By: cortinico

Differential Revision: D95913606

fbshipit-source-id: 3c5b2e0bf46e16627c3f6bdf6cd700a862f56698
2026-03-11 01:42:26 -07:00
Jakub Piasecki a5daece0b3 Add reverse mapping for default values in base class specialization (#56032)
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
2026-03-11 01:40:36 -07:00
Jakub Piasecki 7425a5f9c6 Fix ordering of const and mutable keywords (#56027)
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
2026-03-11 00:18:57 -07:00
Jakub Piasecki 94f40e7591 Strip leading :: for globally qualified identifiers (#56033)
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
2026-03-11 00:17:04 -07:00
Jakub Piasecki 7f6790bf79 Inline private type aliases in the API snapshot (#56030)
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
2026-03-11 00:14:41 -07:00
Jakub Piasecki 4fcd2f9f6d Run codegen for each API view separately (#55997)
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
2026-03-10 09:09:06 -07:00
Jakub Piasecki 7d80d6e5a1 Use the derived class name in inherited constructors in the API snapshot (#56031)
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
2026-03-10 06:53:06 -07:00
Dawid Małecki 2be2770fc8 Fix issue with parsing lightweight objective-c generics (#55979)
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
2026-03-10 04:50:31 -07:00
Jakub Piasecki 41a1941961 Remove incorrect qualification from function parameters (#55971)
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
2026-03-08 23:52:42 -07:00
Dawid Małecki d83bf7394b Add input filter for stripping methods marked as NS_UNAVAILABLE (#55973)
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
2026-03-06 10:15:51 -08:00
Dawid Małecki 0686cde779 Strip __deprecated_msg in the preprocessing (#55970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55970

Strips `__deprecated_msg` annotations due to incorrect parsing when in front of the interfaces (predefining does not help unfortunately). It doesn't fully solve the issue stated in the added test as doxygen also has problem with parsing interfaces for which the base class is in the new line.

```
interface Foo
           : Bar<NSObject>
end
```

This will be handled by the fix in the doxygen.

This diff also adds stripping the `__deprecated` label which is again incorrectly parsed by doxygen.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D95541064

fbshipit-source-id: 08aca2eb5ed8b1897166d385ab513879e7ecbad7
2026-03-06 08:09:48 -08:00
Jakub Piasecki c0f2f63ce1 Qualify identifiers in template specializations (#55929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55929

Changelog: [Internal]

Adds support for identifier qualification when using template specializations and when inheriting from template objects.

Reviewed By: cortinico

Differential Revision: D95367957

fbshipit-source-id: 60f7057e3fa1c5fbc117ff03a50de43c2f0dc371
2026-03-06 06:54:33 -08:00
Dawid Małecki dc8c442aa5 Normalize template specialization angle bracket spacing (#55910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55910

Normalizes angle bracket spacing in scope names for template specializations.

Doxygen encodes template specializations with spaces around angle brackets in compound names (e.g., `CSSDataTypeParser< CSSMatrix >`). This caused inconsistent output in API snapshots.

The fix applies `normalize_angle_brackets()` to qualified paths when parsing scope names, ensuring consistent output:
- `CSSDataTypeParser< CSSMatrix >` → `CSSDataTypeParser<CSSMatrix>`
- `Callback< R(Args...)>` → `Callback<R(Args...)>`

Added a new test case `should_normalize_template_specialization_angle_brackets` to verify the fix.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D95204780

fbshipit-source-id: d0d5fe7759a414b32630647f334b39e26da15108
2026-03-05 07:21:42 -08:00
Dawid Małecki 78c8842f9e Normalize Objective-C nullability annotations (#55898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55898

Normalize Objective-C nullability annotations in the cxx-api parser to ensure consistent output in API snapshots.

Objective-C has three different forms of nullability annotations that are semantically equivalent:
- `nonnull`/`nullable` (context-sensitive keywords)
- `_Nonnull`/`_Nullable` (type qualifiers)
- `__nonnull`/`__nullable` (legacy Apple macros)

This diff normalizes all forms to `_Nonnull`/`_Nullable` for consistency.

**Examples:**
- `nonnull NSString*` → `_Nonnull NSString*`
- `NSString* __nonnull` → `NSString* _Nonnull`
- `nullable id` → `_Nullable id`
- `id __nullable` → `id _Nullable`
- `NSString* _Nonnull` → `NSString* _Nonnull` (unchanged)

Added a test case to verify the normalization works correctly.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D95195669

fbshipit-source-id: ca2afd14b3c8bf7e62864daf9c3848f5d713898e
2026-03-05 07:21:42 -08:00
Dawid Małecki 725b056dc7 Filter category members from interface scope (#55899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55899

Doxygen incorrectly merges category members into the base interface XML output.
This causes duplicate members to appear in both the category scope and the interface scope.

The fix detects category members by checking if their definition contains the pattern
`ClassName(CategoryName)::` (e.g., `RCTBridgeProxy(Cxx)::cxxOnlyProperty`) and filters
them out when processing interface sections.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D95191148

fbshipit-source-id: 69d2f35d5aabd8e7567d254dc9b4686b4da2eb89
2026-03-05 07:21:42 -08:00
Dawid Małecki 97430c8165 Include definitions behind __cplusplus macro (#55902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55902

Includes definitions behind the `__cplusplus` macro to also be visible in the API snapshot.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D95189538

fbshipit-source-id: 35a632b83b6d6c4f330ac80b52b4ee203f692748
2026-03-05 07:21:42 -08:00
Dawid Małecki f2ea073857 Normalize pointer and reference spacing in parser output (#55901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55901

Fixes inconsistent spacing around pointer (`*`) and reference (`&`, `&&`) symbols in the parser output.

Doxygen outputs types with a space before `*` and `&` (e.g., `NSString *`), which is inconsistent. This diff adds `normalize_pointer_spacing()` to standardize the output:

- `NSString *` → `NSString*`
- `int &` → `int&`
- `T &&` → `T&&`
- For function arguments: `NSString *name` → `NSString* name`

## Changes

1. Added `normalize_pointer_spacing()` function in `text_resolution.py`
2. Applied normalization in `resolve_ref_text_name()` and `resolve_linked_text_name()`
3. Applied normalization to block property argsstrings in `builders.py`
4. Updated all affected snapshot files to use normalized spacing

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D95078214

fbshipit-source-id: 1a21361565fd7915a3a597ac729cecc2cfe99961
2026-03-05 07:21:42 -08:00
Dawid Małecki 6558d0d374 Add doxygen input filter to strip block comments (#55888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55888

Adds a doxygen input filter (`input_filters/doxygen_strip_comments.py`) that strips block comments from source files before doxygen parses them.

This prevents doxygen from incorrectly parsing Objective-C code examples (like `interface`, `protocol`) within documentation comments as actual code declarations. For example, a doc comment containing:

```
/**
 * Example:
 *   interface RCT_EXTERN_MODULE(MyModule, NSObject)
 *   end
 */
```

Was being parsed by doxygen as an actual interface declaration, resulting in malformed output like `interface RCT_EXTERN_MODULE {}` in the API snapshot.

The filter preserves line numbers by replacing comment content with the equivalent number of newlines, ensuring error messages remain accurate.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D94538938

fbshipit-source-id: 4abbb9ed80cc1ca8eb8f128a4f06a0f4d2bc70d3
2026-03-05 07:21:42 -08:00
Dawid Małecki a6d29d0d38 Set more predefined macros in the doxygen config. (#55900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55900

Doxygen incorrectly parses macros like `NS_DESIGNATED_INITIALIZER`,  `RCT_EXTERN`, `RCT_DEPRECATED`, `RCT_EXTERN_MODULE`, `API_AVAILABLE`. Setting them them as predefined empty string solves the issue.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94534964

fbshipit-source-id: 57a084e58479d079d43b234e3882346c5c443a69
2026-03-05 07:21:42 -08:00
Dawid Małecki d680d7001e Remove __deprecated_msg from the snapshot (#55780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55780

Set predefined `__deprecated_msg` to empty string in the `.doxygen.config.template` as doxygen has problem with parsing and produces malformed xml.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D94517576

fbshipit-source-id: eaaf0f66feacb47f725c34a5c93201f5103b92bb
2026-03-05 07:21:42 -08:00
Dawid Małecki 47ef0e173f Fix parsing of Objective-C block properties (#55776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55776

Doxygen splits block property types across `<type>` and `<argsstring>` elements. For example:

```objc
property (nonatomic, copy) void (^eventInterceptor)(NSString *eventName, NSDictionary *event, NSNumber *reactTag);
```

Produces XML like:
```xml
<type>void(^</type>
<name>eventInterceptor</name>
<argsstring>)(NSString *eventName, NSDictionary *event, NSNumber *reactTag)</argsstring>
```

This caused the parser to output incomplete types. The fix detects when the property type ends with `(^` and combines it with the property name and argsstring:
```
property (copy) void(^eventInterceptor)(NSString *eventName, NSDictionary *event, NSNumber *reactTag);
```

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94366205

fbshipit-source-id: 2d741401f63916284d453f1112ae0f349234308e
2026-03-05 07:21:42 -08:00
Dawid Małecki d473d9b598 Fix parsing of Objective-C interface generic inheritance (#55775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55775

Doxygen incorrectly parses Objective-C interface declarations with protocol conformance. For example:

```objc
interface RCTAppearance : RCTEventEmitter <RCTBridgeModule>
```

Doxygen splits this into **two separate base classes** in the XML:
```xml
<basecompoundref>RCTEventEmitter</basecompoundref>
<basecompoundref>&lt;RCTBridgeModule&gt;</basecompoundref>
```

This caused the parser to output:
```
interface RCTAppearance : public RCTEventEmitter, public <RCTBridgeModule> {
```

Instead of the expected:
```
interface RCTAppearance : public RCTEventEmitter <RCTBridgeModule> {
```

The fix detects when a "base class" name starts and ends with `<...>` (indicating it's a protocol conformance) and combines it with the preceding actual base class name.

Also for multiple generics like:
```
interface RCTAlertManager : NSObject <RCTBridgeModule, RCTInvalidating>

end
```

The output should be
```
interface RCTAlertManager : public NSObject <RCTBridgeModule, RCTInvalidating>
end
```

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94351731

fbshipit-source-id: 05ee2729c7a60800e9350193ef04ee6e2b125522
2026-03-05 07:21:42 -08:00
Dawid Małecki 4a3080bea3 Add test for parsing interfaces with deprecated attributes (#55771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55771

Adding tests for parsing interfaces with deprecated attributes and extending the doxygen test config with `__attribute__` predefined macro.

## Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94343118

fbshipit-source-id: 2fb2f8307f324533033ea1df2f266a785dc81de7
2026-03-04 03:24:39 -08:00
Dawid Małecki c90843d8f8 Add support for categories (#55773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55773

This diff adds support for parsing Objective-C categories in the C++ API snapshot parser.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94076350

fbshipit-source-id: 7dd144a09b8cd5e2b91d008cb2a5882226dfd293
2026-03-04 02:47:32 -08:00
Dawid Małecki 851e5ae546 Parser refactor (#55772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55772

The `main.py` increases rapidly in size. This diff refactors that into the `utils.py` and `builder.py` to form more modularized and easier to read structure.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94072940

fbshipit-source-id: f4b7b3c3bf4e2cf387829ced039d5645e2ad4b3e
2026-03-04 01:55:35 -08:00
Dawid Małecki 9ec7db552f Add support for parsing interfaces (#55770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55770

This diff adds support for parsing Objective-C interfaces in the C++ API snapshot parser.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94071995

fbshipit-source-id: b1b89d520a489be7c4a0e790874dd9f7b518df35
2026-03-03 08:33:27 -08:00
Dawid Małecki 16202980ed Add support for parsing protocols (#55766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55766

This diff adds support for parsing Objective-C protocols in the C++ API snapshot parser. The angle bracket normalization is also added to ensure better snapshot structure.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D93859440

fbshipit-source-id: 21c4a47e33df0c61e738e07c5b56cfccd56af1a4
2026-03-03 07:45:45 -08:00
Jakub Piasecki f018728997 Unmangle templates in doxygen output (#55848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55848

Changelog: [Internal]

Updates doxygen refid resolver to unmangle the template arguments.

Reviewed By: cipolleschi

Differential Revision: D94901504

fbshipit-source-id: 8082b3e22882c8b313caa6ea97e2bfd0b8b588b7
2026-03-03 01:00:16 -08:00
Jakub Piasecki 11072438f1 Don't requalify already globally qualified identifiers (#55847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55847

Changelog: [Internal]

Disables name qualification on already globally qualified identifiers.

Reviewed By: cortinico

Differential Revision: D94901503

fbshipit-source-id: 22206b454c37e7e061abf34d64839f79c82eea1f
2026-03-03 01:00:16 -08:00