Skip to content

Commit 9a36ace

Browse files
authored
Merge branch 'main' into jacek/sec-252-prototype-pollution-fix
2 parents ee76fdb + 7b03d2b commit 9a36ace

File tree

9 files changed

+886
-5
lines changed

9 files changed

+886
-5
lines changed

.changeset/tough-ravens-dance.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/upgrade': patch
3+
---
4+
5+
Add Vue-specific `transform-protect-to-show-vue` codemod that handles `.vue` SFC files with proper Vue v-bind syntax for the Protect to Show migration.

packages/ui/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
],
4949
"scripts": {
5050
"build": "pnpm build:umd && pnpm build:esm",
51-
"build:analyze": "rspack build --config rspack.config.js --env production --analyze",
51+
"build:analyze": "rspack build --config rspack.config.js --env production --env analyze --analyze",
5252
"build:esm": "tsdown",
53+
"build:rsdoctor": "RSDOCTOR=true rspack build --config rspack.config.js --env production",
5354
"build:umd": "rspack build --config rspack.config.js --env production",
5455
"bundlewatch": "FORCE_COLOR=1 bundlewatch --config bundlewatch.config.json",
5556
"bundlewatch:fix": "node bundlewatch-fix.mjs",
@@ -90,6 +91,7 @@
9091
},
9192
"devDependencies": {
9293
"@floating-ui/react-dom": "^2.1.6",
94+
"@rsdoctor/rspack-plugin": "^0.4.13",
9395
"@rspack/cli": "^1.6.0",
9496
"@rspack/core": "^1.6.0",
9597
"@rspack/plugin-react-refresh": "^1.5.2",

packages/ui/rspack.config.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'url';
66
import { createRequire } from 'module';
77
import { merge } from 'webpack-merge';
88
import ReactRefreshPlugin from '@rspack/plugin-react-refresh';
9+
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
910
import { svgLoader, typescriptLoaderProd, typescriptLoaderDev } from '../../scripts/rspack-common.js';
1011

1112
const require = createRequire(import.meta.url);
@@ -54,6 +55,14 @@ const common = ({ mode, variant }) => {
5455
new rspack.EnvironmentPlugin({
5556
NODE_ENV: mode,
5657
}),
58+
process.env.RSDOCTOR &&
59+
new RsdoctorRspackPlugin({
60+
mode: process.env.RSDOCTOR === 'brief' ? 'brief' : 'normal',
61+
disableClientServer: process.env.RSDOCTOR === 'brief',
62+
supports: {
63+
generateTileGraph: true,
64+
},
65+
}),
5766
].filter(Boolean),
5867
output: {
5968
chunkFilename: `[name]_ui_[fullhash:6]_${packageJSON.version}.js`,
@@ -179,10 +188,12 @@ const commonForProdBrowser = ({ targets = 'last 2 years', useCoreJs = false } =
179188

180189
/**
181190
* Production configuration - builds UMD browser variants
182-
* @param {'development'|'production'} mode
191+
* @param {object} config
192+
* @param {'development'|'production'} config.mode
193+
* @param {boolean} config.analysis
183194
* @returns {import('@rspack/core').Configuration[]}
184195
*/
185-
const prodConfig = mode => {
196+
const prodConfig = ({ mode, analysis }) => {
186197
// Browser bundle with chunks (UMD)
187198
const uiBrowser = merge(
188199
entryForVariant(variants.uiBrowser),
@@ -197,6 +208,11 @@ const prodConfig = mode => {
197208
commonForProdBrowser({ targets: packageJSON.browserslistLegacy, useCoreJs: true }),
198209
);
199210

211+
// webpack-bundle-analyzer only supports a single build, use uiBrowser as that's the default build we serve
212+
if (analysis) {
213+
return [uiBrowser];
214+
}
215+
200216
return [uiBrowser, uiLegacyBrowser];
201217
};
202218

@@ -247,5 +263,6 @@ const devConfig = (mode, env) => {
247263

248264
export default env => {
249265
const mode = env.production ? 'production' : 'development';
250-
return isProduction(mode) ? prodConfig(mode) : devConfig(mode, env);
266+
const analysis = !!env.analyze;
267+
return isProduction(mode) ? prodConfig({ mode, analysis }) : devConfig(mode, env);
251268
};

0 commit comments

Comments
 (0)