Skip to content

refactor: modernize typescript setup - #4999

Merged
satya164 merged 5 commits into
mainfrom
@satya164/type-updates
Jun 15, 2026
Merged

refactor: modernize typescript setup#4999
satya164 merged 5 commits into
mainfrom
@satya164/type-updates

Conversation

@satya164

Copy link
Copy Markdown
Member

No description provided.

CopilotAI review requested due to automatic review settings June 15, 2026 12:20

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the repository’s TypeScript/Jest setup (bundler-style module resolution, React 17+ JSX transform, verbatim type-only imports) and updates assorted dependencies/config to support source-based resolution in the monorepo example/docs.

Changes:

  • Update TypeScript compiler settings (e.g., moduleResolution: "bundler", jsx: "react-jsx", verbatimModuleSyntax) and align code with type-only imports.
  • Migrate Jest tests to import APIs from @jest/globals instead of relying on global types.
  • Update monorepo/example configuration and tooling dependencies (e.g., react-native-builder-bob, Metro config conditions).

Reviewed changes

Copilot reviewed 197 out of 200 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
yarn.lockLockfile updates for dependency/tooling changes (e.g., bob/typescript transitive updates).
tsconfig.jsonSwitch to modern TS settings (react-jsx, bundler resolution, verbatim module syntax, etc.).
package.jsonRename source entry field, add @jest/globals, bump react-native-builder-bob.
.eslintrcDisable React-in-JSX-scope lint rules for the new JSX transform.
jest/jest-native.d.tsAdd TS matcher augmentation for @testing-library/jest-native.
src/utils/useIsKeyboardShown.tsxConvert value imports to type-only where applicable.
src/utils/forwardRef.tsxRemove custom forwardRef helper (previously used to avoid large prop unions).
src/utils/tests/splitStyles.test.tsUse @jest/globals imports; align with new TS types setup.
src/utils/tests/hasTouchHandler.test.tsUse @jest/globals imports; align with new TS types setup.
src/theme/provider.tsxConvert $DeepPartial to type-only import.
src/theme/tests/provider.test.tsUse @jest/globals imports.
src/core/useSystemColorScheme.tsConvert ColorSchemeName to type-only import.
src/core/settings.tsxConvert IconProps to type-only import.
src/core/SafeAreaProviderCompat.tsxConvert RN types to type-only imports.
src/core/PaperProvider.tsxConvert Settings to type-only import.
src/core/tests/theming.test.tsxUse @jest/globals imports.
src/core/tests/PaperProvider.test.tsxUse @jest/globals imports and improve typed mocks.
src/components/Typography/Text.tsxType-only imports + ref handling refactor (now modeled as a prop).
src/components/Typography/AnimatedText.tsxType-only imports + ref handling refactor (now modeled as a prop).
src/components/TouchableRipple/TouchableRipple.tsxType-only imports + ref handling refactor (now modeled as a prop).
src/components/TouchableRipple/TouchableRipple.native.tsxType-only imports + ref handling refactor (now modeled as a prop).
src/components/Tooltip/utils.tsConvert RN types to type-only imports.
src/components/Tooltip/Tooltip.tsxConvert local/RN types to type-only imports.
src/components/ToggleButton/ToggleButtonRow.tsxConvert RN types to type-only imports.
src/components/ToggleButton/ToggleButton.tsxConvert RN types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/TextInput/utils.tsConvert RN/Reanimated types to type-only imports.
src/components/TextInput/TextInputIcon.tsxConvert RN types to type-only imports.
src/components/TextInput/TextInputErrorIcon.tsxConvert RN types to type-only imports; remove unused React import.
src/components/TextInput/TextInput.tsxConvert RN/Reanimated types to type-only imports; adjust render-props typing for ref.
src/components/TextInput/hooks.tsConvert RN event types to type-only imports.
src/components/Surface.tsxConvert RN types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/Snackbar.tsxConvert RN types to type-only imports.
src/components/SegmentedButtons/utils.tsConvert RN types to type-only imports.
src/components/SegmentedButtons/SegmentedButtons.tsxRemove unnecessary React import (new JSX transform); type-only imports.
src/components/SegmentedButtons/SegmentedButtonItem.tsxConvert TouchableRipple props to type-only import.
src/components/Searchbar.tsxConvert RN types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/RadioButton/RadioButtonItem.tsxConvert RN/local types to type-only imports.
src/components/RadioButton/RadioButtonIOS.tsxConvert RN/local types to type-only imports; remove unused React import.
src/components/RadioButton/RadioButtonAndroid.tsxConvert local types to type-only imports.
src/components/RadioButton/RadioButton.tsxConvert RN types to type-only imports; remove unused React import.
src/components/ProgressBar.tsxConvert RN types to type-only imports; use ViewProps for props typing.
src/components/Portal/Portal.tsxConvert PortalMethods to type-only import.
src/components/Modal.tsxConvert RN types to type-only imports.
src/components/Menu/MenuItem.tsxConvert Icon/IconSource and TouchableRipple props to type-only imports.
src/components/Menu/Menu.tsxConvert RN types to type-only imports.
src/components/MaterialCommunityIcon.tsxConvert RN types to type-only imports.
src/components/List/utils.tsConvert RN types to type-only imports.
src/components/List/ListSubheader.tsxConvert RN types to type-only imports.
src/components/List/ListSection.tsxConvert RN types to type-only imports; use ViewProps for props typing.
src/components/List/ListItem.tsxConvert utils Style to type-only import + ref handling refactor (now modeled as a prop).
src/components/List/ListImage.tsxConvert RN types to type-only imports; remove unused React import.
src/components/List/ListIcon.tsxConvert RN/IconSource types to type-only imports; remove unused React import.
src/components/List/ListAccordion.tsxConvert TouchableRipple props to type-only import.
src/components/IconButton/IconButton.tsxConvert RN/IconSource types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/Icon.tsxSplit RN value/type imports to satisfy verbatim module syntax.
src/components/FAB/utils.tsConvert RN/token types to type-only imports.
src/components/FAB/Shell.tsxConvert Reanimated/token types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/FAB/Menu.tsxConvert RN/token/icon types to type-only imports.
src/components/FAB/FAB.tsxConvert token types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/FAB/Extended.tsxConvert token types to type-only imports + ref handling refactor (now modeled as a prop).
src/components/FAB/Content.tsxConvert RN/Reanimated/IconSource types to type-only imports.
src/components/Drawer/DrawerSection.tsxConvert RN types to type-only imports; use ViewProps for props typing.
src/components/Drawer/DrawerItem.tsxConvert RN/IconSource/TouchableRipple props types to type-only imports; use ViewProps.
src/components/Drawer/DrawerCollapsedItem.tsxConvert RN/IconSource types to type-only imports; use ViewProps.
src/components/Divider.tsxConvert RN types to type-only imports; remove unused React import.
src/components/Dialog/utils.tsConvert RN types to type-only imports.
src/components/Dialog/DialogTitle.tsxConvert RN types to type-only imports.
src/components/Dialog/DialogScrollArea.tsxConvert RN types to type-only imports; use ViewProps.
src/components/Dialog/DialogIcon.tsxConvert RN/IconSource types to type-only imports; remove unused React import.
src/components/Dialog/DialogContent.tsxConvert RN types to type-only imports; use ViewProps.
src/components/Dialog/DialogActions.tsxConvert RN and local types to type-only imports; use ViewProps.
src/components/Dialog/Dialog.tsxConvert RN and local types to type-only imports.
src/components/DataTable/DataTableTitle.tsxConvert RN types to type-only imports; use PressableProps for props typing.
src/components/DataTable/DataTableRow.tsxConvert RN types to type-only imports.
src/components/DataTable/DataTablePagination.tsxConvert RN types to type-only imports; use ViewProps.
src/components/DataTable/DataTableHeader.tsxConvert RN types to type-only imports; use ViewProps.
src/components/DataTable/DataTableCell.tsxConvert RN types to type-only imports.
src/components/DataTable/DataTable.tsxConvert RN types to type-only imports; use ViewProps.
src/components/CrossFadeIcon.tsxConvert ColorValue/IconSource to type-only imports.
src/components/Chip/Chip.tsxConvert helper types and TouchableRipple props to type-only imports.
src/components/Checkbox/CheckboxItem.tsxConvert TouchableRipple props to type-only import; remove unused React import.
src/components/Card/CardTitle.tsxConvert RN types to type-only imports; use ViewProps.
src/components/Card/CardCover.tsxConvert RN types to type-only imports; use ImageProps.
src/components/Card/CardContent.tsxConvert RN types to type-only imports; use ViewProps.
src/components/Card/CardActions.tsxConvert RN and local types to type-only imports; use ViewProps.
src/components/Card/Card.tsxConvert RN types to type-only imports; ref handling refactor (now modeled as a prop).
src/components/Button/Button.tsxConvert RN/IconSource/TouchableRipple props to type-only imports; ref handling refactor (now modeled as a prop).
src/components/BottomNavigation/BottomNavigationRouteScreen.tsxConvert ReactNode/ViewProps to type-only imports; remove unused ReactNode value import.
src/components/BottomNavigation/BottomNavigationBar.tsxConvert IconSource/TouchableRippleProps to type-only imports.
src/components/BottomNavigation/BottomNavigation.tsxConvert TouchableRippleProps to type-only import.
src/components/Banner.tsxConvert IconSource to type-only import; adjust RN type-only imports.
src/components/Badge.tsxConvert RN types to type-only imports.
src/components/Avatar/AvatarText.tsxConvert RN types to type-only imports; use ViewProps.
src/components/Avatar/AvatarImage.tsxConvert RN types to type-only imports; use ViewProps.
src/components/Avatar/AvatarIcon.tsxConvert IconSource to type-only import; use ViewProps.
src/components/Appbar/AppbarHeader.tsxConvert RN types to type-only imports.
src/components/Appbar/AppbarContent.tsxConvert TextRef to type-only import; adjust RN imports.
src/components/Appbar/AppbarBackIcon.tsxConvert ColorValue to type-only import.
src/components/Appbar/AppbarBackAction.tsxRemove forwardRef wrapper; ref handling refactor (now modeled as a prop).
src/components/Appbar/AppbarAction.tsxRemove forwardRef wrapper; ref handling refactor (now modeled as a prop).
src/components/Appbar/Appbar.tsxConvert RN and local util types to type-only imports; use ViewProps.
src/components/ActivityIndicator.tsxConvert RN types to type-only imports; use ViewProps.
src/components/tests/Typography/Text.test.tsxUse @jest/globals imports.
src/components/tests/TouchableRipple.test.tsxUse @jest/globals imports; improve jest.fn typing.
src/components/tests/Tooltip.test.tsxUse @jest/globals imports; ref typing adjustments in dummy component.
src/components/tests/ToggleButton.test.tsxUse @jest/globals imports.
src/components/tests/TextInput.test.tsxUse @jest/globals imports; improve handler typing.
src/components/tests/Switch.test.tsxUse @jest/globals imports.
src/components/tests/Surface.test.tsxUse @jest/globals imports; replace template tables with typed arrays.
src/components/tests/Snackbar.test.tsxUse @jest/globals imports.
src/components/tests/SegmentedButton.test.tsxUse @jest/globals imports; replace template tables with typed arrays/generics.
src/components/tests/Searchbar.test.tsxUse @jest/globals imports.
src/components/tests/RadioButton/utils.test.tsxUse @jest/globals imports.
src/components/tests/RadioButton/RadioButtonItem.test.tsxUse @jest/globals imports.
src/components/tests/RadioButton/RadioButtonGroup.test.tsxUse @jest/globals imports.
src/components/tests/RadioButton/RadioButton.test.tsxUse @jest/globals imports; adjust mocking to typed requireActual.
src/components/tests/ProgressBar.test.tsxUse @jest/globals imports; convert Props to type-only import.
src/components/tests/Portal.test.tsxUse @jest/globals imports.
src/components/tests/Modal.test.tsxUse @jest/globals imports; convert RN types to type-only imports.
src/components/tests/MenuItem.test.tsxUse @jest/globals imports.
src/components/tests/Menu.test.tsxUse @jest/globals imports; convert Elevation to type-only import.
src/components/tests/ListUtils.test.tsxUse @jest/globals imports.
src/components/tests/ListSection.test.tsxUse @jest/globals imports.
src/components/tests/ListItem.test.tsxUse @jest/globals imports; improve handler typing.
src/components/tests/ListImage.test.tsxUse @jest/globals imports.
src/components/tests/ListAccordion.test.tsxUse @jest/globals imports.
src/components/tests/IconButton.test.tsxUse @jest/globals imports.
src/components/tests/Icon.test.tsxUse @jest/globals imports.
src/components/tests/FABUtils.test.tsxUse @jest/globals imports.
src/components/tests/FABMenu.test.tsxUse @jest/globals imports; improve mock typing.
src/components/tests/FABExtended.test.tsxUse @jest/globals imports.
src/components/tests/FAB.test.tsxUse @jest/globals imports.
src/components/tests/DrawerItem.test.tsxUse @jest/globals imports.
src/components/tests/Drawer/DrawerSection.test.tsxUse @jest/globals imports.
src/components/tests/Drawer/DrawerCollapsedItem.test.tsxUse @jest/globals imports.
src/components/tests/Dialog.test.tsxUse @jest/globals imports; convert RN types to type-only imports.
src/components/tests/DataTable.test.tsxUse @jest/globals imports.
src/components/tests/Chip.test.tsxUse @jest/globals imports.
src/components/tests/Checkbox/utils.test.tsxUse @jest/globals imports.
src/components/tests/Checkbox/CheckboxItem.test.tsxUse @jest/globals imports.
src/components/tests/Checkbox/Checkbox.test.tsxUse @jest/globals imports.
src/components/tests/Card/Card.test.tsxUse @jest/globals imports.
src/components/tests/Button.test.tsxUse @jest/globals imports.
src/components/tests/BottomNavigation.test.tsxUse @jest/globals imports; replace template tables with arrays.
src/components/tests/Banner.test.tsxUse @jest/globals imports.
src/components/tests/Badge.test.tsxUse @jest/globals imports.
src/components/tests/Avatar.test.tsxUse @jest/globals imports.
src/components/tests/Appbar/Appbar.test.tsxUse @jest/globals imports.
src/components/tests/ActivityIndicator.test.tsxUse @jest/globals imports.
example/package.jsonBump monorepo tool deps (react-native-builder-bob, react-native-monorepo-config).
example/metro.config.jsAdd Metro resolver conditions for source-resolution mode.
example/utils/themes.tsConvert Theme imports to type-only.
example/utils/index.tsConvert Theme import to type-only.
example/src/ScreenWrapper.tsxConvert RN types to type-only imports.
example/src/RootNavigator.tsxRemove unused React import (new JSX transform).
example/src/Examples/TouchableRippleExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/ToggleButtonExample.tsxReplace enum with as const object + derived union type.
example/src/Examples/ThemingWithReactNavigation.tsxRemove unused React import (new JSX transform).
example/src/Examples/ThemeExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/TextExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/TeamsList.tsxRemove unused React import (new JSX transform).
example/src/Examples/SurfaceExample.tsxConvert Elevation import to type-only.
example/src/Examples/SegmentedButtonsExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/ProgressBarExample.tsxConvert ProgressBarProps import to type-only.
example/src/Examples/MenuExample.tsxConvert GestureResponderEvent to type-only import.
example/src/Examples/ListSectionExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/ListItemExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/IconExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/IconButtonExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/FABExample.tsxConvert FAB type exports to type-only imports; convert RN event types to type-only.
example/src/Examples/DividerExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/Dialogs/UndismissableDialog.tsxRemove unused React import (new JSX transform).
example/src/Examples/Dialogs/DialogWithLongText.tsxRemove unused React import (new JSX transform).
example/src/Examples/Dialogs/DialogWithLoadingIndicator.tsxRemove unused React import (new JSX transform).
example/src/Examples/Dialogs/DialogWithIcon.tsxRemove unused React import (new JSX transform).
example/src/Examples/Dialogs/DialogWithDismissableBackButton.tsxRemove unused React import (new JSX transform).
example/src/Examples/Dialogs/DialogWithCustomColors.tsxRemove unused React import (new JSX transform).
example/src/Examples/ButtonExample.tsxRemove unused React import (new JSX transform).
example/src/Examples/BottomNavigationExample.tsxConvert BottomNavigationRoute to type-only import.
example/src/Examples/BannerExample.tsxConvert LayoutChangeEvent to type-only import.
example/src/Examples/AvatarExample.tsxRemove unused React import (new JSX transform).
example/src/ExampleList.tsxRemove unused React import (new JSX transform).
example/src/DrawerItems.tsxConvert ColorValue to type-only import.
docs/package.jsonAdd @jest/globals to docs devDependencies.
docs/src/utils/tests/themeColors.test.tsxUse @jest/globals imports.
docs/src/components/ThemeIcon.tsxRemove unused React import (new JSX transform).
docs/src/components/ThemeColorsTable.tsxConvert ReactNode/DataObject to type-only imports.
docs/src/components/Switch.tsxRemove unused React import (new JSX transform).
docs/src/components/Showcase.tsxRemove unused React import (new JSX transform).
docs/src/components/ScreenshotTabs.tsxConvert ReactNode to type-only import.
docs/src/components/PropTable.tsxRemove unused React import (new JSX transform).
docs/src/components/Markdown.tsxRemove unused React import (new JSX transform).
docs/src/components/IconsList.tsxDrop default React import; keep hook import only.
docs/src/components/GooglePlayIcon.tsxRemove unused React import (new JSX transform).
docs/src/components/GithubIcon.tsxRemove unused React import (new JSX transform).
docs/src/components/GetStartedButtons.tsxRemove unused React import (new JSX transform).
docs/src/components/ExtendsLink.tsxRemove unused React import (new JSX transform).
docs/src/components/ExtendedExample.tsxRemove unused React import (new JSX transform).
docs/src/components/DynamicColorTheme.tsxConvert ReactNode to type-only import.
docs/src/components/AppStoreIcon.tsxRemove unused React import (new JSX transform).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/components/TouchableRipple/TouchableRipple.tsx
Comment threadsrc/components/Typography/Text.tsx
Comment threadsrc/components/Surface.tsx
@satya164
satya164 merged commit 63443f4 into mainJun 15, 2026
9 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@satya164