-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turbo module codegen support interface with inheritance in module (#3…
…6011) Summary: The [previous pull request](#35812) enables defining interfaces and using them in a turbo module, but all members are flattened, this is not the best option for codegen for object oriented languages. In this pull request, an optional member `baseTypes` is added to aliased objects. Members are still flattened for backward compatibility, if a codegen doesn't care about that nothing needs to be changed. ### Example ```typescript interface A { a : string; } interface B extends A { b : number; } ``` #### Before the previous pull request `interface` is not allowed here, you must use type alias. #### At the previous pull request `interface` is allowed, but it is translated to ```typescript type A = {a : string}; type B = {a : string, b : number}; ``` #### At this pull request Extra information is provided so that you know `B` extends `A`. By comparing `B` to `A` it is easy to know that `B::a` is obtained from `A`. ## Changelog [GENERAL] [CHANGED] - Turbo module codegen support interface with inheritance in module Pull Request resolved: #36011 Test Plan: `yarn jest react-native-codegen` passed Reviewed By: rshest Differential Revision: D42882650 Pulled By: cipolleschi fbshipit-source-id: 32d502e8a99c4151fae0a1f4dfa60db9ac827963
- Loading branch information
1 parent
597a1ff
commit bf34810
Showing
3 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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