From 6e95ffc6b2240718b845f9b06adb257445d54da6 Mon Sep 17 00:00:00 2001 From: Dan Skinner Date: Tue, 4 Feb 2025 08:20:55 +0000 Subject: [PATCH 1/3] test with ts 3.9 --- .../features/fixtures/plugin_react/webpack4/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/browser/features/fixtures/plugin_react/webpack4/package.json b/test/browser/features/fixtures/plugin_react/webpack4/package.json index 6c2b1a22b2..405415049a 100644 --- a/test/browser/features/fixtures/plugin_react/webpack4/package.json +++ b/test/browser/features/fixtures/plugin_react/webpack4/package.json @@ -14,7 +14,7 @@ "babel-loader": "^8.2.5", "react": "^16.5.0", "react-dom": "^16.5.0", - "typescript": "^4.1.3", + "typescript": "^3.9", "uglifyjs-webpack-plugin": "2.0.1", "webpack": "^4.8.1", "webpack-cli": "^3.1.2" From 50da6f47f14617fc026ef402c22acef517cb8088 Mon Sep 17 00:00:00 2001 From: Dan Skinner Date: Tue, 4 Feb 2025 09:53:30 +0000 Subject: [PATCH 2/3] fix plugin-react peer deps --- packages/plugin-react/package.json | 8 ++------ .../features/fixtures/plugin_react/webpack4/tsconfig.json | 3 ++- tsconfig.json | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/plugin-react/package.json b/packages/plugin-react/package.json index 84889ac92f..bf05abd6a5 100644 --- a/packages/plugin-react/package.json +++ b/packages/plugin-react/package.json @@ -34,11 +34,7 @@ "@bugsnag/core": "^8.2.0" }, "peerDependencies": { - "@bugsnag/core": "^8.0.0" - }, - "peerDependenciesMeta": { - "@bugsnag/core": { - "optional": true - } + "@bugsnag/core": "^8.0.0", + "react": "*" } } diff --git a/test/browser/features/fixtures/plugin_react/webpack4/tsconfig.json b/test/browser/features/fixtures/plugin_react/webpack4/tsconfig.json index 76639f6cd0..1bac16bce8 100644 --- a/test/browser/features/fixtures/plugin_react/webpack4/tsconfig.json +++ b/test/browser/features/fixtures/plugin_react/webpack4/tsconfig.json @@ -8,6 +8,7 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "noEmit": true + "noEmit": true, + "typeRoots": ["./node_modules/@types"], } } diff --git a/tsconfig.json b/tsconfig.json index 4ab55f2541..ac42915f59 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,6 @@ "moduleResolution": "bundler", "lib": [ "dom", "esnext" ], "allowJs": true, - // "checkJs": true, "jsx": "preserve", "noEmit": true, "strict": true, From f6dc533b9815f46890b896b29fdca1df2522b4a4 Mon Sep 17 00:00:00 2001 From: Dan Skinner Date: Tue, 4 Feb 2025 10:45:47 +0000 Subject: [PATCH 3/3] fix bug in react plugin --- package-lock.json | 30 +++++++---------------------- packages/plugin-react/src/plugin.ts | 1 + 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index e1b038815a..11ed0223ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31109,8 +31109,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "3.14.1", @@ -33572,7 +33571,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -37428,7 +37426,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -39144,7 +39141,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -39424,7 +39420,6 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==", - "dev": true, "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -39447,8 +39442,7 @@ "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/react-lifecycles-compat": { "version": "2.0.0", @@ -52326,12 +52320,8 @@ "@bugsnag/core": "^8.2.0" }, "peerDependencies": { - "@bugsnag/core": "^8.0.0" - }, - "peerDependenciesMeta": { - "@bugsnag/core": { - "optional": true - } + "@bugsnag/core": "^8.0.0", + "react": "*" } }, "packages/plugin-react-native-client-sync": { @@ -81318,8 +81308,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "3.14.1", @@ -83176,7 +83165,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" } @@ -86212,8 +86200,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-copy": { "version": "0.1.0", @@ -87463,7 +87450,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "requires": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -87686,7 +87672,6 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==", - "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -87706,8 +87691,7 @@ "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "react-lifecycles-compat": { "version": "2.0.0", diff --git a/packages/plugin-react/src/plugin.ts b/packages/plugin-react/src/plugin.ts index 4c5540fc5a..abb2ebb3ce 100644 --- a/packages/plugin-react/src/plugin.ts +++ b/packages/plugin-react/src/plugin.ts @@ -100,6 +100,7 @@ const createClass = (react: typeof React, client: Client) => class BugsnagErrorB error, true, handledState, + 'react plugin', 1 ) if (info && info.componentStack) info.componentStack = formatComponentStack(info.componentStack)