Skip to content

fix(react-native): keep metadata.android when writing nativescript.react-native.json - #85

Merged
ammarahm-ed merged 1 commit into
android-react-nativefrom
fix/rn-keep-android-metadata-config
Oct 25, 2026
Merged

ammarahm-ed merged 1 commit into
android-react-nativefrom
fix/rn-keep-android-metadata-config

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

Split out of #77.

Summary

ensureMetadataConfig replaced the whole reactNative.metadata block in nativescript.react-native.json, so every prebuild or configure run deleted a hand-written metadata.android.include. That list is the only way to keep a class in filtered Android release metadata when the bundle analysis can't see it. It is also the only way to keep autolinked module packages, because the release blacklist beats whitelist.mdg.

 reactNative: {
   ...existingReactNative,
-  metadata: metadataOptions,
+  metadata: { ...existingMetadata, ...metadataOptions },
 }
  • The config plugin accepts metadata.android.include in its options. If it's omitted, a hand-written android block is kept.
  • The file is written on Android-only prebuilds too.

Evidence

node test/config-plugin.test.js runs the real plugin against temp project directories.

  • Before: this branch's test against the base plugin fails:
    AssertionError: Expected values to be strictly deep-equal:
      actual: { includePods: [], includeSystemFrameworks: [] },
    
    The hand-written android block is gone.
  • After: it passes. A hand-written metadata.android survives a run, and plugin options can set it.

Merge Danger

Door: two-way

Blast Radius: nativescript.react-native.json

Keys under metadata that the plugin doesn't set are now preserved instead of dropped.

…act-native.json

The config plugin and nativescript-rn configure replaced the whole
reactNative.metadata block, so every prebuild or configure run deleted
a hand-written metadata.android.include. That list is what keeps
classes, including autolinked module packages, in filtered Android
release metadata.

Merge into the existing metadata instead, accept metadata.android.include
in the plugin options, and write the file on Android-only prebuilds too.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a330ceab-bccf-4fce-97eb-627f77802cac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ammarahm-ed
ammarahm-ed merged commit 64c7fed into android-react-native Oct 25, 2026
2 checks passed
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