Skip to content

Add Support for Windows New Arch #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c70acb7
upgrade version
anupriya13 May 20, 2025
2be3d9b
windows init new arch
anupriya13 May 20, 2025
dc02843
try adding apis
anupriya13 May 20, 2025
b7cf6e3
Update ReactNativeBlobUtil.h
anupriya13 May 20, 2025
b33c001
fix build errors
anupriya13 May 21, 2025
6156dda
add createfile implementation
anupriya13 May 21, 2025
f9af06d
Add some more API implementations
anupriya13 May 21, 2025
11f0627
Add more APIs implementations
anupriya13 May 21, 2025
440f81b
Add more API implementation
anupriya13 May 21, 2025
3869c2c
Try adding examples changes
anupriya13 May 21, 2025
44b85fa
fix metor config and remove picker usage
Yajur-Grover May 22, 2025
13ecbe0
Update App.js
anupriya13 May 22, 2025
60308b9
fix babel
anupriya13 May 22, 2025
7fe8261
remove statusbar and SafeAreaView
anupriya13 May 22, 2025
3b7f53b
add release
anupriya13 May 22, 2025
ba9052d
Merge branch 'master' into user/anuverma/windows
anupriya13 May 22, 2025
4258d69
fix babel
Yajur-Grover May 22, 2025
43941d7
Merge branch 'user/anuverma/windows' of https://github.com/anupriya13…
Yajur-Grover May 22, 2025
cba5661
update createFile
anupriya13 May 23, 2025
049a372
Resolve Comments
anupriya13 May 23, 2025
51f7b24
ignore packages
anupriya13 May 23, 2025
0b63daf
Update .gitignore
anupriya13 May 23, 2025
ab4c74b
Stop tracking windows/packages directory
anupriya13 May 23, 2025
6e8608a
Stop tracking windows/packages directory
anupriya13 May 23, 2025
e63971e
Stop tracking msbuild.binlog
anupriya13 May 23, 2025
47220d0
Update .gitignore
anupriya13 May 23, 2025
91fe7ea
Upgrade versions
anupriya13 May 23, 2025
0a12326
Update package.json
anupriya13 May 23, 2025
0f8571b
use co_await instead of get()
anupriya13 May 24, 2025
6a3b2a9
use co_await instead of completed
anupriya13 May 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ project.xcworkspace
Podfile*
contents.xcworkspacedata

# packages
windows/packages/

# VSCode
#
.vscode
Expand All @@ -52,3 +55,5 @@ buck-out/
android/app/libs
android/keystores/debug.keystore
/ios/ReactNativeBlobUtil.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

**/msbuild.binlog
11 changes: 11 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" />
<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
63 changes: 63 additions & 0 deletions examples/ReactNativeBlobUtil/.gitignore
Copy link
Owner

Choose a reason for hiding this comment

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

Is there any reasons for the duplicates?

Copy link
Owner

Choose a reason for hiding this comment

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

I'll merge it and clean it up :)

Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,66 @@ buck-out/

# CocoaPods
/ios/Pods/

# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# packages
windows/packages/

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
165 changes: 107 additions & 58 deletions examples/ReactNativeBlobUtil/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import React, {useState} from 'react';
import {Alert, Button, SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, TextInput, View} from 'react-native';
import {Picker} from '@react-native-picker/picker';
import {Alert, Button, ScrollView, StyleSheet, Text, TextInput, View} from 'react-native';
// import {Picker} from '@react-native-picker/picker'; Need to remove this package as it is not supported in Windows New Architecture

import {Colors} from 'react-native/Libraries/NewAppScreen';

Expand Down Expand Up @@ -489,8 +489,7 @@ const App: () => React$Node = () => {
// App ************************************************************************
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<View>
<ScrollView contentInsetAdjustmentBehavior="automatic" style={styles.scrollView}>
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
Expand Down Expand Up @@ -604,72 +603,116 @@ const App: () => React$Node = () => {
</View>

<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'Hash - hash()'}</Text>
<View style={styles.sectionDescription}>
<TextInput style={styles.input} placeholder="Source path" onChangeText={(hashPathParam) => setHashPathParam(hashPathParam)} placeholderTextColor="#9a73ef" autoCapitalize="none" />
<Picker hashAlgValue={hashAlgValue} onChangeText={(readPositionParam) => setReadPositionParam(readPositionParam)} style={{height: 50, width: 150}} onValueChange={(itemValue, itemIndex) => setHashAlgValue(itemValue)}>
<Picker.Item label="MD5" value="md5" />
<Picker.Item label="SHA1" value="sha1" />
<Picker.Item label="SHA224" value="sha224" />
<Picker.Item label="SHA256" value="sha256" />
<Picker.Item label="SHA384" value="sha384" />
<Picker.Item label="SHA512" value="sha512" />
</Picker>
</View>
<Button title="Hash File" color="#9a73ef" onPress={hashCall} />
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'Hash - hash()'}</Text>
<View style={styles.sectionDescription}>
<TextInput
style={styles.input}
placeholder="Source path"
onChangeText={setHashPathParam}
placeholderTextColor="#9a73ef"
autoCapitalize="none"
/>
<View style={styles.buttonGroup}>
{['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'].map((alg) => (
<Button
key={alg}
title={alg.toUpperCase()}
color={hashAlgValue === alg ? '#7a42f4' : '#ccc'}
onPress={() => setHashAlgValue(alg)}
/>
))}
</View>
</View>
<Button title="Hash File" color="#9a73ef" onPress={hashCall} />
</View>
</View>

<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'write - writeFile(), appendFile()'}</Text>
<View style={styles.sectionDescription}>
<TextInput style={styles.input} placeholder="Source path" onChangeText={(writeParam) => setWriteParam(writeParam)} placeholderTextColor="#9a73ef" autoCapitalize="none" />
<TextInput style={styles.input} placeholder="Source path" onChangeText={(writeURIParam) => setWriteURIParam(writeURIParam)} placeholderTextColor="#9a73ef" autoCapitalize="none" />
<Picker writeEncodeStreamParam={writeEncodeParam} onChangeText={(readPositionParam) => setReadPositionParam(readPositionParam)} style={{height: 50, width: 150}} onValueChange={(itemValue, itemIndex) => setWriteEncodeParam(itemValue)}>
<Picker.Item label="UTF8" value="utf8" />
<Picker.Item label="Base64" value="base64" />
<Picker.Item label="ASCII" value="ascii" />
<Picker.Item label="URI" value="uri" />
</Picker>
</View>
<Button title="Write" color="#9a73ef" onPress={writeFileCall} />
<Button title="Append" color="#9a73ef" onPress={appendFileCall} />
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'write - writeFile(), appendFile()'}</Text>
<View style={styles.sectionDescription}>
<TextInput
style={styles.input}
placeholder="Source path"
onChangeText={setWriteParam}
placeholderTextColor="#9a73ef"
autoCapitalize="none"
/>
<TextInput
style={styles.input}
placeholder="Destination path"
onChangeText={setWriteURIParam}
placeholderTextColor="#9a73ef"
autoCapitalize="none"
/>
<View style={styles.buttonGroup}>
{['utf8', 'base64', 'ascii', 'uri'].map((enc) => (
<Button
key={enc}
title={enc.toUpperCase()}
color={writeEncodeParam === enc ? '#7a42f4' : '#ccc'}
onPress={() => setWriteEncodeParam(enc)}
/>
))}
</View>
</View>
<Button title="Write" color="#9a73ef" onPress={writeFileCall} />
<Button title="Append" color="#9a73ef" onPress={appendFileCall} />
</View>
</View>

<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'WriteStream - writeStream()'}</Text>
<View style={styles.sectionDescription}>
<TextInput style={styles.input} placeholder="Source path" onChangeText={(writeStreamParam) => setWriteStreamParam(writeStreamParam)} placeholderTextColor="#9a73ef" autoCapitalize="none" />

<Picker writeEncodeStreamParam={writeEncodeStreamParam} onChangeText={(readPositionParam) => setReadPositionParam(readPositionParam)} style={{height: 50, width: 150}} onValueChange={(itemValue, itemIndex) => setWriteStreamEncodeParam(itemValue)}>
<Picker.Item label="UTF8" value="utf8" />
<Picker.Item label="Base64" value="base64" />
<Picker.Item label="ASCII" value="ascii" />
</Picker>
</View>
<Button title="Write" color="#9a73ef" onPress={writeStreamCall} />
<Button title="Append" color="#9a73ef" onPress={appendStreamCall} />
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'WriteStream - writeStream()'}</Text>
<View style={styles.sectionDescription}>
<TextInput
style={styles.input}
placeholder="Source path"
onChangeText={setWriteStreamParam}
placeholderTextColor="#9a73ef"
autoCapitalize="none"
/>
<View style={styles.buttonGroup}>
{['utf8', 'base64', 'ascii'].map((enc) => (
<Button
key={enc}
title={enc.toUpperCase()}
color={writeEncodeStreamParam === enc ? '#7a42f4' : '#ccc'}
onPress={() => setWriteStreamEncodeParam(enc)}
/>
))}
</View>
</View>
<Button title="Write" color="#9a73ef" onPress={writeStreamCall} />
<Button title="Append" color="#9a73ef" onPress={appendStreamCall} />
</View>
</View>

<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'ReadStream - readStream()'}</Text>
<View style={styles.sectionDescription}>
<TextInput style={styles.input} placeholder="Source path" onChangeText={(readStreamParam) => setReadStreamParam(readStreamParam)} placeholderTextColor="#9a73ef" autoCapitalize="none" />

<Picker readEncodeStreamParam={readEncodeStreamParam} onChangeText={(readPositionParam) => setReadPositionParam(readPositionParam)} style={{height: 50, width: 150}} onValueChange={(itemValue, itemIndex) => setReadStreamEncodeParam(itemValue)}>
<Picker.Item label="UTF8" value="utf8" />
<Picker.Item label="Base64" value="base64" />
<Picker.Item label="ASCII" value="ascii" />
</Picker>
</View>
<Button title="Read" color="#9a73ef" onPress={readStreamCall} />
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>{'ReadStream - readStream()'}</Text>
<View style={styles.sectionDescription}>
<TextInput
style={styles.input}
placeholder="Source path"
onChangeText={setReadStreamParam}
placeholderTextColor="#9a73ef"
autoCapitalize="none"
/>
<View style={styles.buttonGroup}>
{['utf8', 'base64', 'ascii'].map((enc) => (
<Button
key={enc}
title={enc.toUpperCase()}
color={readEncodeStreamParam === enc ? '#7a42f4' : '#ccc'}
onPress={() => setReadStreamEncodeParam(enc)}
/>
))}
</View>
</View>
<Button title="Read" color="#9a73ef" onPress={readStreamCall} />
</View>
</View>

<View style={styles.body}>
Expand All @@ -685,7 +728,7 @@ const App: () => React$Node = () => {
</View>
</View>
</ScrollView>
</SafeAreaView>
</View>
</>
);
};
Expand Down Expand Up @@ -727,6 +770,12 @@ const styles = StyleSheet.create({
paddingRight: 12,
textAlign: 'right',
},
buttonGroup: {
flexDirection: 'row',
flexWrap: 'wrap',
gap: 8,
marginVertical: 8,
},
});

export default App;
10 changes: 10 additions & 0 deletions examples/ReactNativeBlobUtil/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
2 changes: 1 addition & 1 deletion examples/ReactNativeBlobUtil/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
};
3 changes: 3 additions & 0 deletions examples/ReactNativeBlobUtil/jest.config.windows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const config = {};

module.exports = require('@rnx-kit/jest-preset')('windows', config);
Loading