Skip to content

Commit 72a544f

Browse files
authored
docs: update examples and terminology (#11374)
docs: update examples and terminlogy
1 parent 28859a4 commit 72a544f

File tree

19 files changed

+49
-43
lines changed

19 files changed

+49
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Come chat with us on [Discord](https://discord.gg/79ZZ66GH9E)! Rspack team and R
7878
| [rspack-dev-server](https://github.com/web-infra-dev/rspack-dev-server) | Dev server for Rspack |
7979
| [rstack-examples](https://github.com/rspack-contrib/rstack-examples) | Examples showcasing Rstack |
8080
| [rspack-sources](https://github.com/web-infra-dev/rspack-sources) | Rust port of [webpack-sources](https://www.npmjs.com/package/webpack-sources) |
81-
| [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources) | Design resources for Rspack Stack |
81+
| [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources) | Design resources for Rstack |
8282

8383
## Contributors
8484

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Rstack 是一个围绕 Rspack 打造的 JavaScript 统一工具链,具有优
7373
| [rspack-dev-server](https://github.com/web-infra-dev/rspack-dev-server) | Rspack 的开发服务器 |
7474
| [rstack-examples](https://github.com/rspack-contrib/rstack-examples) | Rstack 的示例项目 |
7575
| [rspack-sources](https://github.com/web-infra-dev/rspack-sources) | Rust 版本的 [webpack-sources](https://www.npmjs.com/package/webpack-sources) |
76-
| [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources) | Rspack Stack 的设计资源 |
76+
| [rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources) | Rstack 的设计资源 |
7777

7878
## 致谢
7979

website/docs/en/api/javascript-api/compilation.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The following code will add a new asset named `asset-name.js` and will not be co
6666

6767
```js
6868
compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
69-
const { RawSource } = compiler.webpack.sources;
69+
const { RawSource } = compiler.rspack.sources;
7070
compilation.hooks.processAssets.tap('MyPlugin', () => {
7171
const buffer = Buffer.from(
7272
'i am content of emit asset, do not minimize me',
@@ -114,7 +114,7 @@ The following code replaces the content of `main.js` and not to minimize it:
114114

115115
```js
116116
compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
117-
const { RawSource } = compiler.webpack.sources;
117+
const { RawSource } = compiler.rspack.sources;
118118
compilation.hooks.processAssets.tap('MyPlugin', () => {
119119
const updatedSource = new RawSource(
120120
`module.exports = "This is the updated"`,
@@ -415,7 +415,7 @@ compiler.hooks.make.tap('MyPlugin', compilation => {
415415
{
416416
path: 'dist/child',
417417
},
418-
[new compiler.webpack.EntryPlugin(compiler.context, './child-entry.js')],
418+
[new compiler.rspack.EntryPlugin(compiler.context, './child-entry.js')],
419419
);
420420
childCompiler.compile((err, childCompilation) => {});
421421
});
@@ -452,7 +452,7 @@ export default {
452452
plugins: [
453453
{
454454
apply(compiler) {
455-
const { RuntimeModule } = compiler.webpack;
455+
const { RuntimeModule } = compiler.rspack;
456456

457457
class CustomRuntimeModule extends RuntimeModule {
458458
constructor() {

website/docs/en/api/plugin-api/compilation-hooks.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ export default {
578578
plugins: [
579579
{
580580
apply(compiler) {
581-
const { RuntimeGlobals } = compiler.webpack;
581+
const { RuntimeGlobals } = compiler.rspack;
582582
compiler.hooks.thisCompilation.tap('CustomPlugin', compilation => {
583583
compilation.hooks.additionalTreeRuntimeRequirements.tap(
584584
'CustomPlugin',
@@ -618,7 +618,7 @@ export default {
618618
plugins: [
619619
{
620620
apply(compiler) {
621-
const { RuntimeGlobals, RuntimeModule } = compiler.webpack;
621+
const { RuntimeGlobals, RuntimeModule } = compiler.rspack;
622622
class CustomRuntimeModule extends RuntimeModule {
623623
constructor() {
624624
super('custom');
@@ -670,7 +670,7 @@ export default {
670670
plugins: [
671671
{
672672
apply(compiler) {
673-
const { RuntimeGlobals } = compiler.webpack;
673+
const { RuntimeGlobals } = compiler.rspack;
674674
compiler.hooks.compilation.tap('CustomPlugin', compilation => {
675675
compilation.hooks.runtimeModule.tap(
676676
'CustomPlugin',
@@ -733,14 +733,14 @@ Process the assets before emit.
733733

734734
```js
735735
compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
736-
const { Compilation } = compiler.webpack;
736+
const { Compilation } = compiler.rspack;
737737
compilation.hooks.processAssets.tap(
738738
{
739739
name: 'MyPlugin',
740740
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
741741
},
742742
assets => {
743-
const { RawSource } = compiler.webpack.sources;
743+
const { RawSource } = compiler.rspack.sources;
744744
const source = new RawSource('This is a new asset!');
745745
compilation.emitAsset('new-asset.txt', source);
746746
},
@@ -752,7 +752,7 @@ compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
752752

753753
```js
754754
compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
755-
const { Compilation } = compiler.webpack;
755+
const { Compilation } = compiler.rspack;
756756
compilation.hooks.processAssets.tap(
757757
{
758758
name: 'MyPlugin',
@@ -764,7 +764,7 @@ compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
764764
return;
765765
}
766766

767-
const { RawSource } = compiler.webpack.sources;
767+
const { RawSource } = compiler.rspack.sources;
768768
const oldContent = asset.source();
769769
const newContent = oldContent + '\nconsole.log("hello world!")';
770770
const source = new RawSource(newContent);
@@ -779,7 +779,7 @@ compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
779779

780780
```js
781781
compiler.hooks.thisCompilation.tap('MyPlugin', compilation => {
782-
const { Compilation } = compiler.webpack;
782+
const { Compilation } = compiler.rspack;
783783
compilation.hooks.processAssets.tap(
784784
{
785785
name: 'MyPlugin',

website/docs/en/api/plugin-api/runtime-plugin-hooks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
plugins: [
1414
{
1515
apply: compiler => {
16-
const { RuntimePlugin } = compiler.webpack;
16+
const { RuntimePlugin } = compiler.rspack;
1717
compiler.hooks.compilation.tap('MyPlugin', compilation => {
1818
const hooks = RuntimePlugin.getCompilationHooks(compilation);
1919
//...

website/docs/en/blog/announcing-0-5.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class CustomDevServer {
233233
enableHMR(compiler) {
234234
- compiler.options.devServer ??= {};
235235
- compiler.options.devServer.hot = true;
236-
+ new compiler.webpack.HotModuleReplacementPlugin().apply(compiler);
236+
+ new compiler.rspack.HotModuleReplacementPlugin().apply(compiler);
237237
}
238238
}
239239
```
@@ -255,7 +255,7 @@ function prependEntry(compiler, additionalEntry) {
255255
- ...(compiler.options.entry[key].import || []),
256256
- ];
257257
- }
258-
+ new compiler.webpack.EntryPlugin(compiler.context, additionalEntry, {
258+
+ new compiler.rspack.EntryPlugin(compiler.context, additionalEntry, {
259259
+ name: undefined, // `name: undefined` to prepend the it to every entry, or add it to a specified entry with specified entry name
260260
+ }).apply(compiler);
261261
}

website/docs/en/blog/announcing-1-0.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ The current goals of Rspack are:
8989
- Rspack is not just suitable for environments like browser and Node.js that we are familiar with; its goal is to cover all environments where JavaScript runs. This means that Rspack can easily support Deno, Electron, cross-platform applications, MiniApps, and any other JavaScript runtime.
9090
- We found that balancing "flexibility" and "out-of-the-box" in a single tool was a challenging task. Therefore, after open-sourcing Rspack, we developed a set of Rstack toolchains, including projects such as Rsbuild, Rspress, Rsdoctor, and Rslib, each targeting different use cases. For example, to reduce the complexity and high barriers to configuring Rspack, we provide Rsbuild for an out-of-the-box development experience.
9191

92-
### Rspack stack
92+
### Rstack
9393

94-
![Rspack Stack](https://assets.rspack.rs/rspack/assets/rspack-v1-0-rstack.png)
94+
![Rstack](https://assets.rspack.rs/rspack/assets/rspack-v1-0-rstack.png)
9595

9696
Rstack is short for "Rspack Stack" and stands for the tech stack built around Rspack. It consists of the following tools:
9797

website/docs/en/config/lazy-compilation.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import WebpackLicense from '@components/WebpackLicense';
2+
import { ApiMeta } from '@components/ApiMeta';
23

34
<WebpackLicense from="https://webpack.js.org/configuration/experiments/#experimentslazycompilation" />
45

56
# LazyCompilation
67

8+
<ApiMeta addedVersion="1.5.0" />
9+
710
Lazy Compilation is an optimization technique that delays the compilation of modules until they are actually requested. **Modules are only built when they are actually accessed.**
811

912
Enable lazy compilation, which can greatly improve the dev startup performance of multi-page applications (MPA) or large single-page applications (SPA).

website/docs/en/guide/start/quick-start.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Next, see [Configure Rspack](/config/index) to learn about how to configure Rspa
111111

112112
## Migrating from existing projects
113113

114-
If you need to migrate from an existing project to Rspack stack, you can refer to the following guides:
114+
If you need to migrate from an existing project to Rspack, you can refer to the following guides:
115115

116116
- [Migrating from webpack to Rspack](/guide/migration/webpack)
117117
- [Migrating from webpack to Rsbuild](https://rsbuild.rs/guide/migration/webpack)

website/docs/en/misc/team/core-team.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { RandomMemberList } from '@components/RandomMemberList.tsx';
22

33
# Core team
44

5-
The development of Rspack stack is led by ByteDance's web infra team and driven together with community contributors on several core projects, including [Rspack](https://github.com/web-infra-dev/rspack), [Rsbuild](https://github.com/web-infra-dev/rsbuild), [Rspress](https://github.com/web-infra-dev/rspress), [Rsdoctor](https://github.com/web-infra-dev/rsdoctor), [Rslib](https://github.com/web-infra-dev/rslib), [Rstest](https://github.com/web-infra-dev/rstest) and [Rslint](https://github.com/web-infra-dev/rslint).
5+
The development of Rstack is led by ByteDance's web infra team and driven together with community contributors on several core projects, including [Rspack](https://github.com/web-infra-dev/rspack), [Rsbuild](https://github.com/web-infra-dev/rsbuild), [Rspress](https://github.com/web-infra-dev/rspress), [Rsdoctor](https://github.com/web-infra-dev/rsdoctor), [Rslib](https://github.com/web-infra-dev/rslib), [Rstest](https://github.com/web-infra-dev/rstest) and [Rslint](https://github.com/web-infra-dev/rslint).
66

7-
Current members of the Rspack team are listed in random order below.
7+
Current members of the Rstack team are listed in random order below.
88

99
## Members
1010

0 commit comments

Comments
 (0)