Skip to content
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: 0 additions & 3 deletions packages/rspack/etc/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,6 @@ export type Experiments = {
asyncWebAssembly?: boolean;
outputModule?: boolean;
css?: boolean;
layers?: boolean;
incremental?: IncrementalPresets | Incremental;
futureDefaults?: boolean;
buildHttp?: HttpUriOptions;
Expand Down Expand Up @@ -2516,8 +2515,6 @@ export interface ExperimentsNormalized {
// @deprecated (undocumented)
inlineEnum?: boolean;
// @deprecated (undocumented)
layers?: boolean;
// @deprecated (undocumented)
lazyBarrel?: boolean;
// (undocumented)
nativeWatcher?: boolean;
Expand Down
9 changes: 0 additions & 9 deletions packages/rspack/src/config/normalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,6 @@ export const getNormalizedRspackOptions = (
performance: config.performance,
plugins: nestedArray(config.plugins, (p) => [...p]),
experiments: nestedConfig(config.experiments, (experiments) => {
if (experiments.layers) {
deprecate(
'`experiments.layers` config is deprecated and will be removed in Rspack v2.0. Feature layers will always be enabled. Remove this option from your Rspack configuration.',
);
}
if (experiments.lazyBarrel) {
deprecate(
'`experiments.lazyBarrel` config is deprecated and will be removed in Rspack v2.0. Lazy barrel is already stable and enabled by default. Remove this option from your Rspack configuration.',
Expand Down Expand Up @@ -669,10 +664,6 @@ export interface ExperimentsNormalized {
asyncWebAssembly?: boolean;
outputModule?: boolean;
css?: boolean;
/**
* @deprecated This option is deprecated, layers is enabled since v1.6.0
*/
layers?: boolean;
incremental?: false | Incremental;
futureDefaults?: boolean;
buildHttp?: HttpUriPluginOptions;
Expand Down
6 changes: 0 additions & 6 deletions packages/rspack/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2776,12 +2776,6 @@ export type Experiments = {
* - `module.generator["css/module"]`
*/
css?: boolean;
/**
* Enable module layers feature.
* @deprecated This option is deprecated, layers is enabled since v1.6.0
* @default false
*/
layers?: boolean;
/**
* Enable incremental builds.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module.exports = {
paid: { dependOn: "common", import: "./paid.js", layer: "paid" },
free: { dependOn: "common", import: "./free.js", layer: "free" }
},
experiments: {
layers: true
},
optimization: {
splitChunks: {
cacheGroups: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ module.exports = {
paid: { import: "./main.js", layer: "paid" },
free: { import: "./main.js", layer: "free" }
},
experiments: {
layers: true
},
optimization: {
splitChunks: {
cacheGroups: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ module.exports = {
__dirname: false,
__filename: false
},
experiments: {
layers: true
},
devtool: "source-map",
entry: {
main: {
Expand Down
25 changes: 0 additions & 25 deletions website/docs/en/config/deprecated-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,6 @@ This configuration has been deprecated. Use top-level [`collectTypeScriptInfo`](

:::

## experiments.layers

<ApiMeta deprecatedVersion="1.6.0" />

- **Type:** `boolean`
- **Default:** `true`

Controls whether to enable the layer feature. Layers add an identifier prefix to all modules in a subgraph starting from a module in the module graph, to distinguish them from modules in different layers. For example:

The `layer` of the `index.js` module is `null` by default, and its `identifier` is `./index.js`. If we set `layer = 'client'` for it, its `identifier` becomes `(client)/./index.js`. At this point, the `index.js` modules in these two different layers are treated as distinct modules, because their unique `identifier`s differ. The final output includes the artifacts of both modules.

By default, a module's layer is `null`, and it inherits its parent module's layer. You can add a layer to an entry module using `entryOptions.layer`, and add a layer to matched modules using [`module.rule[].layer`](/config/module-rules#ruleslayer). Additionally, you can match based on the parent module's layer using [`module.rule[].issuerLayer`](/config/module-rules#rulesissuerlayer).

```js title="rspack.config.mjs"
export default {
experiments: {
layers: true,
},
};
```

:::warning
This option is deprecated. Layers are now always enabled. Remove this option from your Rspack configuration.
:::

## experiments.parallelCodeSplitting

<ApiMeta deprecatedVersion="1.6.2" />
Expand Down
4 changes: 0 additions & 4 deletions website/docs/en/config/entry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ Specifies the layer in which modules of this entrypoint are placed. Make the cor

For more information about layers, see the [Layer guide](/guide/features/layer).

:::warning
For version before v1.6.0, this configuration will only take effect when [experiments.layers](/config/deprecated-options#experimentslayers) is `true`.
:::

```js title="rspack.config.mjs"
export default {
entry: {
Expand Down
8 changes: 0 additions & 8 deletions website/docs/en/config/module-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ Matches all modules that match this resource, and will match against layer of th

For more information about layers, see the [Layer guide](/guide/features/layer).

:::warning
For version before v1.6.0, this configuration will only work if [experiments.layers = true](/config/deprecated-options#experimentslayers).
:::

A basic example:

```js title="rspack.config.mjs"
Expand Down Expand Up @@ -643,10 +639,6 @@ Used to mark the layer of the matching module. A group of modules could be unite

For more information about layers, see the [Layer guide](/guide/features/layer).

:::warning
For version before v1.6.0, this configuration will only work if [experiments.layers = true](/config/deprecated-options#experimentslayers).
:::

```js title="rspack.config.mjs"
export default {
module: {
Expand Down
25 changes: 0 additions & 25 deletions website/docs/zh/config/deprecated-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,6 @@ import { ApiMeta } from '../../../components/ApiMeta';

:::

## experiments.layers

<ApiMeta deprecatedVersion="1.6.0" />

- **类型:** `boolean`
- **默认值:** `true`

控制是否启用 layer 功能,layer 可以为模块图中以一个模块作为起点的子图中的所有模块添加标识符前缀,用来与其他不同 layer 的模块进行区分,比如:

`index.js` 模块的 layer 为默认的 `null`,其 `identifier` 为 `./index.js`,我们为其添加 `layer = 'client'`,其 `identifier` 会变成 `(client)/./index.js`,这时这两个不同 layer 的 `index.js` 会被区分为不同的模块,因为其唯一标识 `identifier` 不一样,最终产物中也会存在这两个模块的产物。

模块默认的 layer 为 `null`,模块默认会继承其父模块的 layer,你可以通过 `entryOptions.layer` 为一个入口模块添加 layer,也可以通过 [`module.rule[].layer`](/config/module-rules#ruleslayer) 为匹配到的模块添加 layer,同时可以通过 [`module.rule[].issuerLayer`](/config/module-rules#rulesissuerlayer) 根据父模块的 layer 进行匹配。

```js title="rspack.config.mjs"
export default {
experiments: {
layers: true,
},
};
```

:::warning
该配置项已经废弃,layers 特性已始终开启,请从 Rspack 配置项中移除此配置。
:::

## experiments.parallelCodeSplitting

<ApiMeta deprecatedVersion="1.6.2" />
Expand Down
4 changes: 0 additions & 4 deletions website/docs/zh/config/entry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ export default {

更多关于 layer 的信息,请参考 [Layer 指南](/guide/features/layer)。

:::warning
对于 v1.6.0 之前的版本,只有在 [experiments.layers = true](/config/experiments#experimentslayers) 时该配置才会生效。
:::

```js title="rspack.config.mjs"
export default {
entry: {
Expand Down
8 changes: 0 additions & 8 deletions website/docs/zh/config/module-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ export default {

更多关于 layer 的信息,请参考 [Layer 指南](/guide/features/layer)。

:::warning
对于 v1.6.0 之前的版本,只有在 [experiments.layers = true](/config/experiments#experimentslayers) 时该配置才会生效。
:::

一个基础示例:

```js title="rspack.config.mjs"
Expand Down Expand Up @@ -642,10 +638,6 @@ export default {

更多关于 layer 的信息,请参考 [Layer 指南](/guide/features/layer)。

:::warning
对于 v1.6.0 之前的版本,只有在 [experiments.layers = true](/config/experiments#experimentslayers) 时该配置才会生效。
:::

```js title="rspack.config.mjs"
export default {
module: {
Expand Down
Loading