Skip to content

Added support for new rn versions#16

Merged
christian97dd merged 2 commits intomasterfrom
APPSRN-446-soporte-para-actualización-de-apps
Nov 11, 2025

Hidden character warning

The head ref may contain hidden characters: "APPSRN-446-soporte-para-actualizaci\u00f3n-de-apps"
Merged

Added support for new rn versions#16
christian97dd merged 2 commits intomasterfrom
APPSRN-446-soporte-para-actualización-de-apps

Conversation

@pablonortiz
Copy link
Copy Markdown
Contributor

@pablonortiz pablonortiz commented Oct 31, 2025

LINK DE TICKET:
https://janiscommerce.atlassian.net/browse/APPSRN-446

DESCRIPCIÓN DEL REQUERIMIENTO:
Se requieren realizar ciertos ajustes a la librería para que la misma soporte la actualización de versión de React y React Native de las APPs y, a la vez, nos permita eliminar las flags de --legacy-peer-deps / --force a la hora de tirar un npm i dentro del repo de las APPs.

DESCRIPCIÓN DE LA SOLUCIÓN:
Los ajustes que se hicieron en la librería fueron:

Ajustar las peerDependencies

react: 18.2.0 → >=17.0.2 <19.0.0

react-native: 0.71.5 → >=0.67.5 <0.75.0

Eliminar uso de react-native-device-info

Eliminarlo de dependencies

Implementar app-device-info (nuestra librería)

NIVEL PRUEBAS * ### (Marcar con X)

[X] NIVEL CRITICO, CAMBIOS MAYORES

[ ] NIVEL ALTO, CAMBIOS MODERADOS

[ ] NIVEL MEDIO, CAMBIOS MENORES

[ ] NIVEL BAJO, CAMBIOS NO CRITICOS

CÓMO SE PUEDE PROBAR?
Probar linkeando a una de las tres apps y verificando que además de buildear, las request se hagan correctamente

SCREENSHOTS:

DATOS EXTRA A TENER EN CUENTA:

CHANGELOG:

Summary by CodeRabbit

  • Chores

    • Replaced the internal device-info library to align with updated platform tooling.
  • Tests

    • Enhanced test environment with deterministic mocks for device information APIs to improve test stability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 31, 2025

📝 Walkthrough

Walkthrough

The pull request replaces imports and mocks for react-native-device-info with @janiscommerce/app-device-info, updates package.json dependencies, and adds Jest mocks for the new module's device-info getters.

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Replaced react-native-device-info with @janiscommerce/app-device-info in devDependencies and peerDependencies (version bumped to ^1.2.0).
Import Migration
lib/utils/updateHeaders.js
Changed import source from react-native-device-info to @janiscommerce/app-device-info; usages of getApplicationName, getBuildNumber, getVersion, getBundleId, getSystemName, getSystemVersion, getUniqueId, and getModel remain unchanged.
Test Mocks
setupTest/jest.setup.js
Added mock for @janiscommerce/app-device-info exporting the 8 getter functions, returning fixed values ('unknown' or '') for deterministic tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check that @janiscommerce/app-device-info exports the same functions/signatures used in updateHeaders.js.
  • Verify mock return values match test expectations and no tests rely on previous react-native-device-info behavior.
  • Ensure package.json dependency entries (dev/peer) are correct and consistent.

Poem

🐰 I hopped through imports, light and spry,
Swapped one package with a curious eye,
Eight little getters now mocked in place,
Tests stay steady, headers keep pace,
A tiny change — a tidy supply. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Added support for new rn versions' is vague and does not clearly convey the main changes—it mentions React Native version support but omits the critical internal library migration from react-native-device-info to @janiscommerce/app-device-info. Consider a more specific title that captures both the version range updates and the device-info library migration, such as 'Replace react-native-device-info with internal app-device-info library and update version ranges'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch APPSRN-446-soporte-para-actualización-de-apps

📜 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 bf4f72d and 9b7cc27.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (1 hunks)
🔇 Additional comments (4)
package.json (4)

43-43: Good! Address from past review comment.

The addition of @janiscommerce/app-device-info to devDependencies resolves the feedback from the previous review.


49-49: Verify react version constraint is complete.

The react version constraint shows >=17.0.2 but the PR objectives specify >=17.0.2 <19.0.0. Confirm whether the upper bound <19.0.0 was intentionally omitted or is missing. Using ^18 (caret) would also work if the intent is to allow v18.x.


48-54: Verify react-native peer dependency is updated.

The PR objectives indicate react-native should be updated to >=0.67.5 <0.75.0, but it does not appear in the peerDependencies section shown. Confirm that this peer dependency has been added or verify whether it was intentionally removed.


50-50: Confirm react-native-device-info removal.

The PR objectives state that react-native-device-info was removed from dependencies. While the code shows @janiscommerce/app-device-info added, verify that react-native-device-info has been fully removed from both dependencies and devDependencies sections.


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.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 31, 2025
"peerDependencies": {
"react": ">=17.0.2",
"react-native-device-info": "^10.12.0",
"@janiscommerce/app-device-info": "^1.2.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pablonortiz faltaría agregar app-device-info como devDependency como hablamos en la meet, el resto lo probé y va bien!

@christian97dd christian97dd merged commit f4d9b29 into master Nov 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants