Skip to content

Commit a5e5daf

Browse files
feat: windows support (#1 by @frankcalise and @SeanBarker182)
* fix: git attrs for prettier not to bark on windows about line endings * chore: add react-native-windows dependency * feat(windows): initial template * fix(app): temporarily disable native module font list need to implement it for windows * fix(app): windows fontFamily support * Feature/windows modules (#16) * stub modules * native module linking * import from react native * Stub out keyboard module * remove react native config * gitignore generated file * set up codegen * Comment out tabs for now * Remove &const * Import from react native * Early return in windows until we can figure out the event listener system * Remove &const; * Use useState until we can find a new storage system for windows * Simplify * ignore codegen * include cpp & h files from app * switch to .windows * generate windows files * ignore claude local changes * Add module files * updated lock * document * add back tabs * Dont include macos * Lint fix * add back overrides * implement clipboard functionality * generated * fix time issue * fix imports * updated lock * Add system requirements section to README * lint fix --------- Co-authored-by: Sean Barker <theseanbarker@gmail.com> Co-authored-by: Sean Barker <43788519+SeanBarker182@users.noreply.github.com>
1 parent 3ece1dd commit a5e5daf

File tree

89 files changed

+12093
-6652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+12093
-6652
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ DerivedData
4949
ios/.xcode.env.local
5050

5151
macos/.xcode.env.local
52+
53+
msbuild.binlog
54+
55+
.claude/*

IRNativeModules.podspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Pod::Spec.new do |s|
1717
"macos/build/generated/colocated/**/*.{h,m,mm,c,cpp,swift}"
1818
]
1919

20-
# Exclude problematic files if needed
21-
# s.exclude_files = []
20+
# Exclude Windows-specific sources from macOS build
21+
s.exclude_files = [
22+
"app/**/*.windows.{h,cpp}"
23+
]
2224

2325
s.dependency 'React-Core'
2426
s.dependency 'ReactCodegen'

NuGet.config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" />
6+
<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
7+
</packageSources>
8+
<disabledPackageSources>
9+
<clear />
10+
</disabledPackageSources>
11+
</configuration>

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ And, best of all, Reactotron is completely open source and free to use!
2424

2525
## Getting Started
2626

27-
Currently, you can only run Reactotron macOS by cloning the repo and running it locally.
27+
Currently, you can only run Reactotron by cloning the repo and running it locally.
28+
29+
### macOS Development
2830

2931
```sh
3032
git clone https://github.com/infinitered/reactotron-macos.git
@@ -37,6 +39,36 @@ npm run macos
3739
npm run macos-release
3840
```
3941

42+
### Windows Development
43+
44+
#### System Requirements
45+
46+
First, install the system requirements for React Native Windows: https://microsoft.github.io/react-native-windows/docs/rnw-dependencies
47+
48+
**Alternative**: If you experience issues with the official `rnw-dependencies.ps1` script, consider using Josh Yoes' improved setup process: https://github.com/joshuayoes/ReactNativeWindowsSandbox
49+
50+
#### Running the App
51+
52+
```sh
53+
git clone https://github.com/infinitered/reactotron-macos.git
54+
cd reactotron-macos
55+
npm install
56+
npm run windows-link
57+
npm run start
58+
npm run windows
59+
# for release builds
60+
npm run windows-release
61+
```
62+
63+
### Cross-Platform Native Development
64+
65+
Both platforms use unified commands for native module development:
66+
67+
- **macOS**: `npm run pod` - Links native modules using CocoaPods
68+
- **Windows**: `npm run windows-link` - Links native modules using MSBuild
69+
70+
See [Making a TurboModule](./docs/Making-a-TurboModule.md) for detailed native development instructions.
71+
4072
## Enabling Reactotron in your app
4173

4274
> [!NOTE]

app/components/DetailPanel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TreeView } from "./TreeView"
55
import ActionButton from "./ActionButton"
66
import IRClipboard from "../native/IRClipboard/NativeIRClipboard"
77
import { $flex } from "../theme/basics"
8+
import { formatTime } from "../utils/formatTime"
89

910
type DetailPanelProps = {
1011
selectedItem: TimelineItem | null
@@ -41,7 +42,7 @@ export function DetailPanel({ selectedItem, onClose }: DetailPanelProps) {
4142
</Text>
4243
</View>
4344
<View style={$headerInfo()}>
44-
<Text style={$headerInfoText()}>{new Date(selectedItem.date).toLocaleString()}</Text>
45+
<Text style={$headerInfoText()}>{formatTime(new Date(selectedItem.date))}</Text>
4546
{!!selectedItem.deltaTime && (
4647
<Text style={$headerInfoText()}>+{selectedItem.deltaTime}ms</Text>
4748
)}

app/components/Icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Image, ImageStyle, StyleProp, View, ViewProps, ViewStyle } from "react-native"
22

3-
import { useTheme, useThemeName } from "../theme/theme"
3+
import { useTheme } from "../theme/theme"
44

55
export type IconTypes = keyof typeof iconRegistry
66

app/components/Separator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { themed } from "../theme/theme"
2-
import { View, ViewStyle } from "react-native-macos"
2+
import { View, ViewStyle } from "react-native"
33

44
/**
55
* A simple separator component that is used to separate items in a list.

app/components/Sidebar/AnimatedReactotronLogo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { themed, useThemeName, withTheme } from "../../theme/theme"
2-
import { Animated, ImageStyle, View, ViewStyle } from "react-native-macos"
1+
import { themed, useThemeName } from "../../theme/theme"
2+
import { Animated, ImageStyle, View, ViewStyle } from "react-native"
33

44
type AnimatedReactotronLogoProps = {
55
progress: Animated.Value // 0 = collapsed, 1 = expanded (animated in the sidebar)

app/components/Sidebar/Sidebar.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from "react"
21
import { Animated, View, ViewStyle, StyleSheet } from "react-native"
3-
import { themed, useTheme, useThemeName, withTheme } from "../../theme/theme"
2+
import { themed } from "../../theme/theme"
43
import { AnimatedReactotronLogo } from "./AnimatedReactotronLogo"
54
import { useSidebarAnimationProgress } from "./useSidebarAnimationProgress"
65
import { SidebarMenu } from "./SidebarMenu"
@@ -12,7 +11,6 @@ const EXPANDED_WIDTH = 250
1211
const COLLAPSED_WIDTH = 60
1312

1413
export const Sidebar = () => {
15-
const theme = useTheme()
1614
const { progress, mounted } = useSidebarAnimationProgress()
1715

1816
const animatedWidth = progress.interpolate({
@@ -21,7 +19,7 @@ export const Sidebar = () => {
2119
})
2220

2321
return (
24-
<Animated.View style={{ width: animatedWidth, overflow: "hidden" }}>
22+
<Animated.View style={[{ width: animatedWidth }, $overflowHidden]}>
2523
<View style={$container()}>
2624
<View style={$content()}>
2725
<AnimatedReactotronLogo progress={progress} mounted={mounted} />
@@ -32,6 +30,10 @@ export const Sidebar = () => {
3230
)
3331
}
3432

33+
const $overflowHidden: ViewStyle = {
34+
overflow: "hidden",
35+
}
36+
3537
const $container = themed<ViewStyle>((theme) => ({
3638
flex: 1,
3739
overflow: "hidden",

0 commit comments

Comments
 (0)