Skip to content
Closed
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
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ setup-pyenv:

build-js-po: node-version-check
mkdir -p build
rm -rf node_modules/.cache/babel-loader
SENTRY_EXTRACT_TRANSLATIONS=1 $(WEBPACK)

build-spectacular-docs:
Expand Down
4 changes: 2 additions & 2 deletions build-utils/last-built-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import fs from 'fs';
import path from 'path';

import webpack from 'webpack';
import type {Compiler} from '@rspack/core';

type Options = {
basePath: string;
Expand All @@ -19,7 +19,7 @@ class LastBuiltPlugin {
this.isWatchMode = false;
}

apply(compiler: webpack.Compiler) {
apply(compiler: Compiler) {
compiler.hooks.watchRun.tapAsync('LastBuiltPlugin', (_, callback) => {
this.isWatchMode = true;
callback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
import childProcess from 'child_process';
import path from 'path';

import webpack from 'webpack';
import type {Configuration, RuleSetRule} from '@rspack/core';
import rspack from '@rspack/core';

import baseConfig from '../webpack.config';
import baseConfig from '../rspack.config';

const commitHash =
process.env.SENTRY_BUILD ||
childProcess.execSync('git rev-parse HEAD').toString().trim();
childProcess.execSync('git rev-parse HEAD', {encoding: 'utf8'}).trim();

// @ts-ignore
const findLoader = (loaderName: string) =>
baseConfig.module?.rules?.find(
rule =>
rule &&
typeof rule === 'object' &&
typeof rule.use === 'object' &&
!Array.isArray(rule.use) &&
rule.use.loader === loaderName
) as webpack.RuleSetRule;
(rule.loader === loaderName || rule.use?.loader === loaderName)
) as RuleSetRule;

const config: webpack.Configuration = {
export default {
mode: baseConfig.mode,
context: baseConfig.context,
resolve: baseConfig.resolve,
Expand All @@ -33,13 +33,12 @@ const config: webpack.Configuration = {
},

module: {
rules: [findLoader('babel-loader'), findLoader('po-catalog-loader')],
noParse: baseConfig.module?.noParse,
rules: [findLoader('builtin:swc-loader'), findLoader('po-catalog-loader')],
},

plugins: [
new webpack.DefinePlugin({
'process.env': {COMMIT_SHA: JSON.stringify(commitHash)},
new rspack.DefinePlugin({
'process.env.COMMIT_SHA': JSON.stringify(commitHash),
}),
],

Expand All @@ -49,6 +48,4 @@ const config: webpack.Configuration = {
},

optimization: {minimize: false},
};

module.exports = config;
} as Configuration;
31 changes: 11 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"url": "git://github.com/getsentry/sentry.git"
},
"dependencies": {
"@acemarke/react-prod-sourcemaps": "^0.2.1",
"@babel/core": "~7.23.2",
"@babel/plugin-transform-react-jsx": "^7.22.15",
"@babel/plugin-transform-react-jsx-source": "^7.22.5",
Expand Down Expand Up @@ -49,6 +48,9 @@
"@react-stately/tabs": "^3.4.1",
"@react-stately/tree": "^3.6.1",
"@react-types/shared": "^3.18.1",
"@rspack/cli": "^0.4.2",
"@rspack/core": "^0.4.2",
"@rspack/plugin-react-refresh": "^0.4.2",
"@sentry-internal/global-search": "^0.5.7",
"@sentry-internal/react-inspector": "6.0.1-4",
"@sentry-internal/rrweb": "2.3.0",
Expand Down Expand Up @@ -91,29 +93,24 @@
"@types/scroll-to-element": "^2.0.2",
"@types/webpack-env": "^1.18.0",
"ansi-to-react": "^6.1.6",
"babel-loader": "^9.1.2",
"babel-plugin-add-react-displayname": "^0.0.5",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"buffer": "^6.0.3",
"cbor-web": "^8.1.0",
"classnames": "2.3.1",
"color": "^4.2.3",
"compression-webpack-plugin": "10.0.0",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.33.0",
"cronstrue": "^2.26.0",
"crypto-browserify": "^3.12.0",
"crypto-js": "4.2.0",
"css-loader": "^5.2.6",
"css-minimizer-webpack-plugin": "^4.2.2",
"diff": "5.1.0",
"dompurify": "^3.0.0",
"downsample": "1.4.0",
"echarts": "5.4.0",
"echarts-for-react": "3.0.2",
"focus-trap": "^7.3.1",
"focus-visible": "^5.2.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"framer-motion": "^6.2.8",
"fuse.js": "^6.6.2",
"gettext-parser": "1.3.1",
Expand All @@ -128,7 +125,6 @@
"less-loader": "^11.1.0",
"lodash": "^4.17.19",
"marked": "0.7.0",
"mini-css-extract-plugin": "^2.7.2",
"mobx": "^6.8.0",
"mobx-react": "~7.6.0",
"mockdate": "3.0.5",
Expand Down Expand Up @@ -162,20 +158,15 @@
"screenfull": "^6.0.2",
"scroll-to-element": "^2.0.0",
"sprintf-js": "1.0.3",
"style-loader": "^3.3.1",
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"typescript": "^5.3.2",
"u2f-api": "1.0.10",
"url-loader": "^4.1.0",
"webpack": "5.87.0",
"webpack-cli": "5.1.4",
"webpack-hook-plugin": "^1.0.7",
"webpack-remove-empty-scripts": "^1.0.3",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@sentry/jest-environment": "^4.0.0",
"@sentry/profiling-node": "^1.2.1",
"@styled/typescript-styled-plugin": "^1.0.0",
Expand All @@ -184,7 +175,6 @@
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^18.14.0",
"babel-gettext-extractor": "^4.1.3",
"babel-jest": "^29.6.2",
"babel-plugin-dynamic-import-node": "^2.3.3",
"benchmark": "^2.1.4",
Expand Down Expand Up @@ -225,17 +215,18 @@
"lint": "yarn eslint static/app tests/js --ext .js,.jsx,.ts,.tsx",
"lint:css": "yarn stylelint 'static/app/**/*.[jt]sx'",
"dev": "(yarn check --verify-tree || yarn install --check-files) && sentry devserver",
"dev-ui": "SENTRY_UI_DEV_ONLY=1 SENTRY_WEBPACK_PROXY_PORT=7999 yarn webpack serve",
"dev-acceptance": "NO_DEV_SERVER=1 NODE_ENV=development yarn webpack --watch",
"webpack-profile": "NO_TS_FORK=1 yarn -s webpack --profile --json > stats.json",
"dev-ui": "SENTRY_UI_DEV_ONLY=1 SENTRY_WEBPACK_PROXY_PORT=7999 yarn rspack serve",
"dev-acceptance": "NO_DEV_SERVER=1 NODE_ENV=development yarn rspack --watch",
"webpack-profile": "NO_TS_FORK=1 yarn -s rspack build --json stats.json",
"install-api-docs": "cd api-docs && yarn install",
"build-deprecated-docs": "yarn install-api-docs && ts-node api-docs/index.ts api-docs/openapi.json tests/apidocs/openapi-deprecated.json",
"diff-docs": "yarn install-api-docs && ts-node api-docs/openapi-diff.ts",
"deref-api-docs": "ts-node api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
"build-chartcuterie-config": "NODE_ENV=production yarn webpack --config=config/webpack.chartcuterie.config.ts",
"build-acceptance": "IS_ACCEPTANCE_TEST=1 NODE_ENV=production yarn webpack",
"build-production": "NODE_ENV=production yarn webpack --mode production",
"build": "NODE_OPTIONS=--max-old-space-size=4096 yarn webpack",
"build-chartcuterie-config": "NODE_ENV=production yarn rspack --config=config/rspack.chartcuterie.config.ts",
"build-acceptance": "IS_ACCEPTANCE_TEST=1 NODE_ENV=production yarn rspack build",
"build-production": "NODE_ENV=production yarn rspack --mode production",
"build": "NODE_OPTIONS=--max-old-space-size=4096 yarn rspack build",
"build-analyze": "yarn rspack build --analyze",
"build-js-loader": "ts-node scripts/build-js-loader.ts",
"validate-api-examples": "cd api-docs && yarn openapi-examples-validator ../tests/apidocs/openapi-derefed.json --no-additional-properties",
"mkcert-localhost": "mkcert -key-file config/localhost-key.pem -cert-file config/localhost.pem localhost 127.0.0.1 dev.getsentry.net *.dev.getsentry.net && mkcert -install"
Expand Down
Loading