From 8b0fce0997d0b44a7cb2c8cc9fbdafbb8315b0f0 Mon Sep 17 00:00:00 2001 From: hardfist Date: Tue, 13 Aug 2024 20:04:56 +0800 Subject: [PATCH] docs: update glossary --- .../docs/en/api/loader-api/rspack-specific-properties.mdx | 2 +- website/docs/en/misc/glossary.mdx | 4 ++++ .../docs/zh/api/loader-api/rspack-specific-properties.mdx | 2 +- website/docs/zh/misc/glossary.mdx | 6 +++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/website/docs/en/api/loader-api/rspack-specific-properties.mdx b/website/docs/en/api/loader-api/rspack-specific-properties.mdx index 03e19c057ca..7b26a3edf47 100644 --- a/website/docs/en/api/loader-api/rspack-specific-properties.mdx +++ b/website/docs/en/api/loader-api/rspack-specific-properties.mdx @@ -4,7 +4,7 @@ import WebpackLicense from '@components/WebpackLicense'; -# 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. diff --git a/website/docs/en/misc/glossary.mdx b/website/docs/en/misc/glossary.mdx index e08546ef486..836a6e375f8 100644 --- a/website/docs/en/misc/glossary.mdx +++ b/website/docs/en/misc/glossary.mdx @@ -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. diff --git a/website/docs/zh/api/loader-api/rspack-specific-properties.mdx b/website/docs/zh/api/loader-api/rspack-specific-properties.mdx index 332a4983e07..4dc66cdb0c8 100644 --- a/website/docs/zh/api/loader-api/rspack-specific-properties.mdx +++ b/website/docs/zh/api/loader-api/rspack-specific-properties.mdx @@ -4,7 +4,7 @@ import WebpackLicense from '@components/WebpackLicense'; -# Rspack 特有属性 +# 编译器特定属性 Loader API 提供了所有模块相关的信息。然而,在极少数情况下,你可能需要访问编译器 API 本身。 diff --git a/website/docs/zh/misc/glossary.mdx b/website/docs/zh/misc/glossary.mdx index 3ad1727fad5..2bdf2f983a3 100644 --- a/website/docs/zh/misc/glossary.mdx +++ b/website/docs/zh/misc/glossary.mdx @@ -58,6 +58,10 @@ Loader 是用来转换模块内容的。例如,我们可以使用 loader 将 T 插件可以用来扩展 Rspack 的功能。它可以用来定制构建过程,或与其他工具集成。Rspack 提供了很多钩子,你可以用它们来定制构建过程。 -## tree shaking +## scope hoisting (作用域合并) + +作用域提升是一种将多个模块作用域进行合并的技术,它在可能的情况下将多个模块合并到一个单一的作用域中,而不是将每个模块包装在单独的函数中。这样对代码压缩更友好,并可以通过减少模块查找成本来提高运行时性能。 + +## tree shaking (摇树优化) Tree shaking 是一种允许你从包中删除未使用代码的技术。它是一种特殊的死代码优化方式。像 Rspack 这样的编译器将通过分析代码的静态语法,然后删除未使用的代码来完成此操作。