From 9acad74c58b7d984b9ca4280760379e69eb49853 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 2 Jun 2020 09:21:58 -0400 Subject: [PATCH] chore(react): remove rollup --- packages/react/README.md | 7 +- packages/react/package.json | 20 ++--- packages/react/rollup.config.js | 141 -------------------------------- packages/react/src/index.ts | 4 +- packages/react/src/profiler.tsx | 4 +- yarn.lock | 13 --- 6 files changed, 16 insertions(+), 173 deletions(-) delete mode 100644 packages/react/rollup.config.js diff --git a/packages/react/README.md b/packages/react/README.md index 564efd6cc21d..8df1272d44af 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -5,4 +5,9 @@

-# Official Sentry SDK for NodeJS +# Official Sentry SDK for ReactJS + +## Links + +- [Official SDK Docs](https://docs.sentry.io/quickstart/) +- [TypeDoc](http://getsentry.github.io/sentry-javascript/) diff --git a/packages/react/package.json b/packages/react/package.json index 993b46e2ffdf..75f8659b1de9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -16,9 +16,9 @@ "access": "public" }, "dependencies": { - "@sentry/browser": "5.16.0-beta.5", - "@sentry/types": "5.16.0-beta.5", - "@sentry/utils": "^5.15.5", + "@sentry/browser": "5.16.0", + "@sentry/types": "5.16.0", + "@sentry/utils": "5.16.0", "hoist-non-react-statics": "^3.3.2", "tslib": "^1.9.3" }, @@ -38,20 +38,12 @@ "react-dom": "^16.0.0", "react-test-renderer": "^16.13.1", "rimraf": "^2.6.3", - "rollup": "^1.10.1", - "rollup-plugin-commonjs": "^9.3.4", - "rollup-plugin-license": "^0.8.1", - "rollup-plugin-node-resolve": "^4.2.3", - "rollup-plugin-terser": "^4.0.4", - "rollup-plugin-typescript2": "^0.21.0", "tslint": "^5.16.0", "tslint-react": "^5.0.0", "typescript": "^3.5.1" }, "scripts": { - "build": "run-p build:es5 build:esm build:bundle", - "build:bundle": "rollup --config", - "build:bundle:watch": "rollup --config --watch", + "build": "run-p build:es5 build:esm", "build:es5": "tsc -p tsconfig.build.json", "build:esm": "tsc -p tsconfig.esm.json", "build:watch": "run-p build:watch:es5 build:watch:esm", @@ -60,11 +52,11 @@ "clean": "rimraf dist coverage build esm", "link:yarn": "yarn link", "lint": "run-s lint:prettier lint:tslint", - "lint:prettier": "prettier-check \"{src,test}/**/*.ts\"", + "lint:prettier": "prettier-check \"{src,test}/**/*.{ts,tsx}\"", "lint:tslint": "tslint -t stylish -p .", "lint:tslint:json": "tslint --format json -p . | tee lint-results.json", "fix": "run-s fix:tslint fix:prettier", - "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"", + "fix:prettier": "prettier --write \"{src,test}/**/*.{ts,tsx}\"", "fix:tslint": "tslint --fix -t stylish -p .", "test": "jest", "test:watch": "jest --watch" diff --git a/packages/react/rollup.config.js b/packages/react/rollup.config.js deleted file mode 100644 index 2883bb1651aa..000000000000 --- a/packages/react/rollup.config.js +++ /dev/null @@ -1,141 +0,0 @@ -import { terser } from 'rollup-plugin-terser'; -import typescript from 'rollup-plugin-typescript2'; -import license from 'rollup-plugin-license'; -import resolve from 'rollup-plugin-node-resolve'; -import commonjs from 'rollup-plugin-commonjs'; - -const commitHash = require('child_process') - .execSync('git rev-parse --short HEAD', { encoding: 'utf-8' }) - .trim(); - -const terserInstance = terser({ - mangle: { - // captureExceptions and captureMessage are public API methods and they don't need to be listed here - // as mangler doesn't touch user-facing thing, however sentryWrapped is not, and it would be mangled into a minified version. - // We need those full names to correctly detect our internal frames for stripping. - // I listed all of them here just for the clarity sake, as they are all used in the frames manipulation process. - reserved: ['captureException', 'captureMessage', 'sentryWrapped'], - properties: { - regex: /^_[^_]/, - }, - }, -}); - -const paths = { - '@sentry/utils': ['../utils/src'], - '@sentry/types': ['../types/src'], - '@sentry/browser': ['../browser/src'], -}; - -const plugins = [ - typescript({ - tsconfig: 'tsconfig.build.json', - tsconfigOverride: { - compilerOptions: { - declaration: false, - declarationMap: false, - module: 'ES2015', - paths, - }, - }, - include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'], - }), - resolve({ - mainFields: ['module'], - }), - commonjs(), -]; - -const bundleConfig = { - input: 'src/index.ts', - output: { - format: 'iife', - name: 'Sentry', - sourcemap: true, - strict: false, - }, - context: 'window', - plugins: [ - ...plugins, - license({ - sourcemap: true, - banner: `/*! @sentry/browser <%= pkg.version %> (${commitHash}) | https://github.com/getsentry/sentry-javascript */`, - }), - ], -}; - -export default [ - // ES5 Browser Bundle - { - ...bundleConfig, - output: { - ...bundleConfig.output, - file: 'build/bundle.js', - }, - }, - { - ...bundleConfig, - output: { - ...bundleConfig.output, - file: 'build/bundle.min.js', - }, - // Uglify has to be at the end of compilation, BUT before the license banner - plugins: bundleConfig.plugins - .slice(0, -1) - .concat(terserInstance) - .concat(bundleConfig.plugins.slice(-1)), - }, - // ------------------ - // ES6 Browser Bundle - { - ...bundleConfig, - output: { - ...bundleConfig.output, - file: 'build/bundle.es6.js', - }, - plugins: [ - typescript({ - tsconfig: 'tsconfig.build.json', - tsconfigOverride: { - compilerOptions: { - declaration: false, - declarationMap: false, - module: 'ES2015', - paths, - target: 'es6', - }, - }, - include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'], - }), - ...plugins.slice(1), - ], - }, - { - ...bundleConfig, - output: { - ...bundleConfig.output, - file: 'build/bundle.es6.min.js', - }, - plugins: [ - typescript({ - tsconfig: 'tsconfig.build.json', - tsconfigOverride: { - compilerOptions: { - declaration: false, - declarationMap: false, - module: 'ES2015', - paths, - target: 'es6', - }, - }, - include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'], - }), - ...plugins - .slice(1) - .slice(0, -1) - .concat(terserInstance) - .concat(bundleConfig.plugins.slice(-1)), - ], - }, - // ------------------ -]; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index ea37d32ba29f..93fa1c640dcc 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,5 +1,3 @@ export * from '@sentry/browser'; -import { Profiler, withProfiler } from './profiler'; - -export { Profiler, withProfiler }; +export { Profiler, withProfiler } from './profiler'; diff --git a/packages/react/src/profiler.tsx b/packages/react/src/profiler.tsx index 773f19e1c3fe..1abc5034410b 100644 --- a/packages/react/src/profiler.tsx +++ b/packages/react/src/profiler.tsx @@ -54,7 +54,9 @@ const getInitActivity = (componentDisplayName: string): number | null => { return activity; } - logger.warn(`Unable to profile component ${componentDisplayName} due to invalid Tracing Integration`); + logger.warn( + `Unable to profile component ${componentDisplayName} due to invalid Tracing Integration. Please make sure to setup the Tracing integration.`, + ); return null; }; diff --git a/yarn.lock b/yarn.lock index 82c3ebd54b1c..abf8e70b088b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1092,19 +1092,6 @@ universal-user-agent "^2.0.0" url-template "^2.0.8" -"@sentry/types@5.15.5": - version "5.15.5" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.15.5.tgz#16c97e464cf09bbd1d2e8ce90d130e781709076e" - integrity sha512-F9A5W7ucgQLJUG4LXw1ZIy4iLevrYZzbeZ7GJ09aMlmXH9PqGThm1t5LSZlVpZvUfQ2rYA8NU6BdKJSt7B5LPw== - -"@sentry/utils@^5.15.5": - version "5.15.5" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.15.5.tgz#dec1d4c79037c4da08b386f5d34409234dcbfb15" - integrity sha512-Nl9gl/MGnzSkuKeo3QaefoD/OJrFLB8HmwQ7HUbTXb6E7yyEzNKAQMHXGkwNAjbdYyYbd42iABP6Y5F/h39NtA== - dependencies: - "@sentry/types" "5.15.5" - tslib "^1.9.3" - "@sinonjs/commons@^1", "@sinonjs/commons@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.4.0.tgz#7b3ec2d96af481d7a0321252e7b1c94724ec5a78"