From 4738c0d5bf27332e6e409e720787ef0bf5021b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Wed, 11 Sep 2024 15:10:45 +0200 Subject: [PATCH] docs: align wording with Rspack support --- ARCHITECTURE.md | 6 +++--- CONTRIBUTING.md | 2 +- README.md | 9 ++++----- packages/dev-server/README.md | 2 +- packages/init/README.md | 2 +- packages/repack/README.md | 4 ++-- packages/repack/package.json | 2 +- packages/repack/src/commands/rspack/bundle.ts | 4 ++-- packages/repack/src/commands/rspack/start.ts | 4 ++-- packages/repack/src/commands/webpack/bundle.ts | 4 ++-- packages/repack/src/commands/webpack/start.ts | 4 ++-- templates/webpack.config.cjs | 4 ++-- templates/webpack.config.mjs | 4 ++-- templates_v5/rspack.config.cjs | 4 ++-- templates_v5/rspack.config.mjs | 4 ++-- templates_v5/webpack.config.cjs | 4 ++-- templates_v5/webpack.config.mjs | 4 ++-- website/src/public/configs/webpack.config | 14 +++++++------- 18 files changed, 40 insertions(+), 41 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 8a0b53a4e..b83028adb 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -12,7 +12,7 @@ for an additional context on configuration, parameters and types. There are 2 ways to look at the content of the Re.Pack: -- by command that are exposed to React Native CLI +- by command that are exposed to React Native Community CLI - by Webpack plugins and utilities Here's a chart that represents both aspect of the codebase: @@ -31,7 +31,7 @@ The following list describes the components that create Re.Pack: - `client/` - `runtime/` — Source code for runtime code embedded into a final bundle. - `chunks-api/` — Source code for `ChunkManager` used for dealing with Code Splitting. - - `commands/` — Source code for React Native CLI commands. + - `commands/` — Source code for React Native Community CLI commands. - `server/` — Source code for Development server, proxy and all related functionality. - `webpack/` — Source code for Webpack plugins and utilities. - `debugger-ui` — Source code for Chrome Remote JS debugger. @@ -44,7 +44,7 @@ The core of bundling functionality is to load platform-specific Webpack configur Depending on how code is run, the final Webpack configuration might be different: -- if Webpack and Re.Pack are run by React Native CLI, it provides data to functions like `getMode`, `getContext` etc. +- if Webpack and Re.Pack are run by React Native Community CLI, it provides data to functions like `getMode`, `getContext` etc. - if Webpack and Re.Pack are run by Webpack CLI, the results for functions like `getMode`, `getContext`, etc is based on `fallback` values. ## Development server diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81a879673..4c010cdce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ We use `typescript` for type checking, `eslint` with `prettier` for linting and ### Running the example -The example TesterApp uses React Native CLI so make sure you have your [environment setup to build native apps](https://reactnative.dev/docs/environment-setup). +The example TesterApp uses React Native Community CLI so make sure you have your [environment setup to build native apps](https://reactnative.dev/docs/environment-setup). You can then use Xcode/Android Studio/Gradle to build application or run `pnpm react-native webpack-start` and `pnpm react-native run-ios`/`pnpm react-native run-android` to start development server and run applications in development mode. diff --git a/README.md b/README.md index 3636b8c29..c27cb1d9f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem. +A toolkit to build your React Native application with Rspack or Webpack.

--- @@ -17,9 +17,7 @@ A Webpack-based toolkit to build your React Native application with full support Re.Pack is a next generation of [Haul](https://github.com/callstack/haul) — a Webpack-based bundler for React Native applications. -Re.Pack uses Webpack 5 and React Native CLI's plugin system to allow you to bundle your application using Webpack and allow to easily switch from Metro. - -**Check the base [`webpack.config.cjs`](https://github.com/callstack/repack/blob/main/templates/webpack.config.cjs) or [`webpack.config.mjs`](https://github.com/callstack/repack/blob/main/templates/webpack.config.mjs) template, if you're curious how it all looks like.** +Re.Pack uses Rspack (or Webpack 5) and React Native Community CLI's plugin system to allow you to bundle your application using Webpack and easily switch from Metro. ## Features @@ -55,6 +53,7 @@ Re.Pack uses Webpack 5 and React Native CLI's plugin system to allow you to bund - [x] [Module Federation](https://medium.com/swlh/webpack-5-module-federation-a-game-changer-to-javascript-architecture-bcdd30e02669) support - [x] Code signing and verification - [x] `@callstack/repack-init` - tool that automates the integration of the Re.Pack into React Native projects +- [x] Rspack support ### Examples @@ -64,7 +63,7 @@ For a more comprehensive example of a Super App setup with Module Federation ple ## Documentation -The documentation is available at: https://re-pack.dev +The documentation is available at [re-pack.dev](https://re-pack.dev). You can also use the following links to jump to specific topics: diff --git a/packages/dev-server/README.md b/packages/dev-server/README.md index a89e55c70..ffe98b9ff 100644 --- a/packages/dev-server/README.md +++ b/packages/dev-server/README.md @@ -2,7 +2,7 @@

-A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem. +A toolkit to build your React Native application with Rspack or Webpack.

--- diff --git a/packages/init/README.md b/packages/init/README.md index 528ad5a65..670bfd275 100644 --- a/packages/init/README.md +++ b/packages/init/README.md @@ -2,7 +2,7 @@

-A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem. +A toolkit to build your React Native application with Rspack or Webpack.

--- diff --git a/packages/repack/README.md b/packages/repack/README.md index 7b73f6047..d41368867 100644 --- a/packages/repack/README.md +++ b/packages/repack/README.md @@ -2,7 +2,7 @@

-A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem. +A toolkit to build your React Native application with Rspack or Webpack.

--- @@ -15,7 +15,7 @@ A Webpack-based toolkit to build your React Native application with full support Re.Pack is a next generation of [Haul](https://github.com/callstack/haul) — a Webpack-based bundler for React Native applications. -Re.Pack uses Webpack 5 and React Native CLI's plugin system to allow you to bundle your application using Webpack and allow to easily switch from Metro. +Re.Pack uses Rspack (or Webpack 5) and React Native Community CLI's plugin system to allow you to bundle your application using Webpack and allow to easily switch from Metro. Check out our website at https://re-pack.dev for more info and documentation or out GitHub: https://github.com/callstack/repack. diff --git a/packages/repack/package.json b/packages/repack/package.json index 4984d7b0f..f73e32058 100644 --- a/packages/repack/package.json +++ b/packages/repack/package.json @@ -1,7 +1,7 @@ { "name": "@callstack/repack", "version": "5.0.0-alpha.0", - "description": "A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem.", + "description": "A toolkit to build your React Native application with Rspack or Webpack.", "main": "./dist/index.js", "types": "./dist/index.d.ts", "react-native": "", diff --git a/packages/repack/src/commands/rspack/bundle.ts b/packages/repack/src/commands/rspack/bundle.ts index 81f961221..d2e576b6d 100644 --- a/packages/repack/src/commands/rspack/bundle.ts +++ b/packages/repack/src/commands/rspack/bundle.ts @@ -12,12 +12,12 @@ import { } from '../common'; /** - * Bundle command for React Native CLI. + * Bundle command for React Native Community CLI. * It runs Rspack, builds bundle and saves it alongside any other assets and Source Map * to filesystem. * * @param _ Original, non-parsed arguments that were provided when running this command. - * @param config React Native CLI configuration object. + * @param config React Native Community CLI configuration object. * @param args Parsed command line arguments. * * @internal diff --git a/packages/repack/src/commands/rspack/start.ts b/packages/repack/src/commands/rspack/start.ts index 345a44cd0..0375c6df0 100644 --- a/packages/repack/src/commands/rspack/start.ts +++ b/packages/repack/src/commands/rspack/start.ts @@ -20,12 +20,12 @@ import { import { Compiler } from './Compiler'; /** - * Start command for React Native CLI. + * Start command for React Native Community CLI. * It runs `@callstack/repack-dev-server` to provide Development Server functionality to React Native apps * in development mode. * * @param _ Original, non-parsed arguments that were provided when running this command. - * @param config React Native CLI configuration object. + * @param config React Native Community CLI configuration object. * @param args Parsed command line arguments. * * @internal diff --git a/packages/repack/src/commands/webpack/bundle.ts b/packages/repack/src/commands/webpack/bundle.ts index 52653fb2d..ccc7ffd5b 100644 --- a/packages/repack/src/commands/webpack/bundle.ts +++ b/packages/repack/src/commands/webpack/bundle.ts @@ -11,12 +11,12 @@ import { } from '../common'; /** - * Bundle command for React Native CLI. + * Bundle command for React Native Community CLI. * It runs Webpack, builds bundle and saves it alongside any other assets and Source Map * to filesystem. * * @param _ Original, non-parsed arguments that were provided when running this command. - * @param config React Native CLI configuration object. + * @param config React Native Community CLI configuration object. * @param args Parsed command line arguments. * * @internal diff --git a/packages/repack/src/commands/webpack/start.ts b/packages/repack/src/commands/webpack/start.ts index df3e2c1e3..5e40e099e 100644 --- a/packages/repack/src/commands/webpack/start.ts +++ b/packages/repack/src/commands/webpack/start.ts @@ -23,12 +23,12 @@ import { Compiler } from './Compiler'; import { HMRMessageBody } from './types'; /** - * Start command for React Native CLI. + * Start command for React Native Community CLI. * It runs `@callstack/repack-dev-server` to provide Development Server functionality to React Native apps * in development mode. * * @param _ Original, non-parsed arguments that were provided when running this command. - * @param config React Native CLI configuration object. + * @param config React Native Community CLI configuration object. * @param args Parsed command line arguments. * * @internal diff --git a/templates/webpack.config.cjs b/templates/webpack.config.cjs index cf0644ac8..faa6470ac 100644 --- a/templates/webpack.config.cjs +++ b/templates/webpack.config.cjs @@ -14,7 +14,7 @@ const Repack = require('@callstack/repack'); * Webpack configuration. * You can also export a static object or a function returning a Promise. * - * @param env Environment options passed from either Webpack CLI or React Native CLI + * @param env Environment options passed from either Webpack CLI or React Native Community CLI * when running with `react-native start/bundle`. */ module.exports = (env) => { @@ -114,7 +114,7 @@ module.exports = (env) => { * Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, /** Configure minimizer to process the bundle. */ minimizer: [ diff --git a/templates/webpack.config.mjs b/templates/webpack.config.mjs index 4f19a6fa0..81d05f383 100644 --- a/templates/webpack.config.mjs +++ b/templates/webpack.config.mjs @@ -18,7 +18,7 @@ const { resolve } = createRequire(import.meta.url); * Webpack configuration. * You can also export a static object or a function returning a Promise. * - * @param env Environment options passed from either Webpack CLI or React Native CLI + * @param env Environment options passed from either Webpack CLI or React Native Community CLI * when running with `react-native start/bundle`. */ export default (env) => { @@ -118,7 +118,7 @@ export default (env) => { * Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, /** Configure minimizer to process the bundle. */ minimizer: [ diff --git a/templates_v5/rspack.config.cjs b/templates_v5/rspack.config.cjs index bc3984c5f..4f6283c88 100644 --- a/templates_v5/rspack.config.cjs +++ b/templates_v5/rspack.config.cjs @@ -13,7 +13,7 @@ const Repack = require('@callstack/repack'); * Webpack configuration. * You can also export a static object or a function returning a Promise. * - * @param env Environment options passed from either Webpack CLI or React Native CLI + * @param env Environment options passed from either Webpack CLI or React Native Community CLI * when running with `react-native start/bundle`. */ module.exports = (env) => { @@ -78,7 +78,7 @@ module.exports = (env) => { }, /** Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, chunkIds: 'named', }, diff --git a/templates_v5/rspack.config.mjs b/templates_v5/rspack.config.mjs index 9708a96ad..371c29a57 100644 --- a/templates_v5/rspack.config.mjs +++ b/templates_v5/rspack.config.mjs @@ -17,7 +17,7 @@ const { resolve } = createRequire(import.meta.url); * Webpack configuration. * You can also export a static object or a function returning a Promise. * - * @param env Environment options passed from either Webpack CLI or React Native CLI + * @param env Environment options passed from either Webpack CLI or React Native Community CLI * when running with `react-native start/bundle`. */ export default (env) => { @@ -82,7 +82,7 @@ export default (env) => { }, /** Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, /** Configure minimizer to process the bundle. */ chunkIds: 'named', diff --git a/templates_v5/webpack.config.cjs b/templates_v5/webpack.config.cjs index ce95ed7ac..d1d075c5f 100644 --- a/templates_v5/webpack.config.cjs +++ b/templates_v5/webpack.config.cjs @@ -14,7 +14,7 @@ const Repack = require('@callstack/repack'); * Webpack configuration. * You can also export a static object or a function returning a Promise. * - * @param env Environment options passed from either Webpack CLI or React Native CLI + * @param env Environment options passed from either Webpack CLI or React Native Community CLI * when running with `react-native start/bundle`. */ module.exports = (env) => { @@ -96,7 +96,7 @@ module.exports = (env) => { * Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, /** Configure minimizer to process the bundle. */ minimizer: [ diff --git a/templates_v5/webpack.config.mjs b/templates_v5/webpack.config.mjs index 7c4a04899..520c77665 100644 --- a/templates_v5/webpack.config.mjs +++ b/templates_v5/webpack.config.mjs @@ -18,7 +18,7 @@ const { resolve } = createRequire(import.meta.url); * Webpack configuration. * You can also export a static object or a function returning a Promise. * - * @param env Environment options passed from either Webpack CLI or React Native CLI + * @param env Environment options passed from either Webpack CLI or React Native Community CLI * when running with `react-native start/bundle`. */ export default (env) => { @@ -95,7 +95,7 @@ export default (env) => { * Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, /** Configure minimizer to process the bundle. */ minimizer: [ diff --git a/website/src/public/configs/webpack.config b/website/src/public/configs/webpack.config index 6ff525da2..1d8ffba0d 100644 --- a/website/src/public/configs/webpack.config +++ b/website/src/public/configs/webpack.config @@ -14,18 +14,18 @@ const ReactNative = require('@callstack/repack'); /** * This is the Webpack configuration file for your React Native project. * It can be used in 2 ways: - * - by running React Native CLI eg: `npx react-native start` or `npx react-native bundle` + * - by running React Native Community CLI eg: `npx react-native start` or `npx react-native bundle` * - by running Webpack CLI eg: `PLATFORM=(ios|android) npx webpack-cli -c webpack.config.js` * * Depending on which option you chose the output might be different, since when running with - * React Native CLI most of the values from `getMode`, `getPlatform`, etc. will be filled in by React Native CLI. + * React Native Community CLI most of the values from `getMode`, `getPlatform`, etc. will be filled in by React Native Community CLI. * However, when running with Webpack CLI, you might want to tweak `fallback` values to your liking. * * Please refer to the API documentation for list of options, plugins and their descriptions. */ /** - * Get options from React Native CLI when Webpack is run from `react-native start` or `react-native bundle`. + * Get options from React Native Community CLI when Webpack is run from `react-native start` or `react-native bundle`. * * If you run Webpack using Webpack CLI, the values from `fallback` will be used - use it * to specify your values, if the defaults don't suit your project. @@ -108,7 +108,7 @@ module.exports = { * Configures optimization of the built bundle. */ optimization: { - /** Enables minification based on values passed from React Native CLI or from fallback. */ + /** Enables minification based on values passed from React Native Community CLI or from fallback. */ minimize, /** Configure minimizer to process the bundle. */ minimizer: [ @@ -227,7 +227,7 @@ module.exports = { /** * By default Webpack will emit files into `output.path` directory (eg: `/build/ios`), * but in order to for the React Native application to include those files (or a subset of those) - * they need to be copied over to correct output directories supplied from React Native CLI + * they need to be copied over to correct output directories supplied from React Native Community CLI * when bundling the code (with `webpack-bundle` command). * All remote chunks will be placed under `remoteChunksOutput` directory (eg: `/build//remote` by default). * In development mode (when development server is running), this plugin is a no-op. @@ -239,7 +239,7 @@ module.exports = { }), /** - * Runs development server when running with React Native CLI start command or if `devServer` + * Runs development server when running with React Native Community CLI start command or if `devServer` * was provided as s `fallback`. */ new ReactNative.DevServerPlugin({ @@ -249,7 +249,7 @@ module.exports = { /** * Configures Source Maps for the main bundle based on CLI options received from - * React Native CLI or fallback value.. + * React Native Community CLI or fallback value.. * It's recommended to leave the default values, unless you know what you're doing. * Wrong options might cause symbolication of stack trace inside React Native app * to fail - the app will still work, but you might not get Source Map support.