Skip to content

Commit 9b2f4b0

Browse files
committed
feat!: Remove support for Node < v18
1 parent 1176013 commit 9b2f4b0

File tree

50 files changed

+374
-2278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+374
-2278
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,7 @@ jobs:
131131
strategy:
132132
fail-fast: false
133133
matrix:
134-
node-version: [
135-
# nx uses a `yargs-parser` versision which isn't compatible with node 10
136-
# "10.24.1",
137-
# vite uses optional chaining which isn't compatible with node 12
138-
# "12.22.12",
139-
"14",
140-
"16",
141-
"18",
142-
"20",
143-
"22",
144-
]
134+
node-version: ["18", "20", "22"]
145135
os: [ubuntu-latest, windows-latest]
146136
runs-on: ${{ matrix.os }}
147137
steps:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Sentry Bundler Plugins
88

9-
Sentry plugins for various JavaScript bundlers. Currently supporting Rollup, Vite, esbuild, Webpack 4 and Webpack 5.
9+
Sentry plugins for various JavaScript bundlers. Currently supporting Rollup, Vite, esbuild, Webpack 5.
1010

1111
Check out the individual packages for more information and examples:
1212

packages/e2e-tests/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@types/axios": "^0.14.0",
2929
"@types/glob": "8.0.0",
3030
"@types/jest": "^28.1.3",
31-
"@types/webpack4": "npm:@types/webpack@^4",
3231
"esbuild": "0.14.49",
3332
"eslint": "^8.18.0",
3433
"glob": "8.0.3",
@@ -37,8 +36,7 @@
3736
"rollup": "3.2.0",
3837
"ts-node": "^10.9.1",
3938
"vite": "3.0.0",
40-
"webpack4": "npm:webpack@^4",
41-
"webpack5": "npm:webpack@5.74.0"
39+
"webpack": "5.74.0"
4240
},
4341
"volta": {
4442
"extends": "../../package.json"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const BUNDLERS = ["rollup", "vite", "esbuild", "webpack4", "webpack5"];
1+
export const BUNDLERS = ["rollup", "vite", "esbuild", "webpack"];

packages/e2e-tests/utils/create-cjs-bundles.ts

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as vite from "vite";
22
import * as path from "path";
33
import * as rollup from "rollup";
4-
import { default as webpack4 } from "webpack4";
5-
import { webpack as webpack5 } from "webpack5";
4+
import { webpack } from "webpack";
65
import * as esbuild from "esbuild";
76

87
import type { Options } from "@sentry/bundler-plugin-core";
@@ -91,43 +90,13 @@ export function createCjsBundles(
9190
format: "cjs",
9291
});
9392

94-
webpack4(
95-
{
96-
devtool: "source-map",
97-
mode: "production",
98-
entry: entrypoints,
99-
cache: false,
100-
output: {
101-
path: path.join(outFolder, "webpack4"),
102-
libraryTarget: "commonjs",
103-
},
104-
target: "node", // needed for webpack 4 so we can access node api
105-
plugins: [
106-
sentryWebpackPlugin({
107-
...sentryPluginOptions,
108-
release: {
109-
name: `${sentryPluginOptions.release.name!}-webpack4`,
110-
uploadLegacySourcemaps: `${
111-
sentryPluginOptions.release.uploadLegacySourcemaps as string
112-
}/webpack4`,
113-
},
114-
}),
115-
],
116-
},
117-
(err) => {
118-
if (err) {
119-
throw err;
120-
}
121-
}
122-
);
123-
124-
webpack5(
93+
webpack(
12594
{
12695
devtool: "source-map",
12796
cache: false,
12897
entry: entrypoints,
12998
output: {
130-
path: path.join(outFolder, "webpack5"),
99+
path: path.join(outFolder, "webpack"),
131100
library: {
132101
type: "commonjs",
133102
},
@@ -137,10 +106,10 @@ export function createCjsBundles(
137106
sentryWebpackPlugin({
138107
...sentryPluginOptions,
139108
release: {
140-
name: `${sentryPluginOptions.release.name!}-webpack5`,
109+
name: `${sentryPluginOptions.release.name!}-webpack`,
141110
uploadLegacySourcemaps: `${
142111
sentryPluginOptions.release.uploadLegacySourcemaps as string
143-
}/webpack5`,
112+
}/webpack`,
144113
},
145114
}),
146115
],

packages/integration-tests/fixtures/after-upload-deletion-promise/after-upload-deletion.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
/* eslint-disable jest/expect-expect */
33
import path from "path";
44
import fs from "fs";
5-
import { testIfNodeMajorVersionIsLessThan18 } from "../../utils/testIf";
65

76
describe("Deletes files with `filesToDeleteAfterUpload` set to a promise", () => {
8-
testIfNodeMajorVersionIsLessThan18("webpack 4 bundle", () => {
9-
expect(fs.existsSync(path.join(__dirname, "out", "webpack4", "bundle.js.map"))).toBe(false);
10-
});
11-
127
test("webpack 5 bundle", () => {
13-
expect(fs.existsSync(path.join(__dirname, "out", "webpack5", "bundle.js.map"))).toBe(false);
8+
expect(fs.existsSync(path.join(__dirname, "out", "webpack", "bundle.js.map"))).toBe(false);
149
});
1510

1611
test("esbuild bundle", () => {

packages/integration-tests/fixtures/after-upload-deletion-promise/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createCjsBundles } from "../../utils/create-cjs-bundles";
33

44
const outputDir = path.resolve(__dirname, "out");
55

6-
["webpack4", "webpack5", "esbuild", "rollup", "vite"].forEach((bundler) => {
6+
["webpack", "esbuild", "rollup", "vite"].forEach((bundler) => {
77
const fileDeletionGlobPromise = new Promise<string[]>((resolve) => {
88
setTimeout(() => {
99
resolve([path.join(__dirname, "out", bundler, "bundle.js.map")]);

packages/integration-tests/fixtures/after-upload-deletion/after-upload-deletion.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
/* eslint-disable jest/expect-expect */
33
import path from "path";
44
import fs from "fs";
5-
import { testIfNodeMajorVersionIsLessThan18 } from "../../utils/testIf";
65

76
describe("Deletes with `filesToDeleteAfterUpload` even without uploading anything", () => {
8-
testIfNodeMajorVersionIsLessThan18("webpack 4 bundle", () => {
9-
expect(fs.existsSync(path.join(__dirname, "out", "webpack4", "bundle.js.map"))).toBe(false);
10-
});
11-
12-
test("webpack 5 bundle", () => {
13-
expect(fs.existsSync(path.join(__dirname, "out", "webpack5", "bundle.js.map"))).toBe(false);
7+
test("webpack bundle", () => {
8+
expect(fs.existsSync(path.join(__dirname, "out", "webpack", "bundle.js.map"))).toBe(false);
149
});
1510

1611
test("esbuild bundle", () => {

packages/integration-tests/fixtures/after-upload-deletion/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createCjsBundles } from "../../utils/create-cjs-bundles";
33

44
const outputDir = path.resolve(__dirname, "out");
55

6-
["webpack4", "webpack5", "esbuild", "rollup", "vite"].forEach((bundler) => {
6+
["webpack", "esbuild", "rollup", "vite"].forEach((bundler) => {
77
createCjsBundles(
88
{
99
bundle: path.resolve(__dirname, "input", "bundle.js"),

packages/integration-tests/fixtures/application-key-injection/metadata-injection.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/* eslint-disable jest/expect-expect */
33
import { execSync } from "child_process";
44
import path from "path";
5-
import { testIfNodeMajorVersionIsLessThan18 } from "../../utils/testIf";
65

76
function checkBundle(bundlePath: string): void {
87
const output = execSync(`node ${bundlePath}`, { encoding: "utf-8" });
@@ -16,12 +15,8 @@ function checkBundle(bundlePath: string): void {
1615
}
1716

1817
describe("appKey injection", () => {
19-
testIfNodeMajorVersionIsLessThan18("webpack 4 bundle", () => {
20-
checkBundle(path.join(__dirname, "out", "webpack4", "bundle.js"));
21-
});
22-
2318
test("webpack 5 bundle", () => {
24-
checkBundle(path.join(__dirname, "out", "webpack5", "bundle.js"));
19+
checkBundle(path.join(__dirname, "out", "webpack", "bundle.js"));
2520
});
2621

2722
test("esbuild bundle", () => {

0 commit comments

Comments
 (0)