Skip to content

Commit

Permalink
feat: add Windows New Arch Support (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yajur-Grover authored Jan 8, 2025
1 parent fbbae4c commit b18b626
Show file tree
Hide file tree
Showing 23 changed files with 1,954 additions and 1,535 deletions.
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>
79 changes: 40 additions & 39 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
{
"name": "Example",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
"ios": "react-native run-ios",
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-clipboard/clipboard": "1.15.0",
"react": "18.3.1",
"react-native": "0.76.3"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.3",
"@react-native/metro-config": "0.76.3",
"@react-native/typescript-config": "0.76.3",
"@rnx-kit/metro-config": "^2.0.0",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"jest": "^29.6.3",
"react-native-test-app": "^4.0.4",
"react-test-renderer": "18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
"name": "Example",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist/res",
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
"ios": "react-native run-ios",
"mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-clipboard/clipboard": "1.15.0",
"react": "18.3.1",
"react-native": "^0.75.3",
"react-native-windows": "^0.75.0"

This comment has been minimized.

Copy link
@Bardiamist

Bardiamist Jan 14, 2025

@Yajur-Grover It leads to problems when I use react-native 0.76.6

This comment has been minimized.

Copy link
@Bardiamist

Bardiamist Jan 14, 2025

I don't need react-native-windows in the project. In result my @react-native/gradle-plugin was 0.753 when it should be 0.76.6 so build was failed.

Looks react-native-windows should be in peerDependencies only.

This comment has been minimized.

Copy link
@Yajur-Grover

Yajur-Grover Jan 14, 2025

Author Contributor

This PR may resolve the issue you're facing: #279. Can you try again on latest main?

This comment has been minimized.

Copy link
@Bardiamist

Bardiamist Jan 15, 2025

@react-native-clipboard/[email protected] dependencies were installed correctly

},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "^15.0.1",
"@react-native-community/cli-platform-android": "^15.0.1",
"@react-native-community/cli-platform-ios": "^15.0.1",
"@react-native/babel-preset": "^0.75.3",
"@react-native/metro-config": "^0.75.3",
"@react-native/typescript-config": "^0.75.3",
"@rnx-kit/metro-config": "^2.0.0",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"jest": "^29.6.3",
"react-native-test-app": "^4.0.5",
"react-test-renderer": "^18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
38 changes: 23 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
"name": "@react-native-clipboard/clipboard",
"version": "1.15.0",
"description": "React Native Clipboard API for macOS, iOS, Android, and Windows",
"keywords": [
"Clipboard",
"getString",
"react-native",
"setString"
],
"keywords": ["Clipboard", "getString", "react-native", "setString"],
"homepage": "https://github.com/react-native-clipboard/clipboard#readme",
"bugs": {
"url": "https://github.com/react-native-clipboard/clipboard/issues"
Expand Down Expand Up @@ -36,6 +31,7 @@
"android": "react-native run-android --root example",
"windows": "cd example && react-native run-windows",
"start:windows": "install-windows-test-app -p example/windows && react-native run-windows --root example --logging",
"start:windows:fabric": "install-windows-test-app -p example/windows --use-fabric && react-native run-windows --root example --logging",
"start": "react-native start",
"build": "tsc",
"format": "biome format --write .",
Expand All @@ -47,23 +43,25 @@
"jest": {
"preset": "react-native"
},
"dependencies": {
"react-native": "^0.75.3",
"react-native-windows": "^0.75.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@biomejs/biome": "1.9.4",
"@callstack/react-native-visionos": "^0.76.0",
"@react-native/babel-preset": "^0.76.0",
"@react-native/metro-config": "^0.76.0",
"@react-native/babel-preset": "^0.75.0",
"@react-native/metro-config": "^0.75.0",
"@rnx-kit/align-deps": "^2.4.1",
"@rnx-kit/metro-config": "^2.0.0",
"@types/react": "^18.2.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"babel-jest": "^26.1.0",
"jest": "^29.2.1",
"react": "18.2.0",
"react-native": "^0.76.0",
"react": "^18.3.1",
"react-native-macos": "0.76.0",
"react-native-test-app": "^4.0.1",
"react-native-windows": "^0.76.0",
"react-native-test-app": "^4.0.5",
"react-test-renderer": "^18.2.0",
"typescript": "^4.4.3"
},
Expand All @@ -90,10 +88,20 @@
"jsSrcsDir": "./src",
"android": {
"javaPackageName": "com.reactnativecommunity.clipboard"
},
"windows": {
"namespace": "ClipboardCodegen",
"outputDirectory": "windows/Clipboard/codegen",
"separateDataTypes": true
}
},
"packageManager": "[email protected]",
"workspaces": [
"example"
]
"workspaces": ["example"],
"react-native-windows": {
"init-windows": {
"name": "Clipboard",
"namespace": "Clipboard",
"template": "cpp-lib"
}
}
}
2 changes: 1 addition & 1 deletion react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
platforms: {
windows: {
sourceDir: "windows",
solutionFile: "windows.sln",
solutionFile: "Clipboard.sln",
projects: [
{
projectFile: "Clipboard/Clipboard.vcxproj",
Expand Down
Loading

0 comments on commit b18b626

Please sign in to comment.