Skip to content
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

Feat/update rn 0.76.5 #1838

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Feat/update rn 0.76.5 #1838

wants to merge 30 commits into from

Conversation

ElenaDiachenko
Copy link
Contributor

@ElenaDiachenko ElenaDiachenko commented Jan 7, 2025

Description

  • Small description

System:
  OS: macOS 15.2
  CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Memory: 3.71 GB / 32.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 22.0.0 - ~/.asdf/installs/nodejs/22.0.0/bin/node.      <====== REQUESTED "20 || >=22"
  Yarn: 1.22.22 - ~/.asdf/installs/nodejs/22.0.0/bin/yarn
  npm: 10.5.1 - ~/.asdf/installs/nodejs/22.0.0/bin/npm
  Watchman: 2024.12.02.00 - /usr/local/bin/watchman
Managers:
  CocoaPods: 1.15.2 - ../../.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.11005911
  Xcode: 16.1/16B40 - /usr/bin/xcodebuild
Languages:
  Java: 17.0.10 - /usr/bin/javac
  Ruby: 3.1.1 - ../../.asdf/shims/ruby
npmGlobalPackages:
  lerna: 6.6.2
  rnv: 1.9.0-rc.0
CLI:
  TIZEN CLI: 2.5.25 - ../../tizen-studio/tools/ide/bin/tizen

Platforms that works:

  • ios
  • android
  • androidtv
  • firetv
  • androidwear
  • web
  • tizen
  • tvos
  • webos
  • macos
  • tizenwatch
  • kaios
  • chromecast
  • linux
  • windows

Related issues

Npm releases

n/a

Comment on lines +60 to +62
`node ${doResolve(c.runtime.runtimeExtraProps?.reactNativePackageName || 'react-native')}/cli.js ${args.join(
' '
)} --config=${c.runtime.runtimeExtraProps?.reactNativeMetroConfigName || 'metro.config.js'}`,

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This string concatenation which depends on
library input
is later used in a
shell command
.

Copilot Autofix AI 5 days ago

To fix the problem, we should avoid constructing the shell command as a single string and instead use child_process.spawn or child_process.execFile to pass the command and its arguments as an array. This approach ensures that each argument is treated as a separate entity, preventing shell interpretation of special characters.

  1. Replace the string concatenation with an array of arguments.
  2. Use child_process.spawn to execute the command with the arguments array.
Suggested changeset 1
packages/sdk-react-native/src/iosRunner.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/sdk-react-native/src/iosRunner.ts b/packages/sdk-react-native/src/iosRunner.ts
--- a/packages/sdk-react-native/src/iosRunner.ts
+++ b/packages/sdk-react-native/src/iosRunner.ts
@@ -58,6 +58,11 @@
     }
+    const command = 'node';
+    const commandArgs = [
+        `${doResolve(c.runtime.runtimeExtraProps?.reactNativePackageName || 'react-native')}/cli.js`,
+        ...args,
+        `--config=${c.runtime.runtimeExtraProps?.reactNativeMetroConfigName || 'metro.config.js'}`,
+    ];
     return executeAsync(
-        `node ${doResolve(c.runtime.runtimeExtraProps?.reactNativePackageName || 'react-native')}/cli.js ${args.join(
-            ' '
-        )} --config=${c.runtime.runtimeExtraProps?.reactNativeMetroConfigName || 'metro.config.js'}`,
+        command,
+        commandArgs,
         {
EOF
@@ -58,6 +58,11 @@
}
const command = 'node';
const commandArgs = [
`${doResolve(c.runtime.runtimeExtraProps?.reactNativePackageName || 'react-native')}/cli.js`,
...args,
`--config=${c.runtime.runtimeExtraProps?.reactNativeMetroConfigName || 'metro.config.js'}`,
];
return executeAsync(
`node ${doResolve(c.runtime.runtimeExtraProps?.reactNativePackageName || 'react-native')}/cli.js ${args.join(
' '
)} --config=${c.runtime.runtimeExtraProps?.reactNativeMetroConfigName || 'metro.config.js'}`,
command,
commandArgs,
{
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@locksten locksten self-requested a review January 8, 2025 08:04
@ElenaDiachenko ElenaDiachenko changed the base branch from main to feat/update_RN_0.76.3 January 8, 2025 09:58
@ElenaDiachenko ElenaDiachenko changed the base branch from feat/update_RN_0.76.3 to main January 8, 2025 10:18
@ElenaDiachenko ElenaDiachenko added this to the 1.10 milestone Jan 10, 2025
@ElenaDiachenko ElenaDiachenko self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants