Skip to content

fix: resolve HybridView config via react-native package exports - #62

Open
jkasprzyk17 wants to merge 1 commit into
mainfrom
fix/nitro-package-exports
Open

fix: resolve HybridView config via react-native package exports#62
jkasprzyk17 wants to merge 1 commit into
mainfrom
fix/nitro-package-exports

Conversation

@jkasprzyk17

@jkasprzyk17 jkasprzyk17 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add react-native entry and exports.react-native so Metro resolves src/ instead of lib/module/ for HybridView imports
  • Keep Nitrogen MapViewConfig.json import path as documented (../../nitrogen/... from src/native/)
  • Align example Metro conditions with the standard react-native export condition

Why

Bob emits MapViewNative under lib/module/native/, so ../../nitrogen/... resolves to lib/nitrogen/ and breaks for consumers loading the compiled package. Resolving src/ matches the Nitro HybridView packaging pattern used by nitro-image and Vision Camera.

Test plan

  • bun run typecheck
  • Install from this branch in an Expo app without a MapViewConfig.json metro resolveRequest hack and confirm the app bundles
  • Example app still bundles with updated example/metro.config.js

Point Metro to src/ so Nitrogen MapViewConfig.json imports work without
consumer metro.config.js hacks after bob emits lib/module/.
@github-actions

Copy link
Copy Markdown

React Doctor found 8 issues in 5 files · 2 errors & 6 warnings · score 64 / 100 (Needs work) · full project

Errors

6 warnings

App.tsx

  • ⚠️ L729 Side effect inside a state updater function no-side-effect-in-state-updater-function
  • ⚠️ L734 Side effect inside a state updater function no-side-effect-in-state-updater-function
  • ⚠️ L735 Side effect inside a state updater function no-side-effect-in-state-updater-function

package.json

  • ⚠️ L0 unused-dev-dependency

src/hooks/index.ts

  • ⚠️ L0 unused-file

src/utils/enteringAnimation.ts

  • ⚠️ L33 unused-export

Reviewed by React Doctor for commit 2c97fa9. See inline comments for fixes.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 265ce7cc-f400-4512-a559-64582d01e0c7

📥 Commits

Reviewing files that changed from the base of the PR and between 1c38c93 and 2c97fa9.

📒 Files selected for processing (3)
  • docs/architecture.md
  • example/metro.config.js
  • package/package.json
💤 Files with no reviewable changes (1)
  • example/metro.config.js

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Improved React Native package resolution for Nitro HybridView applications.
    • React Native consumers now use the intended package entry point and source configuration during development.
  • Documentation

    • Updated Metro build-pipeline documentation to reflect the current React Native export behavior.

Walkthrough

The package now exposes React Native entries through the react-native export condition. Metro no longer resolves the source condition. The architecture documentation reflects this resolution path.

Changes

React Native resolution

Layer / File(s) Summary
React Native export-condition wiring
package/package.json, example/metro.config.js, docs/architecture.md
The package adds a top-level react-native entry and maps the root export to react-native. Metro removes source from its resolver conditions. The architecture documentation describes resolution to src/.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 2c97f

The localized export-condition change routes HybridView imports through src and removes the example resolver workaround; no concrete correctness or merge-blocking risk remains beyond normal checks.

Suggested reviewers: piotr-graczyk-dev

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed No medium-, high-, or critical-severity vulnerability is introduced. The diff changes only static package metadata, Metro condition configuration, and documentation. The new react-native and `import…
Title check ✅ Passed The title accurately describes the package export fix and uses the required fix: prefix. At 63 characters, it exceeds the ideal 50-character limit but remains concise and descriptive.
Description check ✅ Passed The description clearly explains the export changes, the HybridView resolution issue, the reason for the fix, and the validation status.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Full details: Security Check

Explanation

No medium-, high-, or critical-severity vulnerability is introduced. The diff changes only static package metadata, Metro condition configuration, and documentation. The new react-native and import entries point to existing local files; no attacker-controlled input, dependency, script, permission check, network sink, or deserialization path changed. The package JSON parses successfully, and the exact diff contains no executable security-sensitive logic. GitHub review lookup for PR #62 found no prior security findings or inline review threads to re-report.


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

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.

1 participant