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(deps): bump rsbuild to 0.4.3 #5390

Merged
merged 6 commits into from
Feb 18, 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
7 changes: 7 additions & 0 deletions .changeset/pink-rings-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/uni-builder': patch
---

chore(deps): bump rsbuild 0.4.3

chore(deps): 升级 rsbuild 到 0.4.3
2 changes: 1 addition & 1 deletion packages/builder/builder-webpack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@modern-js/types": "workspace:*",
"@modern-js/utils": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@rsbuild/babel-preset": "0.4.0",
"@rsbuild/babel-preset": "0.4.3",
"@swc/helpers": "0.5.3",
"babel-plugin-import": "1.13.5",
"babel-plugin-styled-components": "1.13.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"dependencies": {
"@modern-js/builder-shared": "workspace:*",
"@modern-js/utils": "workspace:*",
"@rsbuild/monorepo-utils": "0.4.0",
"@rsbuild/monorepo-utils": "0.4.3",
"@svgr/webpack": "8.1.0",
"@swc/helpers": "0.5.3",
"deepmerge": "^4.3.1",
Expand Down
36 changes: 18 additions & 18 deletions packages/builder/uni-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@
"@modern-js/server": "workspace:*",
"@modern-js/prod-server": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@rsbuild/babel-preset": "0.4.0",
"@rsbuild/core": "0.4.0",
"@rsbuild/plugin-assets-retry": "0.4.0",
"@rsbuild/plugin-babel": "0.4.0",
"@rsbuild/plugin-check-syntax": "0.4.0",
"@rsbuild/plugin-css-minimizer": "0.4.0",
"@rsbuild/plugin-pug": "0.4.0",
"@rsbuild/plugin-react": "0.4.0",
"@rsbuild/plugin-rem": "0.4.0",
"@rsbuild/plugin-source-build": "0.4.0",
"@rsbuild/plugin-styled-components": "0.4.0",
"@rsbuild/plugin-svgr": "0.4.0",
"@rsbuild/plugin-type-check": "0.4.0",
"@rsbuild/plugin-toml": "0.4.0",
"@rsbuild/plugin-yaml": "0.4.0",
"@rsbuild/shared": "0.4.0",
"@rsbuild/webpack": "0.4.0",
"@rsbuild/babel-preset": "0.4.3",
"@rsbuild/core": "0.4.3",
"@rsbuild/plugin-assets-retry": "0.4.3",
"@rsbuild/plugin-babel": "0.4.3",
"@rsbuild/plugin-check-syntax": "0.4.3",
"@rsbuild/plugin-css-minimizer": "0.4.3",
"@rsbuild/plugin-pug": "0.4.3",
"@rsbuild/plugin-react": "0.4.3",
"@rsbuild/plugin-rem": "0.4.3",
"@rsbuild/plugin-source-build": "0.4.3",
"@rsbuild/plugin-styled-components": "0.4.3",
"@rsbuild/plugin-svgr": "0.4.3",
"@rsbuild/plugin-type-check": "0.4.3",
"@rsbuild/plugin-toml": "0.4.3",
"@rsbuild/plugin-yaml": "0.4.3",
"@rsbuild/shared": "0.4.3",
"@rsbuild/webpack": "0.4.3",
"@swc/helpers": "0.5.3",
"babel-loader": "9.1.3",
"babel-plugin-import": "1.13.5",
Expand All @@ -77,7 +77,7 @@
},
"devDependencies": {
"@modern-js/builder-plugin-node-polyfill": "workspace:*",
"@rsbuild/plugin-swc": "0.4.0",
"@rsbuild/plugin-swc": "0.4.3",
"@scripts/build": "workspace:*",
"@scripts/vitest-config": "workspace:*",
"@types/lodash": "^4.14.202",
Expand Down
9 changes: 9 additions & 0 deletions packages/builder/uni-builder/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ export type UniBuilderExtraConfig = {
*/
templateParametersByEntries?: Record<string, Record<string, unknown>>;
};
performance?: {
/**
* Specifies whether to modularize the import of [lodash](https://npmjs.com/package/lodash)
* and remove unused lodash modules to reduce the code size of lodash.
*
* Tips: this configuration is not yet supported in rspack
*/
transformLodash?: boolean;
};
security?: {
/**
* Adding an integrity attribute (`integrity`) to sub-resources introduced by HTML allows the browser to
Expand Down
11 changes: 8 additions & 3 deletions packages/builder/uni-builder/src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ export async function parseConfig(
);

rsbuildPlugins.push(
pluginBabel({
babelLoaderOptions: uniBuilderConfig.tools?.babel,
}),
pluginBabel(
{
babelLoaderOptions: uniBuilderConfig.tools?.babel,
},
{
transformLodash: uniBuilderConfig.performance?.transformLodash ?? true,
},
),
);
rsbuildPlugins.push(pluginReact());

Expand Down
12 changes: 7 additions & 5 deletions packages/builder/uni-builder/src/webpack/plugins/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export const getPresetReact = (rootPath: string, isProd: boolean) => {
return [require.resolve('@babel/preset-react'), presetReactOptions];
};

export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({
export const pluginBabel = (
options: PluginBabelOptions,
extraOptions: {
transformLodash: boolean;
},
): RsbuildPlugin => ({
name: 'uni-builder:babel',

post: [
Expand Down Expand Up @@ -102,10 +107,7 @@ export const pluginBabel = (options?: PluginBabelOptions): RsbuildPlugin => ({
});

applyPluginImport(baseBabelConfig, config.source.transformImport);
applyPluginLodash(
baseBabelConfig,
config.performance.transformLodash,
);
applyPluginLodash(baseBabelConfig, extraOptions.transformLodash);

baseBabelConfig.presets?.push(
getPresetReact(api.context.rootPath, isProd),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,36 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = `
"name": "HotModuleReplacementPlugin",
},
HtmlWebpackPlugin {
"options": {
"base": false,
"cache": true,
"chunks": [
"index",
],
"chunksSortMode": "auto",
"compile": true,
"entryName": "index",
"excludeChunks": [],
"favicon": false,
"filename": "html/index/index.html",
"hash": false,
"inject": "head",
"meta": {
"charset": {
"charset": "UTF-8",
},
"viewport": "width=device-width, initial-scale=1.0",
},
"minify": false,
"publicPath": "auto",
"scriptLoading": "defer",
"showErrors": true,
"template": "<WORKSPACE>/node_modules/<PNPM_INNER>/@rsbuild/core/static/template.html",
"templateContent": false,
"templateParameters": [Function],
"title": "",
"xhtml": false,
},
"userOptions": {
"chunks": [
"index",
Expand Down Expand Up @@ -936,7 +966,9 @@ exports[`uni-builder rspack > should generator rspack config correctly 1`] = `
"options": {
"exclude": /node_modules/i,
"forceEnable": false,
"include": /\\\\\\.\\(\\[cm\\]js\\|\\[jt\\]sx\\?\\|flow\\)\\$/i,
"include": [
/\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/,
],
},
},
],
Expand Down Expand Up @@ -1911,6 +1943,55 @@ exports[`uni-builder rspack > should generator rspack config correctly when prod
},
"plugins": [
HtmlWebpackPlugin {
"options": {
"base": false,
"cache": true,
"chunks": [
"index",
],
"chunksSortMode": "auto",
"compile": true,
"entryName": "index",
"excludeChunks": [],
"favicon": false,
"filename": "html/index/index.html",
"hash": false,
"inject": "head",
"meta": {
"charset": {
"charset": "UTF-8",
},
"viewport": "width=device-width, initial-scale=1.0",
},
"minify": {
"collapseWhitespace": true,
"keepClosingSlash": true,
"minifyCSS": true,
"minifyJS": {
"format": {
"ascii_only": true,
},
"mangle": {
"safari10": true,
},
},
"minifyURLs": true,
"removeComments": false,
"removeEmptyAttributes": true,
"removeRedundantAttributes": true,
"removeScriptTypeAttributes": true,
"removeStyleLinkTypeAttributes": true,
"useShortDoctype": true,
},
"publicPath": "auto",
"scriptLoading": "defer",
"showErrors": true,
"template": "<WORKSPACE>/node_modules/<PNPM_INNER>/@rsbuild/core/static/template.html",
"templateContent": false,
"templateParameters": [Function],
"title": "",
"xhtml": false,
},
"userOptions": {
"chunks": [
"index",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/plugin-swc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test": "jest"
},
"dependencies": {
"@rsbuild/plugin-swc": "0.4.0",
"@rsbuild/plugin-swc": "0.4.3",
"@modern-js/utils": "workspace:*",
"@swc/helpers": "0.5.3"
},
Expand Down
7 changes: 6 additions & 1 deletion packages/cli/plugin-swc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export function factory(
isSSR(config),
);

context.builder.addPlugins([pluginSwc(finalConfig)]);
context.builder.addPlugins([
pluginSwc({
...finalConfig,
transformLodash: config.performance.transformLodash ?? true,
}),
]);
},
}),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/themes": "^2.0.0",
"@rsbuild/core": "0.4.0",
"@rsbuild/core": "0.4.3",
"@types/jest": "^29",
"@types/lodash": "^4.14.202",
"@types/node": "~16.11.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/review/eslint-config-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@babel/core": "^7.23.2",
"@babel/eslint-parser": "^7.22.15",
"@babel/eslint-plugin": "^7.22.10",
"@rsbuild/babel-preset": "0.4.0",
"@rsbuild/babel-preset": "0.4.3",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"eslint": "^8.28.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/plugin-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"@modern-js/plugin": "workspace:*",
"@modern-js/prod-server": "workspace:*",
"@modern-js/types": "workspace:*",
"@rsbuild/babel-preset": "0.4.0",
"@rsbuild/babel-preset": "0.4.3",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^13.4.0",
"@types/testing-library__jest-dom": "^5.14.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"axios": "^1.6.0"
},
"devDependencies": {
"@rsbuild/shared": "0.4.0",
"@rsbuild/shared": "0.4.3",
"@modern-js/server-core": "workspace:*",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@modern-js/babel-compiler": "workspace:*",
"@modern-js/utils": "workspace:*",
"@modern-js/babel-plugin-module-resolver": "workspace:*",
"@rsbuild/babel-preset": "0.4.0",
"@rsbuild/babel-preset": "0.4.3",
"@swc/helpers": "0.5.3",
"babel-plugin-transform-typescript-metadata": "^0.3.2"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/solutions/app-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@
"@modern-js/types": "workspace:*",
"@modern-js/upgrade": "workspace:*",
"@modern-js/utils": "workspace:*",
"@rsbuild/plugin-esbuild": "0.4.0",
"@rsbuild/plugin-node-polyfill": "0.4.0",
"@rsbuild/shared": "0.4.0",
"@rsbuild/plugin-esbuild": "0.4.3",
"@rsbuild/plugin-node-polyfill": "0.4.3",
"@rsbuild/shared": "0.4.3",
"es-module-lexer": "^1.1.0",
"esbuild": "0.17.19",
"@swc/helpers": "0.5.3",
"@modern-js/server-core": "workspace:*"
},
"devDependencies": {
"@rsbuild/plugin-swc": "0.4.0",
"@rsbuild/plugin-swc": "0.4.3",
"@scripts/build": "workspace:*",
"@scripts/jest-config": "workspace:*",
"@types/babel__traverse": "7.18.5",
Expand Down
Loading
Loading