Skip to content

Commit e0f7ffb

Browse files
authored
deps(ui): Upgrade webpack dev server, terser (#69150)
1 parent a959af6 commit e0f7ffb

File tree

3 files changed

+801
-855
lines changed

3 files changed

+801
-855
lines changed

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@react-stately/tabs": "^3.6.3",
5151
"@react-stately/tree": "^3.7.5",
5252
"@react-types/shared": "^3.22.0",
53-
"@rsdoctor/webpack-plugin": "^0.1.0",
53+
"@rsdoctor/webpack-plugin": "^0.1.10",
5454
"@sentry-internal/global-search": "^0.5.7",
5555
"@sentry-internal/react-inspector": "6.0.1-4",
5656
"@sentry-internal/rrweb": "2.12.0",
@@ -92,7 +92,7 @@
9292
"@types/react-virtualized": "^9.21.22",
9393
"@types/reflux": "0.4.1",
9494
"@types/scroll-to-element": "^2.0.2",
95-
"@types/webpack-env": "^1.18.0",
95+
"@types/webpack-env": "^1.18.4",
9696
"ansi-to-react": "^6.1.6",
9797
"babel-loader": "^9.1.2",
9898
"babel-plugin-add-react-displayname": "^0.0.5",
@@ -101,7 +101,7 @@
101101
"cbor-web": "^8.1.0",
102102
"classnames": "2.3.1",
103103
"color": "^4.2.3",
104-
"compression-webpack-plugin": "11.0.0",
104+
"compression-webpack-plugin": "11.1.0",
105105
"copy-webpack-plugin": "^12.0.2",
106106
"core-js": "^3.33.0",
107107
"cronstrue": "^2.26.0",
@@ -169,15 +169,15 @@
169169
"typescript": "^5.4.5",
170170
"u2f-api": "1.0.10",
171171
"url-loader": "^4.1.1",
172-
"webpack": "5.90.1",
172+
"webpack": "5.91.0",
173173
"webpack-cli": "5.1.4",
174174
"webpack-remove-empty-scripts": "^1.0.4",
175175
"zxcvbn": "^4.4.2"
176176
},
177177
"devDependencies": {
178178
"@biomejs/biome": "^1.7.0",
179179
"@codecov/webpack-plugin": "^0.0.1-beta.6",
180-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
180+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
181181
"@sentry/jest-environment": "^4.0.0",
182182
"@sentry/profiling-node": "^7.109.0",
183183
"@styled/typescript-styled-plugin": "^1.0.1",
@@ -202,9 +202,9 @@
202202
"react-refresh": "0.14.0",
203203
"stylelint": "16.2.1",
204204
"stylelint-config-recommended": "^14.0.0",
205-
"terser": "5.27.0",
205+
"terser": "5.30.3",
206206
"tsconfig-paths": "^4.2.0",
207-
"webpack-dev-server": "^4.15.1"
207+
"webpack-dev-server": "5.0.4"
208208
},
209209
"optionalDependencies": {
210210
"fsevents": "^2.3.2"

webpack.config.ts

+43-26
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import fs from 'node:fs';
1313
import path from 'node:path';
1414
import TerserPlugin from 'terser-webpack-plugin';
1515
import webpack from 'webpack';
16-
import type {Configuration as DevServerConfig} from 'webpack-dev-server';
16+
import type {
17+
Configuration as DevServerConfig,
18+
ProxyConfigArray,
19+
Static,
20+
} from 'webpack-dev-server';
1721
import FixStyleOnlyEntriesPlugin from 'webpack-remove-empty-scripts';
1822

1923
import LastBuiltPlugin from './build-utils/last-built-plugin';
@@ -576,46 +580,59 @@ if (
576580

577581
// If we're running siloed servers we also need to proxy
578582
// those requests to the right server.
579-
let controlSiloProxy = {};
583+
let controlSiloProxy: ProxyConfigArray = [];
580584
if (CONTROL_SILO_PORT) {
581585
// TODO(hybridcloud) We also need to use this URL pattern
582586
// list to select control/region when making API requests in non-proxied
583587
// environments (like production). We'll likely need a way to consolidate this
584588
// with the configuration api.Client uses.
585589
const controlSiloAddress = `http://127.0.0.1:${CONTROL_SILO_PORT}`;
586-
controlSiloProxy = {
587-
'/auth/**': controlSiloAddress,
588-
'/account/**': controlSiloAddress,
589-
'/api/0/users/**': controlSiloAddress,
590-
'/api/0/api-tokens/**': controlSiloAddress,
591-
'/api/0/sentry-apps/**': controlSiloAddress,
592-
'/api/0/organizations/*/audit-logs/**': controlSiloAddress,
593-
'/api/0/organizations/*/broadcasts/**': controlSiloAddress,
594-
'/api/0/organizations/*/integrations/**': controlSiloAddress,
595-
'/api/0/organizations/*/config/integrations/**': controlSiloAddress,
596-
'/api/0/organizations/*/sentry-apps/**': controlSiloAddress,
597-
'/api/0/organizations/*/sentry-app-installations/**': controlSiloAddress,
598-
'/api/0/api-authorizations/**': controlSiloAddress,
599-
'/api/0/api-applications/**': controlSiloAddress,
600-
'/api/0/doc-integrations/**': controlSiloAddress,
601-
'/api/0/assistant/**': controlSiloAddress,
602-
};
590+
controlSiloProxy = [
591+
{
592+
context: [
593+
'/auth/**',
594+
'/account/**',
595+
'/api/0/users/**',
596+
'/api/0/api-tokens/**',
597+
'/api/0/sentry-apps/**',
598+
'/api/0/organizations/*/audit-logs/**',
599+
'/api/0/organizations/*/broadcasts/**',
600+
'/api/0/organizations/*/integrations/**',
601+
'/api/0/organizations/*/config/integrations/**',
602+
'/api/0/organizations/*/sentry-apps/**',
603+
'/api/0/organizations/*/sentry-app-installations/**',
604+
'/api/0/api-authorizations/**',
605+
'/api/0/api-applications/**',
606+
'/api/0/doc-integrations/**',
607+
'/api/0/assistant/**',
608+
],
609+
target: controlSiloAddress,
610+
},
611+
];
603612
}
604613

605614
appConfig.devServer = {
606615
...appConfig.devServer,
607616
static: {
608-
...(appConfig.devServer.static as object),
617+
...(appConfig.devServer.static as Static),
609618
publicPath: '/_static/dist/sentry',
610619
},
611620
// syntax for matching is using https://www.npmjs.com/package/micromatch
612-
proxy: {
621+
proxy: [
613622
...controlSiloProxy,
614-
'/api/store/**': relayAddress,
615-
'/api/{1..9}*({0..9})/**': relayAddress,
616-
'/api/0/relays/outcomes/': relayAddress,
617-
'!/_static/dist/sentry/**': backendAddress,
618-
},
623+
{
624+
context: [
625+
'/api/store/**',
626+
'/api/{1..9}*({0..9})/**',
627+
'/api/0/relays/outcomes/**',
628+
],
629+
target: relayAddress,
630+
},
631+
{
632+
context: ['!/_static/dist/sentry/**'],
633+
target: backendAddress,
634+
},
635+
],
619636
};
620637
appConfig.output!.publicPath = '/_static/dist/sentry/';
621638
}

0 commit comments

Comments
 (0)