chore(Tabs): align naming for native components#3658
Conversation
android/src/main/java/com/swmansion/rnscreens/gamma/tabs/screen/TabScreenEventEmitter.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/swmansion/rnscreens/gamma/tabs/host/TabsHostAppearanceApplicator.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This pull request performs a comprehensive renaming of the tabs native components to align with more consistent naming conventions. The PR renames RNSBottomTabs to RNSTabsHost, RNSBottomTabsScreen to RNSTabsScreen, and RNSBottomTabsAccessory to RNSTabsBottomAccessory. This is a pure refactoring change that maintains all functionality while improving code organization and naming consistency.
Changes:
- Renamed all TypeScript native component specifications from
BottomTabs*toTabs*patterns - Renamed iOS native components, event emitters, and view controllers with new naming scheme
- Renamed Android ViewManagers and reorganized package structure (introduced
hostandscreensub-packages withingamma.tabs) - Renamed C++ Fabric ShadowNode, State, and ComponentDescriptor files to match new naming
- Added
codegenUtils.tsfile (copied from react-native-svg) forUnsafeMixedtype helper
Reviewed changes
Copilot reviewed 89 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/fabric/tabs/TabsScreenNativeComponent.ts |
Updated component name from RNSBottomTabsScreen to RNSTabsScreen |
src/fabric/tabs/TabsHostNativeComponent.ts |
Updated component name from RNSBottomTabs to RNSTabsHost |
src/fabric/tabs/TabsBottomAccessoryNativeComponent.ts |
Updated component name from RNSBottomTabsAccessory to RNSTabsBottomAccessory |
src/fabric/tabs/TabsBottomAccessoryContentNativeComponent.ts |
Updated component name from RNSBottomTabsAccessoryContent to RNSTabsBottomAccessoryContent |
src/fabric/tabs/codegenUtils.ts |
New file: adds UnsafeMixed type helper for codegen |
src/components/tabs/TabsScreen.tsx |
Updated imports to use new TabsScreenNativeComponent path |
src/components/tabs/TabsHost.tsx |
Updated imports to use new TabsHostNativeComponent path |
src/components/tabs/TabsAccessory.tsx |
Updated imports to use new TabsBottomAccessoryNativeComponent |
src/components/tabs/TabsAccessoryContent.tsx |
Updated imports to use new TabsBottomAccessoryContentNativeComponent |
ios/tabs/screen/*.{h,mm} |
Renamed all iOS screen-related classes from RNSBottomTabsScreen* to RNSTabsScreen* |
ios/tabs/host/*.{h,mm} |
Renamed all iOS host-related classes from RNSBottomTabsHost* to RNSTabsHost* |
ios/tabs/bottom-accessory/*.{h,mm} |
Renamed all iOS accessory classes from RNSBottomTabsAccessory* to RNSTabsBottomAccessory* and RNSBottomAccessoryHelper to RNSTabsBottomAccessoryHelper |
ios/tabs/RCTConvert+RNSTabs.{h,mm} |
Renamed category and updated enum type names |
ios/tabs/RNSTabBarAppearanceCoordinator.{h,mm} |
Updated type references and imports |
ios/conversion/RNSConversions*.{h,mm} |
Updated all conversion function names to use Tabs* naming |
ios/utils/RNSDefines.h |
Renamed macro from RNS_BOTTOM_ACCESSORY_AVAILABLE to RNS_TABS_BOTTOM_ACCESSORY_AVAILABLE |
ios/RNSEnums.h |
Renamed enums from RNSBottomTabs* to RNSTabs* |
android/src/main/java/.../tabs/screen/*.kt |
Moved screen classes to screen sub-package and renamed manager from TabScreenViewManager to TabsScreenViewManager |
android/src/main/java/.../tabs/screen/event/*.kt |
Moved event classes to screen.event package |
android/src/main/java/.../tabs/host/*.kt |
Moved host classes to host sub-package |
android/src/main/java/.../tabs/host/event/*.kt |
Moved host event class to host.event package |
android/src/paper/java/.../viewmanagers/RNSTabs* |
Renamed Paper architecture interface and delegate classes |
android/src/main/jni/rnscreens.h |
Updated include to use RNSTabsHostComponentDescriptor.h |
common/cpp/.../RNSTabsHost* |
Renamed all TabsHost-related C++ files and classes |
common/cpp/.../RNSTabsBottomAccessory* |
Renamed all TabsBottomAccessory-related C++ files and classes |
package.json |
Updated Fabric component class name mappings |
react-native.config.js |
Updated descriptor name from RNSBottomTabsComponentDescriptor to RNSTabsHostComponentDescriptor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kmichalikk
left a comment
There was a problem hiding this comment.
Some thoughts:
-
Let's maybe move the resource id refactor to separate PR
-
You might also create a PR for moving android tabs from
gamma/folder -
There are still few places where BottomTabs could be replaced with Tabs, i.e. in GUIDE_FOR_LIBRARY_AUTHORS and code comments (ctrl + f). There is also
controlledBottomTabsflag - should we change it?
android/src/main/java/com/swmansion/rnscreens/gamma/tabs/screen/TabScreenEventEmitter.kt
Outdated
Show resolved
Hide resolved
cbd71b6 to
f2cba90
Compare
Will do so in separate PR(s).
I think this should be handled in separate PRs. I added a ticket to rename |
kkafar
left a comment
There was a problem hiding this comment.
The code changes look good. I've checked only the diff.
I haven't verified runtime behavior. Please make sure you do.
kkafar
left a comment
There was a problem hiding this comment.
One thing I'm mising here is usage of TabsScreen on Android, right? We should keep it aligned between platforms
Thank you for spotting this, don't know how I've missed that 😅 |
I've checked |
Description
Aligns naming for native components in tabs (TabsHost, TabsScreen, TabsBottomAccessory).
Closes https://github.com/software-mansion/react-native-screens-labs/issues/782.
Changes
.h/.cppShadowTree filesBefore & after - visual documentation
No visual changes.
Test plan
Tabs should work without any changes on both platforms & both architectures.
Checklist