Skip to content

feat: enable release profiling#1

Merged
hurali97 merged 10 commits into
mainfrom
feat/release-profiler
May 19, 2026
Merged

feat: enable release profiling#1
hurali97 merged 10 commits into
mainfrom
feat/release-profiler

Conversation

@hurali97
Copy link
Copy Markdown
Collaborator

@hurali97 hurali97 commented May 14, 2026

Description:

This introduces the core logic for react-native-release-inspector and cli. The usage is as simple as:

Install package:
yarn add react-native-release-inspector
Add import statement to the top of index.js
import '@callstack/react-native-release-inspector';
import { AppRegistry } from 'react-native';
Configure metro
const {
  withReactNativeReleaseInspector,
} = require('@callstack/react-native-release-inspector/metro');

...

module.exports = withReactNativeReleaseInspector(config, true);
Start the inspector
yarn inspector start

That is pretty much it. Build and run the application in release mode. The app should auto connect to the profiler.

Test Plan

Screen.Recording.2026-05-18.at.4.06.53.PM.mov

@hurali97 hurali97 marked this pull request as ready for review May 18, 2026 11:08
@hurali97 hurali97 requested a review from Copilot May 18, 2026 11:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces the initial implementation of react-native-release-inspector (runtime hook + Metro integration) and a new CLI that launches matching React DevTools, enabling profiling/inspection when running React Native apps in Release mode.

Changes:

  • Add a new workspace package @callstack/react-native-release-inspector-cli and wire it into root lint/typecheck scripts.
  • Implement @callstack/react-native-release-inspector runtime side-effect entrypoint plus a Metro config wrapper to inject it early and rewrite Fabric prod implementation to profiling.
  • Update the example app to import the inspector, adjust Metro config, and run iOS Release by default; remove unused native TurboModule scaffolding.

Reviewed changes

Copilot reviewed 31 out of 35 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
yarn.lock Adds new workspace CLI + Metro config deps; updates lockfile resolutions.
packages/react-native-release-inspector/tsconfig.json Adds DOM lib and excludes lib/ from TS program.
packages/react-native-release-inspector/src/react-devtools-core.d.ts Adds a local type shim for react-devtools-core.
packages/react-native-release-inspector/src/NativeReleaseInspector.ts Removes TurboModule stub.
packages/react-native-release-inspector/src/multiply.tsx Removes old non-native placeholder API.
packages/react-native-release-inspector/src/multiply.native.tsx Removes old native multiply wrapper.
packages/react-native-release-inspector/src/metro/index.ts Adds Metro wrapper to inject inspector and rewrite Fabric prod module.
packages/react-native-release-inspector/src/logging.ts Adds basic prefixed logging helpers.
packages/react-native-release-inspector/src/index.tsx Removes old entrypoint export.
packages/react-native-release-inspector/src/index.ts Adds runtime hook + websocket connect to DevTools on import.
packages/react-native-release-inspector/ReleaseInspector.podspec Removes iOS podspec (native module removed).
packages/react-native-release-inspector/package.json Switches entrypoints, adds ./metro export and an inspector bin; adds CLI dependency + peer dep on react-devtools-core.
packages/react-native-release-inspector/ios/ReleaseInspector.mm Removes iOS native module implementation.
packages/react-native-release-inspector/ios/ReleaseInspector.h Removes iOS native module header.
packages/react-native-release-inspector/bin/inspector.js Adds bin stub that delegates to the CLI package.
packages/react-native-release-inspector/android/src/main/java/com/releaseinspector/ReleaseInspectorPackage.kt Removes Android native package.
packages/react-native-release-inspector/android/src/main/java/com/releaseinspector/ReleaseInspectorModule.kt Removes Android native module.
packages/react-native-release-inspector/android/src/main/AndroidManifest.xml Removes Android manifest (native module removed).
packages/react-native-release-inspector/android/build.gradle Removes Android library build config.
packages/cli/tsconfig.json Adds CLI TS config (NodeNext, strict).
packages/cli/tsconfig.build.json Adds CLI build TS config emitting declarations + JS into lib/.
packages/cli/src/spinner.ts Adds a minimal CLI spinner utility.
packages/cli/src/index.ts Adds Commander-based CLI program + exported runners.
packages/cli/src/core.ts Adds logic to resolve RN’s devtools version and launch react-devtools via npx.
packages/cli/src/cli.ts Adds CLI bin entry.
packages/cli/package.json Adds CLI package metadata, scripts, dependencies, and inspector bin.
packages/cli/eslint.config.mjs Adds ESLint config for CLI workspace.
package.json Updates root lint/typecheck to include the CLI workspace.
apps/example/src/App.tsx Removes old multiply usage and simplifies UI.
apps/example/react-native.config.js Removes local native dependency override (no native module now).
apps/example/package.json Runs iOS via Release mode by default.
apps/example/metro.config.js Switches to monorepo Metro config helper and applies inspector Metro wrapper.
apps/example/ios/ReleaseInspectorExample.xcodeproj/xcshareddata/xcschemes/ReleaseInspectorExample.xcscheme Sets Xcode scheme to launch Release configuration.
apps/example/ios/Podfile.lock Removes ReleaseInspector pod entry (native module removed).
apps/example/index.js Adds side-effect import to initialize the inspector runtime.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react-native-release-inspector/src/index.ts
Comment thread packages/react-native-release-inspector/package.json
Comment thread packages/react-native-release-inspector/src/metro/index.ts
Comment thread packages/cli/src/core.ts Outdated
@hurali97 hurali97 merged commit ad1fd33 into main May 19, 2026
5 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