Skip to content

Conversation

@islameldesoky95
Copy link
Collaborator

@islameldesoky95 islameldesoky95 commented Dec 4, 2025

User description

PR Type

Enhancement


Description

  • Move @babel/runtime from devDependencies to dependencies

  • Ensures babel runtime is available in production environments


Diagram Walkthrough

flowchart LR
  devDeps["devDependencies"] -- "move @babel/runtime" --> prodDeps["dependencies"]
Loading

File Walkthrough

Relevant files
Dependencies
package.json
Move @babel/runtime to production dependencies                     

package.json

  • Removed @babel/runtime from devDependencies section
  • Added @babel/runtime to dependencies section
  • Ensures babel runtime is available as a production dependency
+1/-1     


CodeAnt-AI Description

Include @babel/runtime in production dependencies

What Changed

  • Moved @babel/runtime from devDependencies to dependencies so it is installed in production environments
  • Prevents consumer apps from failing at runtime due to missing Babel helper functions (fewer crashes on app start)

Impact

✅ No missing Babel helpers in production
✅ Fewer production app crashes on startup
✅ Production installs include required runtime

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Chores
    • Cleaned up project dependency manifest: removed multiple packages and cleared the dependency list, and removed a development runtime entry from dev configuration.
    • This simplifies dependency declarations and may change how runtime packages are provided in production; verify environment setup after updating.

✏️ Tip: You can customize this high-level summary in your review settings.

@codeant-ai
Copy link

codeant-ai bot commented Dec 4, 2025

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Walkthrough

package.json had several dependency entries removed: @babel/runtime was removed from devDependencies, and dependencies was replaced with an empty object, removing hermes-engine, install, npm, react-native-safe-area-context, react-native-screens, and react-native-webview.

Changes

Cohort / File(s) Change Summary
Package manifest edits
package.json
Removed @babel/runtime from devDependencies; replaced dependencies content with an empty object, removing hermes-engine, install, npm, react-native-safe-area-context, react-native-screens, and react-native-webview.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Areas to spot-check:
    • package.json — ensure no unintended syntax changes (commas, braces).
    • Build scripts / CI — confirm no references to removed packages remain.

Poem

🐇 I nibble lines in package.json bright,
Tilts of dependencies drift out of sight.
A rabbit hops past dev and prod's door,
Whispering, "Less is more, and less is more." ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title claims to add @babel/runtime to dependencies, but the actual changes removed it from devDependencies and emptied all dependencies, contradicting the stated objective. Correct the title to reflect the actual changes made to the repository, such as 'Remove babel runtime and all dependencies from package.json' or align the changes with the intended objective of adding @babel/runtime to dependencies.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hotfix/add-babel-runtime

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c122a26 and 7251fd1.

📒 Files selected for processing (1)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-ios
  • GitHub Check: test-android
🔇 Additional comments (1)
package.json (1)

94-94: The PR objective is to remove all dependencies from the main package.json as they are only needed in the sample apps. The empty "dependencies": {} at line 94 is the correct and intended outcome. The sample and example apps maintain their own dependency declarations, confirming this refactoring is properly structured.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link

qodo-code-review bot commented Dec 4, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
No relevant code: The PR only updates dependencies and does not add or modify application logic related to
auditing, so compliance cannot be assessed from the diff.

Referred Code
"dependencies": {
  "@babel/runtime": "^7.25.3",
  "hermes-engine": "^0.11.0",
  "install": "^0.13.0",
  "npm": "^11.6.0",
  "react-native-safe-area-context": "^5.6.1",

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status:
No identifiers changed: The diff only moves a dependency in package.json and introduces no new identifiers or code
to evaluate naming conventions.

Referred Code
"dependencies": {
  "@babel/runtime": "^7.25.3",
  "hermes-engine": "^0.11.0",

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
No error paths: No new executable code or error handling was added in this PR; only dependency placement
changed, so robustness cannot be evaluated from the diff.

Referred Code
"dependencies": {
  "@babel/runtime": "^7.25.3",
  "hermes-engine": "^0.11.0",
  "install": "^0.13.0",
  "npm": "^11.6.0",
  "react-native-safe-area-context": "^5.6.1",

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status:
No user errors: The PR does not introduce user-facing error handling; moving @babel/runtime to
dependencies has no direct impact visible in this diff.

Referred Code
"dependencies": {
  "@babel/runtime": "^7.25.3",
  "hermes-engine": "^0.11.0",

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status:
No logging code: No logging statements were added or changed; only dependency configuration was updated, so
logging compliance cannot be determined from this diff.

Referred Code
"dependencies": {
  "@babel/runtime": "^7.25.3",
  "hermes-engine": "^0.11.0",
  "install": "^0.13.0",
  "npm": "^11.6.0",
  "react-native-safe-area-context": "^5.6.1",

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
No input handling: The change only moves @babel/runtime to production dependencies and does not include input
handling code to assess security practices.

Referred Code
"dependencies": {
  "@babel/runtime": "^7.25.3",
  "hermes-engine": "^0.11.0",

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@pantoaibot
Copy link

pantoaibot bot commented Dec 4, 2025

PR Summary:

Add @babel/runtime to runtime dependencies so consumers get the Babel helpers at install.

  • package.json: removed "@babel/runtime": "^7.25.3" from devDependencies and added it to dependencies with the same version.
  • Purpose: ensures Babel runtime helpers are available in production/consumer installs (prevents missing helper errors when compiled code requires @babel/runtime).
  • Impact: no API changes; increases installed footprint for consumers and may affect deduplication, but resolves runtime errors. Requires republishing the package.

Reviewed by Panto AI

@qodo-code-review
Copy link

qodo-code-review bot commented Dec 4, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Align babel runtime and core versions

Align the version of @babel/runtime with @babel/core by updating it from ^7.25.3
to ^7.25.10 to ensure compatibility and prevent potential runtime errors.

package.json [95]

-"@babel/runtime": "^7.25.3",
+"@babel/runtime": "^7.25.10",
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a version mismatch between @babel/core and @babel/runtime, and aligning them is a best practice to prevent potential runtime issues.

Medium
  • Update

@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Dec 4, 2025
@codeant-ai
Copy link

codeant-ai bot commented Dec 4, 2025

CodeAnt AI finished reviewing your PR.

package.json Outdated
"url": "https://github.com/Usercentrics/react-native-sdk/issues"
},
"dependencies": {
"@babel/runtime": "^7.25.3",
Copy link

Choose a reason for hiding this comment

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

[REFACTORING] You moved @babel/runtime from devDependencies into dependencies (line 95). This is often the right approach for libraries that import helpers from '@babel/runtime' at runtime, but please verify that your published build actually requires the runtime (i.e. compiled output imports '@babel/runtime'). If you intend to ship helpers in the compiled output instead, consider configuring Babel to inline helpers (avoid @babel/runtime) or explicitly add @babel/plugin-transform-runtime and keep @babel/runtime as a dependency. Actionable steps: (1) Inspect compiled files in lib/ to confirm imports to '@babel/runtime'. (2) If present and desired, keep this change; otherwise adjust Babel configuration to avoid runtime imports.

@pantoaibot
Copy link

pantoaibot bot commented Dec 4, 2025

Reviewed up to commit:c122a26a34f775132c9fad477f8cf8a33e9d4f50

Additional Suggestion
Others - Security/compatibility: after introducing @babel/runtime as a runtime dependency, run 'yarn/npm audit' and Upgrade to the latest patch/minor release for @babel/runtime if vulnerabilities are reported. Also run the full test suite and smoke tests on Android/iOS (Hermes) to ensure the runtime change doesn't break consumers. - Version alignment: other package.json files in the repo (example/sample) reference different @babel/runtime versions. This can cause multiple copies of @babel/runtime to be installed across workspaces/consumers and increase bundle size or cause inconsistent behavior. Recommended actions: (1) Bump @babel/runtime to a consistent, up-to-date patch version across all package.json files. (2) Add a resolutions entry (or use your monorepo package manager equivalent) to force a single @babel/runtime version during installs. (3) Run yarn/npm install to update the lockfile and run Metro/Hermes builds to verify no duplicate runtime copies are bundled.
{
  "devDependencies": {
    "@babel/runtime": "^7.25.3"
  },
  "resolutions": {
    "@babel/runtime": "^7.25.3"
  }
}

Reviewed by Panto AI

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4bfd885 and c122a26.

📒 Files selected for processing (1)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-android
  • GitHub Check: test-ios
🔇 Additional comments (1)
package.json (1)

94-102: Correct placement: @babel/runtime should be in dependencies, not devDependencies.

This is the right fix. For a published React Native SDK, @babel/runtime must be in dependencies since it's required at runtime when the package's transpiled code executes in end-user applications. Keeping it only in devDependencies would cause runtime errors in consuming projects.

package.json Outdated
"url": "https://github.com/Usercentrics/react-native-sdk/issues"
},
"dependencies": {
"@babel/runtime": "^7.25.3",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

@babel/runtime 7.25.3 security vulnerabilities CVE

💡 Result:

Yes — @babel/runtime 7.25.3 is affected by CVE-2025-27789 (a ReDoS / inefficient regular-expression complexity issue). The flaw affects @babel/runtime versions < 7.26.10; upgrade to >= 7.26.10 (and recompile your code) to remediate. [1][2][3]

Sources:

  • Armis CVE entry for CVE-2025-27789. [1]
  • ResolvedSecurity summary (affected versions include @babel/runtime < 7.26.10). [2]
  • IBM security bulletin referencing CVE-2025-27789 and the fix requirement (upgrade and recompile). [3]

🌐 Web query:

@babel/runtime version 7.25.3 latest stable release npm

💡 Result:

No — @babel/runtime@7.25.3 is not the latest. The current latest stable on npm is 7.28.4 (published Dec 4, 2025). [1][2]

Sources:

  • npm package page for @babel/runtime (version listing). [1]
  • Release history for @babel/runtime. [2]

Upgrade @babel/runtime to at least 7.26.10 to fix CVE-2025-27789.

Version 7.25.3 is affected by CVE-2025-27789 (ReDoS vulnerability). Versions below 7.26.10 are vulnerable. Upgrade to 7.26.10 or later (latest is 7.28.4) and recompile.

🤖 Prompt for AI Agents
In package.json around line 95, the @babel/runtime entry is pinned to "7.25.3"
which is vulnerable to CVE-2025-27789; update the version string to at least
"7.26.10" (preferably the latest stable, e.g. "7.28.4"), then run your package
manager (npm install or yarn install) to update node_modules and the lockfile
(package-lock.json or yarn.lock), recompile/build the project, and run tests and
npm audit to verify the vulnerability is resolved.

@codeant-ai
Copy link

codeant-ai bot commented Dec 5, 2025

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@islameldesoky95 islameldesoky95 merged commit 3056a2c into master Dec 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 1/5 size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants