Skip to content
Merged

ts split #29211

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
54847fa
build: add tsconfig.base.json
chrisnojima May 14, 2026
55b2cd8
build: add gen-ts-paths.mjs to generate per-platform tsconfig paths
chrisnojima May 14, 2026
19a2a47
build: remove unused imports and dead stripExt function from gen-ts-p…
chrisnojima May 14, 2026
89cbdb5
build: add generated tsconfig paths files
chrisnojima May 14, 2026
b77c97d
build: add tsconfig.desktop.json
chrisnojima May 14, 2026
8d220ad
build: add tsconfig.native.json (errors to fix in subsequent tasks)
chrisnojima May 15, 2026
f45937b
build: delete .d.ts stubs replaced by generated tsconfig paths
chrisnojima May 15, 2026
d87952b
fix: restore deleted .d.ts stubs and fix generator to skip .d.ts-cove…
chrisnojima May 15, 2026
d11c2e1
fix: resolve type errors surfaced by per-platform tsconfig split
chrisnojima May 15, 2026
931ce85
build: tsconfig.json is editor fallback (extends tsconfig.desktop.json)
chrisnojima May 15, 2026
04920ae
build: yarn tsc generates paths and checks desktop + native configs
chrisnojima May 15, 2026
88296af
build: replace global casts with globals.native.d.ts declarations
chrisnojima May 15, 2026
cac9d9e
WIP
chrisnojima May 15, 2026
e2cbae9
build: restore use-resize-observer.d.ts to base version
chrisnojima May 15, 2026
18ddd2b
replace common-adapters index.d.ts stub with proper platform barrel f…
chrisnojima May 15, 2026
ef27798
split tsconfig into per-platform configs, inline types from deleted .…
chrisnojima May 15, 2026
d5ae1fb
WIP
chrisnojima May 16, 2026
4a85a74
WIP
chrisnojima May 16, 2026
4f8268e
WIP
chrisnojima May 16, 2026
00bd415
WIP
chrisnojima May 16, 2026
46b49d6
WIP
chrisnojima May 16, 2026
523ed54
WIP
chrisnojima May 16, 2026
07d085b
WIP
chrisnojima May 16, 2026
72b24e9
WIP
chrisnojima May 16, 2026
903eb12
WIP
chrisnojima May 17, 2026
85ac902
WIP
chrisnojima May 17, 2026
3b46301
WIP
chrisnojima May 17, 2026
f0d1fc8
delete orphaned icon.constants-gen.shared-2.tsx
chrisnojima May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion plans/todo.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
look for opportunities to use gap in all boxes
look for platform splits that can go away
jump in inbox below tab
go screen by screen and find cleanup
any leftover zustand store
ios push to convo broken
ts split maybe
Expand Down
1 change: 1 addition & 0 deletions shared/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ main.jsbundle
coverage-ts
temp.log
.watchman-cookie-*
.tsOuts/
2 changes: 1 addition & 1 deletion shared/chat/audio/audio-video.desktop.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import type {Props} from './audio-video'
import type {Props} from './audio-video.shared'

const AudioVideo = (props: Props) => {
const {url, paused, onPositionUpdated, onEnded} = props
Expand Down
2 changes: 1 addition & 1 deletion shared/chat/audio/audio-video.native.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import {useAudioPlayer} from 'expo-audio'
import {useEventListener} from 'expo'
import type {Props} from './audio-video'
import type {Props} from './audio-video.shared'

const AudioVideo = (props: Props) => {
const {url, paused, onPositionUpdated, onEnded} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import type * as React from 'react'

export type Props = {
url: string
paused: boolean
onPositionUpdated: (ratio: number) => void
onEnded: () => void
}

declare const AudioVideo: (p: Props) => React.ReactNode
export default AudioVideo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import * as Kb from '@/common-adapters'
import {useMessagePopup} from '../messages/message-popup'
import type {Props} from '.'
import type {Props} from './index.shared'
import {useData, usePreviewFallback} from './hooks'
import type {StyleOverride} from '@/common-adapters/markdown'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {useMessagePopup} from '../messages/message-popup'
import {useVideoPlayer, VideoView} from 'expo-video'
import logger from '@/logger'
import {ShowToastAfterSaving} from '../messages/attachment/shared'
import type {Props} from '.'
import type {Props} from './index.shared'
import {useData, usePreviewFallback} from './hooks'
import {type GestureResponderEvent, Animated, View} from 'react-native'
import {useSafeAreaFrame} from 'react-native-safe-area-context'
Expand Down
3 changes: 0 additions & 3 deletions shared/chat/conversation/giphy/index.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions shared/chat/conversation/header-area/index.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion shared/chat/conversation/header-area/index.desktop.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const headerNavigationOptions = (/*route*/) => ({})
export const headerNavigationOptions = (_route: unknown) => ({})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Kb from '@/common-adapters'
import type {Props} from '.'
import type {Props} from './index.shared'

const Prompt = () => (
<Kb.Box2 direction="horizontal" fullWidth={true} gap="xtiny" style={styles.promptContainer} justifyContent="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ export type Props = {
onHidden: () => void
onSelect: (mediaType: 'photo' | 'video' | 'mixed' | 'file', location: 'camera' | 'library' | 'file') => void
}

export declare const FilePickerPopup: (p: Props) => React.ReactNode
export default FilePickerPopup
3 changes: 0 additions & 3 deletions shared/chat/conversation/input-area/location-popup.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion shared/chat/conversation/input-area/normal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {indefiniteArticle} from '@/util/string'
import {infoPanelWidthTablet} from '../../info-panel/common'
import {assertionToDisplay} from '@/common-adapters/usernames'
import {FocusContext, ScrollContext} from '@/chat/conversation/normal/context'
import type {RefType as InputRef} from './input'
import type {RefType as InputRef} from './input.shared'
import {useConversationCenter} from '../../center-context'
import {
useConversationThreadID,
Expand Down
5 changes: 3 additions & 2 deletions shared/chat/conversation/input-area/normal/input.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import * as React from 'react'
import * as InputState from '../input-state'
import SetExplodingMessagePopup from './set-explode-popup'
import Typing from './typing'
import type {Props as InputLowLevelProps, TextInfo, RefType} from './input'
import type {PlatformInputProps as Props} from './input'
import type {Props as InputLowLevelProps, TextInfo, RefType} from './input.shared'
import type {PlatformInputProps as Props} from './input.shared'
export type {Selection, RefType, TextInfo, PlatformInputProps} from './input.shared'
import {EmojiPickerDesktop} from '@/chat/emoji-picker/container'
import {KeyEventHandler} from '@/common-adapters/key-event-handler.desktop'
import {formatDurationShort} from '@/util/timestamp'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Typing from './typing'
import logger from '@/logger'
import type * as ImagePicker from 'expo-image-picker'
import type {LayoutEvent} from '@/common-adapters/box'
import type {Props as InputLowLevelProps, PlatformInputProps as Props, TextInfo, RefType} from './input'
import type {Props as InputLowLevelProps, PlatformInputProps as Props, TextInfo, RefType} from './input.shared'
import {AudioSendWrapper} from '@/chat/audio/audio-send.native'
import {Keyboard, TextInput, type NativeSyntheticEvent, type TextInputSelectionChangeEventData, useColorScheme} from 'react-native'
import {MaxInputAreaContext} from './max-input-area-context'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import type * as Styles from '@/styles'
import type {TextType} from '@/common-adapters/text.shared'
import type {TextInputProps} from 'react-native'

export type Selection = {
start: number
end?: number
}

export type RefType = {
blur: () => void
clear: () => void
Expand All @@ -26,14 +31,11 @@ export type RefType = {
}
}

export type Selection = {
start: number
end?: number
}
export type TextInfo = {
text: string
selection?: Selection
}

export type Props = {
allowKeyboardEvents?: boolean
disabled?: boolean
Expand All @@ -52,11 +54,11 @@ export type Props = {
textType?: TextType
style?: Styles.StylesCrossPlatform
onChangeText?: (value: string) => void
onPasteImage?: (uris: Array<string>) => void // mobile only
onPasteImage?: (uris: Array<string>) => void
multiline?: boolean
rowsMin?: number
rowsMax?: number
padding?: keyof typeof Styles.globalMargins | 0 // globalMargins does not have an option for 0
padding?: keyof typeof Styles.globalMargins | 0
}

export type PlatformInputProps = {
Expand All @@ -74,6 +76,3 @@ export type PlatformInputProps = {
showReplyPreview: boolean
suggestionOverlayStyle: Styles.StylesCrossPlatform
}

declare const PlatformInput: (p: PlatformInputProps) => React.ReactNode
export default PlatformInput
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Chat from '@/constants/chat'
import type * as T from '@/constants/types'
import type {Props} from '.'
import type {Props} from './index.shared'
import {useConversationThreadSelector} from '../../../thread-context'

export type MessageExplodeDescription = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Kb from '@/common-adapters'
import type {Props} from '.'
import type {Props} from './index.shared'
import useHooks from './hooks'
import type {MessageExplodeDescription} from './hooks'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Kb from '@/common-adapters'
import type {Props} from '.'
import type {Props} from './index.shared'
import useHooks from './hooks'

const Prompt = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as Common from './common'
import * as Kb from '@/common-adapters'
import {useEngineActionListener} from '@/engine/action-listener'
import {useConfigState} from '@/stores/config'
import type {Selection as InputSelection} from '../normal/input'
import type {Selection as InputSelection} from '../normal/input.shared'
import {useConversationMeta} from '../../data-hooks'

const getCommandPrefix = (command: T.RPCChat.ConversationCommand) => {
Expand Down
4 changes: 2 additions & 2 deletions shared/chat/conversation/input-area/suggestors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from 'react'
import * as Users from './users'
import * as InputState from '../input-state'
import type * as Common from './common'
import type {PlatformInputProps as Props, RefType as InputRef} from '../normal/input'
import type {PlatformInputProps as Props, RefType as InputRef} from '../normal/input.shared'
import {useConversationThreadID} from '../../thread-context'

const positionFallbacks = ['bottom center'] as const
Expand Down Expand Up @@ -128,7 +128,7 @@ const useSyncInput = (p: UseSyncInputProps) => {
return null
}

const triggerIDRef = React.useRef<number>(undefined)
const triggerIDRef = React.useRef<ReturnType<typeof setTimeout>>(undefined)
const checkTrigger = () => {
if (triggerIDRef.current) {
clearTimeout(triggerIDRef.current)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import * as Kb from '@/common-adapters'
import * as T from '@/constants/types'
import type {Props} from './suggestion-list'
import type {Props} from './suggestion-list.shared'
import {BotCommandUpdateStatus} from './shared'
import type {LegendListRef} from '@/common-adapters'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Kb from '@/common-adapters'
import * as T from '@/constants/types'
import noop from 'lodash/noop'
import type {Props} from './suggestion-list'
import type {Props} from './suggestion-list.shared'
import {BotCommandUpdateStatus} from './shared'
import {FlatList} from 'react-native'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ import type * as Styles from '@/styles'
import type * as T from '@/constants/types'

export type Props<I> = {
// TODO fix this type
items: Array<I>
keyExtractor?: (item: I, idx: number) => string
renderItem: (index: number, item: I) => React.ReactElement
selectedIndex: number
style?: Styles.StylesCrossPlatform
// likely doesn't belong here
suggestBotCommandsUpdateStatus?: T.RPCChat.UIBotCommandsUpdateStatusTyp
}

declare function SuggestionList<I>(p: Props<I>): React.ReactNode
export default SuggestionList
6 changes: 0 additions & 6 deletions shared/chat/conversation/list-area/index.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion shared/chat/conversation/list-area/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as React from 'react'
import Separator from '../messages/separator'
import SpecialBottomMessage from '../messages/special-bottom-message'
import SpecialTopMessage from '../messages/special-top-message'
import type {ItemType} from '.'
import type {ItemType} from './index.shared'
import {FlatList} from 'react-native'
// import {FlashList, type ListRenderItemInfo} from '@shopify/flash-list'
import {MessageRow} from '../messages/wrapper'
Expand Down
3 changes: 3 additions & 0 deletions shared/chat/conversation/list-area/index.shared.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type * as T from '@/constants/types'

export type ItemType = T.Chat.Ordinal

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Kb from '@/common-adapters'
import * as React from 'react'
import type {Props} from './videoimpl'
import type {Props} from './videoimpl.shared'
import {getAttachmentPreviewSize, maxWidth, maxHeight} from '../shared'

// its important we use explicit height/width so we never CLS while loading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ShowToastAfterSaving} from '../shared'
import {useVideoPlayer, VideoView} from 'expo-video'
import {useEventListener} from 'expo'
import {Pressable} from 'react-native'
import type {Props} from './videoimpl'
import type {Props} from './videoimpl.shared'
import {getAttachmentPreviewSize} from '../shared'

const VideoImpl = (p: Props) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import type * as React from 'react'
import type * as T from '@/constants/types'

export type Props = {
openFullscreen?: () => void
showPopup?: () => void
allowPlay: boolean
message: T.Chat.MessageAttachment
}
declare const VideoImpl: (p: Props) => React.ReactNode
export default VideoImpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import * as Kb from '@/common-adapters/index'
import type {Props} from './video'
import type {Props} from './video.shared'

export const Video = (p: Props) => {
const {autoPlay, onClick, height, width, style, url} = p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react'
import * as Kb from '@/common-adapters/index'
import logger from '@/logger'
import {useVideoPlayer, VideoView} from 'expo-video'
import type {Props} from './video'
import type {Props} from './video.shared'

export const Video = (props: Props) => {
const {autoPlay, onClick, url, style, width, height} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type * as React from 'react'
export type Props = {
autoPlay: boolean
height: number
Expand All @@ -7,4 +6,3 @@ export type Props = {
url: string
width: number
}
export declare const Video: (p: Props) => React.ReactNode
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import * as Kb from '@/common-adapters'
import type {Props} from '.'
import type {Props} from './index.shared'
import {useColorScheme} from 'react-native'

export const animationDuration = 2000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as C from '@/constants'
import {Animated as NativeAnimated, Easing as NativeEasing} from 'react-native'
// ios must animated plain colors not the dynamic ones
import colors, {darkColors} from '@/styles/colors'
import type {Props} from '.'
import type {Props} from './index.shared'
import {useColorScheme} from 'react-native'

// If this image changes, some hard coded dimensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as React from 'react'
import * as Kb from '@/common-adapters'
import type {Props} from '.'
import type {Props} from './index.shared'

function LongPressable(props: Props & {ref?: React.Ref<Kb.MeasureRef>}) {
return <Kb.Box2 direction="horizontal" fullWidth={true} {...props} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Kb from '@/common-adapters'
import * as React from 'react'
import * as InputState from '../../../input-area/input-state'
import type {Props} from '.'
import type {Props} from './index.shared'
import {useOrdinal} from '../../ids-context'
import {useConversationThreadToggleSearch} from '../../../thread-context'
import Swipeable, {type SwipeableMethods} from '@/common-adapters/swipeable-row.native'
Expand Down
4 changes: 0 additions & 4 deletions shared/chat/conversation/rekey/participant-rekey.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions shared/chat/conversation/rekey/you-rekey.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion shared/chat/conversation/rekey/you-rekey.desktop.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Kb from '@/common-adapters'
import type {Props} from './you-rekey'
import type {Props} from './you-rekey.shared'

const YouRekey = ({onRekey}: Props) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion shared/chat/conversation/rekey/you-rekey.native.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Kb from '@/common-adapters'
import type {Props} from './you-rekey'
import type {Props} from './you-rekey.shared'

const YouRekey = ({onEnterPaperkey}: Props) => (
<Kb.Box2 direction="vertical">
Expand Down
Loading