Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: align wording with Rspack support #744

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="./logo.png">
</p>
<p align="center">
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.
</p>

---
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/callstack/repack/HEAD/logo.png">
</p>
<p align="center">
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.
</p>

---
Expand Down
2 changes: 1 addition & 1 deletion packages/init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/callstack/repack/HEAD/logo.png">
</p>
<p align="center">
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.
</p>

---
Expand Down
4 changes: 2 additions & 2 deletions packages/repack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/callstack/repack/HEAD/logo.png">
</p>
<p align="center">
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.
</p>

---
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion packages/repack/package.json
Original file line number Diff line number Diff line change
@@ -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": "",
Expand Down
4 changes: 2 additions & 2 deletions packages/repack/src/commands/rspack/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/repack/src/commands/rspack/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/repack/src/commands/webpack/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/repack/src/commands/webpack/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions templates/webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions templates_v5/rspack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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',
},
Expand Down
4 changes: 2 additions & 2 deletions templates_v5/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions templates_v5/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions templates_v5/webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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: [
Expand Down
14 changes: 7 additions & 7 deletions website/src/public/configs/webpack.config
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -227,7 +227,7 @@ module.exports = {
/**
* By default Webpack will emit files into `output.path` directory (eg: `<root>/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: `<root>/build/<platform>/remote` by default).
* In development mode (when development server is running), this plugin is a no-op.
Expand All @@ -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({
Expand All @@ -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.
Expand Down