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

chore: polish some words on introduction #7557

Merged
merged 7 commits into from
Aug 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
3 changes: 2 additions & 1 deletion website/docs/en/guide/features/loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A loader performs pre-processing of resources, whereas a configuration [Rule.typ

:::

Rspack has supported most community loaders, but only a few loaders such as [cache-loader](https://github.com/web-infra-dev/rspack/issues/6457) are not yet supported. If you find an unsupported loader, please feel free to communicate with us through [GitHub Issues](https://github.com/web-infra-dev/rspack/issues).
Rspack has supported most community loaders. If you find an unsupported loader, please feel free to communicate with us through [GitHub Issues](https://github.com/web-infra-dev/rspack/issues).

## Example

Expand Down Expand Up @@ -142,3 +142,4 @@ For details, you can refer to [loader-api](/api/loader-api/index)
Built-in Loaders offer superior performance compared to JS Loaders, without sacrificing the composability of JS Loaders. The following are some built-in loaders.

- [builtin:swc-loader](/guide/features/builtin-swc-loader)
- [builtin:lightningcss-loader](/guide/features/builtin-lightningcss-loader)
2 changes: 1 addition & 1 deletion website/docs/en/guide/features/module-resolution.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module resolution

Module resolution is the process of converting a module identifier to a module's file path. The [nodejs_resolver](https://github.com/web-infra-dev/nodejs_resolver) is used in Rspack for module path resolution, which is an extension to the [node module resolution algorithm](https://nodejs.org/api/modules.html#modules_all_together) with the same interface as [enhanced-resolve](https://github.com/webpack/enhanced-resolve), see [resolution configuration](/config/resolve) for detailed resolve configuration.
Module resolution is the process of converting a module identifier to a module's file path. The Rust port of enhanced-resolve is used for module path resolution, which is an extension to the [node module resolution algorithm](https://nodejs.org/api/modules.html#modules_all_together) with the same interface as [enhanced-resolve](https://github.com/webpack/enhanced-resolve), refer to [resolve configuration](/config/resolve) for more information about module resolution configuration.

## Rspack

Expand Down
14 changes: 7 additions & 7 deletions website/docs/en/guide/start/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Rspack was initially created to solve performance problems encountered at ByteDa
- **Dev mode startup performance.** `npm run dev` is a command that developers may invoke many times per hour. Engineering productivity suffers if startup time exceeds 10-15 seconds.
- **Fast builds.** `npm run build` is used in CI/CD pipelines and directly impacts merging productivity and application delivery time. Large applications may spend 20-30 minutes running these pipelines, and bundling time is often a major contributor.
- **Flexible configuration.** From experimenting with various popular bundlers, we found that one-size-fits-all configurations encountered many problems when trying to accommodate real world projects. A major advantage of webpack is its flexibility and ease of accommodating customized requirements for each project. This in turn may pose steep migration costs for legacy projects that try to migrate away from webpack.
- **Production optimization capabilities.** All of the existing bundling solutions also had various limitations when optimizing for a production environment, such as insufficiently fine-grained package splitting, etc. Rspack was an opportunity to rethink these optimizations from the ground up, leveraging Rust-specific features such as multithreading.
- **Production optimization capabilities.** All of the existing bundling solutions also had various limitations when optimizing for a production environment, such as insufficiently fine-grained code splitting, etc. Rspack has an opportunity to rethink these optimizations from the ground up, leveraging Rust-specific features such as multithreading.

## Current status of Rspack

Expand All @@ -65,15 +65,15 @@ Currently, Rspack's cache support is relatively simple, only supporting memory-l

## The future of Rspack

Although Rspack already meets the needs of many projects, there are still some gaps to reach the full capabilities of webpack. Prioritization will be based on community feedback, so please tell us about your requirements!
Although Rspack already meets the needs of many projects, there are still some gaps to reach the full capabilities of webpack. Prioritization will be based on community feedback, so please tell us about your needs!

### Collaboration with community partners

We are very willing to provide support to framework teams and toolchains within the community to unleash the true performance advantages of Rspack. If your framework or toolchain has a demand for high-performance build engines, let us know!

### Enhancing plugin capabilities

Rspack already implements the basic `Loader` interface and a small number of webpack plugin APIs. Although our goal is not to achieve 100% compatibility for plugin APIs, we will try our best to implement the mainstream requirements based on community feedback. At the same time, we are also exploring higher-performance plugin communication solutions to reduce the cost of plugin communication, thereby ensuring more plugin APIs can be implemented.
Rspack already implements the full `Loader` interface and most of the webpack plugin APIs. Although our goal is not to achieve 100% compatibility for plugin APIs, we will try our best to implement the mainstream requirements based on community feedback. At the same time, we are also exploring higher-performance plugin communication solutions to reduce the cost of plugin communication, thereby ensuring more plugin APIs can be implemented.

### Continuously improving performance

Expand All @@ -87,21 +87,21 @@ Today Rspack is primarily tested using a subset of webpack's test cases. In the

[webpack](https://webpack.js.org/) is perhaps the most mature modern bundler, with an active ecosystem, flexible configuration, and rich features.

- **Rust language efficiency:** webpack's competitors frequently challenge it based on performance, especially for larger inputs. Rspack approaches this using the Rust platform, which was specifically designed to prioritize performance, topping benchmarks for both speed and memory management. Rust also provides many compiler safeguards to avoid common pitfalls of other native languages such as C++.
- **Rust language efficiency:** webpack's competitors frequently challenge it based on performance, especially for larger projects. Rspack solves this using the Rust language, which was specifically designed to prioritize performance, topping benchmarks for both speed and memory management. Rust also provides many compiler safeguards to avoid common pitfalls of other native languages such as C++.

- **Highly parallelized architecture:** webpack is limited by JavaScript's weak support for multithreading. By contrast, Rspack's native code takes full advantage of modern multi-core CPUs.

- **Built-in implementations of essential bundling features:** webpack's hook system famously enables a vast landscape of loaders and plugins contributed by the community. Unfortunately these third-party packages can frequently lead to performance bottlenecks, perhaps because the authors did not have deep knowledge of webpack internals, or simply because the hook system by nature limits interaction of algorithms. Rspack provides built-in implementations of key bundling features to improve performance.
- **Built-in implementations of essential bundling features:** webpack's hook system famously enables a vast landscape of loaders and plugins contributed by the community. Unfortunately these third-party packages can frequently lead to performance bottlenecks, perhaps because the authors did not have deep knowledge of webpack internals, or simply because the hook system by nature limits interaction of algorithms. Rspack provides built-in plugins for key features to improve performance.

- **Optimized Hot Module Replacement (HMR):** No matter how large your project is, ensuring a great experience for HMR places even steeper demands for build times than ordinary bundling. Rspack incorporates a specialized incremental compilation strategy to address this requirement.

## Compared with Vite

[Vite](https://vitejs.dev/) offers a great developer experience, but its reliance on [Rollup](https://rollupjs.org/) for production builds faces similar performance costs as other JavaScript-based algorithms. The same tradeoffs of webpack versus Rollup also apply, for example flexibility of the [optimization.splitChunks](/config/optimization#optimizationsplitchunks) feature.
[Vite](https://vitejs.dev/) offers a great developer experience, but its reliance on [Rollup](https://rollupjs.org/) for production builds faces similar performance costs as other JavaScript-based algorithms. The same tradeoffs of webpack versus Rollup also apply, for example missing flexibility of the [optimization.splitChunks](/config/optimization#optimizationsplitchunks) feature.

## Compared with esbuild

[esbuild](https://esbuild.github.io/) achieves very good performance by implementing nearly all operations in Golang except for some JavaScript plugins. However, esbuild's feature set is not as complete as webpack, for example with respect to JavaScript Hot Module Replacement (HMR) and incremental compilation, and also the [optimization.splitChunks](/config/optimization#optimizationsplitchunks) feature.
[esbuild](https://esbuild.github.io/) achieves very good performance by implementing nearly all operations in Golang except for some JavaScript plugins. However, esbuild's feature set is not as complete as webpack, for example missing HMR and [optimization.splitChunks](/config/optimization#optimizationsplitchunks) features.

## Compared with Turbopack

Expand Down
3 changes: 2 additions & 1 deletion website/docs/zh/guide/features/loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Loader 属于对资源的前处理,而 [Rule.type](/config/module#ruletype)

:::

目前 Rspack 已对大多数社区 loader 进行了支持,仅 [cache-loader](https://github.com/web-infra-dev/rspack/issues/6457) 等少数 loader 还未支持。如果你发现有不支持的 loader,欢迎通过 [GitHub Issues](https://github.com/web-infra-dev/rspack/issues) 与我们交流。
目前 Rspack 已经支持了社区几乎所有的 loader。如果你发现有不支持的 loader,欢迎通过 [GitHub Issues](https://github.com/web-infra-dev/rspack/issues) 与我们交流。

## 示例

Expand Down Expand Up @@ -144,3 +144,4 @@ module.exports = {
内置 Loader 在不损失 JS Loader 的可组合性的同时,提供了比 JS Loader 更优的性能。一些内置的 Loader 包括:

- [builtin:swc-loader](/guide/features/builtin-swc-loader)
- [builtin:lightningcss-loader](/guide/features/builtin-lightningcss-loader)
2 changes: 1 addition & 1 deletion website/docs/zh/guide/features/module-resolution.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 模块解析

模块解析指的是将模块标识符转换为模块的文件路径的过程。Rspack 使用 [nodejs_resolver](https://github.com/web-infra-dev/nodejs_resolver) 来进行模块路径解析,它是对 [node 模块解析算法](https://nodejs.org/api/modules.html#modules_all_together)的一个扩展,其接口和 [enhanced-resolve](https://github.com/webpack/enhanced-resolve) 保持一致,更多关于模块解析配置见 [解析配置](/config/resolve)。
模块解析指的是将模块标识符转换为模块的文件路径的过程。Rspack 使用 Rust 版本的 enhanced-resolve 来进行模块路径解析,它是对 [node 模块解析算法](https://nodejs.org/api/modules.html#modules_all_together)的一个扩展,其接口和 [enhanced-resolve](https://github.com/webpack/enhanced-resolve) 保持一致,请参考 [resolve 配置](/config/resolve) 了解更多关于模块解析的配置

## Rspack 中的解析规则

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/guide/start/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Rspack 作为一个底层依赖,解决了我们在工作中遇到的很多问

### 提升插件化能力

目前 Rspack 已经支持了基本的 Loader API 和少部分的 webpack Plugin API。webpack 有着海量的 Plugin API,虽然我们的目标**不是**实现 Plugin API 的 100% 兼容,但是我们会尽可能地实现社区主流需要的 Plugin API,以满足社区的需求。同时我们也在探索更高性能的插件通信方案,减小插件通信成本,以保证可以实现更多的插件 API。
目前 Rspack 已经支持了完整的 Loader API 和大部分的 webpack Plugin API。webpack 有着海量的 Plugin API,虽然我们的目标**不是**实现 Plugin API 的 100% 兼容,但是我们会尽可能地实现社区主流需要的 Plugin API,以满足社区的需求。同时我们也在探索更高性能的插件通信方案,减小插件通信成本,以保证可以实现更多的插件 API。

### 持续提升性能

Expand Down
Loading