Skip to content

refactor: inline Platform.OS checks - #5087

Merged
satya164 merged 2 commits into
callstack:mainfrom
michalfedyna:chore/inline-platform
Sep 4, 2026
Merged

refactor: inline Platform.OS checks#5087
satya164 merged 2 commits into
callstack:mainfrom
michalfedyna:chore/inline-platform

Conversation

@michalfedyna

Copy link
Copy Markdown
Contributor

Motivation

Inline Platform.OS code so minifier can remove dead code.

Related issue

Inline Platform.OS code so minifier can remove dead code.

Test plan

Look if replacement was done correctly.

@JKobrynski

Copy link
Copy Markdown
Collaborator

#5078 landed since you opened this and deleted most of what it touches - the isWeb branches in Button and Chip are gone, and Menu on main already inlines the check. That leaves ProgressBar, Tooltip and the example files. Worth rebasing and narrowing it to those? A sweep like this goes stale fast, so better to land it small and soon. @michalfedyna

@michalfedyna michalfedyna changed the title Inline Platform.OS checks refactor: inline Platform.OS checks Sep 3, 2026

@satya164 satya164 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@satya164
satya164 merged commit 6fa2a56 into callstack:main Sep 4, 2026
7 checks passed
MikitasK added a commit to burczu/react-native-paper that referenced this pull request Sep 5, 2026
…into feat/tooltip-md3-modernization

Conflicts resolved:
- Tooltip.tsx: kept the rewritten trigger and singleton-slot show/hide;
  upstream had only inlined the `isWeb` check, which the merge already
  picked up.
- migration.md: kept both the upstream v6 sections and the Tooltip one.
- jest/testSetup.js: took upstream's setup. It stops mocking
  react-native-reanimated altogether, so the local `cubicBezier` stub the
  branch added to the mock is no longer needed.
- FAB/Extended.tsx: took upstream's `Platform` value import, kept `View`
  as a type-only import (it is only used for the ref type).
- FAB/Shell.tsx: kept both sides of the reanimated import.
- FABExtended.test.tsx: unioned both import lists.

Adapted to upstream:
- `../../types` is gone (callstack#5098/callstack#5087); Tooltip/hooks.ts and
  RichTooltip.tsx now import from `theme/types`.
- Surface's `style` no longer configures background or radius (callstack#5078);
  the rich tooltip passes `backgroundColor` and `borderRadius` as props.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants