From 58b45e86a6fd78409dc358e27ae736c95fee9f39 Mon Sep 17 00:00:00 2001 From: Blake Friedman Date: Mon, 4 Mar 2024 04:47:34 -0800 Subject: [PATCH] Remove RFC-0759 ram-bundle command from cli (#43292) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43292 The ram-bundle command isn't necessary now that Hermes is our default VM. The RFC specifically calls for the CLI command to be removed [1]. [1] https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#commands-to-be-removed Changelog: [General][Removed] - RFC-0759 remove ram-bundle command. Reviewed By: NickGerleman, cipolleschi Differential Revision: D54430289 fbshipit-source-id: 49d519c007b739f89ffe9032fec905c56ea49f4a --- packages/community-cli-plugin/README.md | 18 --------- .../src/commands/ram-bundle/index.js | 38 ------------------- .../community-cli-plugin/src/index.flow.js | 1 - packages/react-native/react-native.config.js | 2 - 4 files changed, 59 deletions(-) delete mode 100644 packages/community-cli-plugin/src/commands/ram-bundle/index.js diff --git a/packages/community-cli-plugin/README.md b/packages/community-cli-plugin/README.md index aebbf39d10..12fcffb9c0 100644 --- a/packages/community-cli-plugin/README.md +++ b/packages/community-cli-plugin/README.md @@ -69,24 +69,6 @@ npx react-native bundle --entry-file [options] | `--read-global-cache` | Attempt to fetch transformed JS code from the global cache, if configured. Defaults to `false`. | | `--config ` | Path to the CLI configuration file. | -### `ram-bundle` - -Build the [RAM bundle](https://reactnative.dev/docs/ram-bundles-inline-requires) for the provided JavaScript entry file. - -#### Usage - -```sh -npx react-native ram-bundle --entry-file [options] -``` - -#### Options - -Accepts all options supported by [`bundle`](#bundle) and the following: - -| Option | Description | -| - | - | -| `--indexed-ram-bundle` | Force the "Indexed RAM" bundle file format, even when building for Android. | - ## Contributing Changes to this package can be made locally and tested against the `rn-tester` app, per the [Contributing guide](https://reactnative.dev/contributing/overview#contributing-code). During development, this package is automatically run from source with no build step. diff --git a/packages/community-cli-plugin/src/commands/ram-bundle/index.js b/packages/community-cli-plugin/src/commands/ram-bundle/index.js deleted file mode 100644 index eeed0819cf..0000000000 --- a/packages/community-cli-plugin/src/commands/ram-bundle/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - * @oncall react_native - */ - -import type {BundleCommandArgs} from '../bundle'; -import type {Command, Config} from '@react-native-community/cli-types'; - -import bundleCommand from '../bundle'; -import buildBundle from '../bundle/buildBundle'; -import metroRamBundle from 'metro/src/shared/output/RamBundle'; - -const ramBundleCommand: Command = { - name: 'ram-bundle', - description: - 'Build the RAM bundle for the provided JavaScript entry file. See https://reactnative.dev/docs/ram-bundles-inline-requires.', - func: (argv: Array, config: Config, args: BundleCommandArgs) => { - return buildBundle(argv, config, args, metroRamBundle); - }, - options: [ - // $FlowFixMe[incompatible-type] options is nonnull - ...bundleCommand.options, - { - name: '--indexed-ram-bundle', - description: - 'Force the "Indexed RAM" bundle file format, even when building for android', - default: false, - }, - ], -}; - -export default ramBundleCommand; diff --git a/packages/community-cli-plugin/src/index.flow.js b/packages/community-cli-plugin/src/index.flow.js index 80adc7e51b..e9dbc7adc2 100644 --- a/packages/community-cli-plugin/src/index.flow.js +++ b/packages/community-cli-plugin/src/index.flow.js @@ -10,7 +10,6 @@ */ export {default as bundleCommand} from './commands/bundle'; -export {default as ramBundleCommand} from './commands/ram-bundle'; export {default as startCommand} from './commands/start'; export {unstable_buildBundleWithConfig} from './commands/bundle/buildBundle'; diff --git a/packages/react-native/react-native.config.js b/packages/react-native/react-native.config.js index 6a8394e8ac..64841ed37a 100644 --- a/packages/react-native/react-native.config.js +++ b/packages/react-native/react-native.config.js @@ -13,7 +13,6 @@ const android = require('@react-native-community/cli-platform-android'); const ios = require('@react-native-community/cli-platform-ios'); const { bundleCommand, - ramBundleCommand, startCommand, } = require('@react-native/community-cli-plugin'); @@ -49,7 +48,6 @@ module.exports = { ...ios.commands, ...android.commands, bundleCommand, - ramBundleCommand, startCommand, codegenCommand, ],