Skip to content

Commit

Permalink
docs: update glossary
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Aug 13, 2024
1 parent 91a9a3e commit 8b0fce0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import WebpackLicense from '@components/WebpackLicense';

<WebpackLicense from="https://webpack.js.org/api/loaders/#webpack-specific-properties" />

# Rspack specific properties
# Compiler internal specific properties

The loader interface provides all module relate information. However in rare cases you might need access to the compiler api itself.

Expand Down
4 changes: 4 additions & 0 deletions website/docs/en/misc/glossary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ The module graph is a graph data structure that represents relationships between

A plugin is a program module that can be used to extend the functionality of Rspack by means of extensibility hooks. It can be used to customize the build process, or to integrate with other tools. Rspack provides lots of hooks which you can use to customize the build process.

## scope hoisting

Scope hoisting is a technique that concat modules into a single scope when possible, rather than wrapping each module in a separate function. It can make minification more effective and improve runtime performance by reduce module lookup cost.

## tree shaking

Tree shaking is a technique that allows you to remove unused code from your bundle. It a form of compiler dead code elimination, with a focus on minimizing processing of dead code. Compilers like Rspack will accomplish this by analyzing the static structure of your code, and then removing the unused code.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import WebpackLicense from '@components/WebpackLicense';

<WebpackLicense from="https://webpack.docschina.org/api/loaders/#webpack-specific-properties" />

# Rspack 特有属性
# 编译器特定属性

Loader API 提供了所有模块相关的信息。然而,在极少数情况下,你可能需要访问编译器 API 本身。

Expand Down
6 changes: 5 additions & 1 deletion website/docs/zh/misc/glossary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Loader 是用来转换模块内容的。例如,我们可以使用 loader 将 T

插件可以用来扩展 Rspack 的功能。它可以用来定制构建过程,或与其他工具集成。Rspack 提供了很多钩子,你可以用它们来定制构建过程。

## tree shaking
## scope hoisting (作用域合并)

作用域提升是一种将多个模块作用域进行合并的技术,它在可能的情况下将多个模块合并到一个单一的作用域中,而不是将每个模块包装在单独的函数中。这样对代码压缩更友好,并可以通过减少模块查找成本来提高运行时性能。

## tree shaking (摇树优化)

Tree shaking 是一种允许你从包中删除未使用代码的技术。它是一种特殊的死代码优化方式。像 Rspack 这样的编译器将通过分析代码的静态语法,然后删除未使用的代码来完成此操作。

0 comments on commit 8b0fce0

Please sign in to comment.