Skip to content

Commit c6a496f

Browse files
committed
Revert "build(cdn): Ensure ES5 bundles do not use non-ES5 code (#7550)"
This reverts commit 0e3552d.
1 parent 9619432 commit c6a496f

File tree

15 files changed

+28
-254
lines changed

15 files changed

+28
-254
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,8 @@ jobs:
321321
uses: ./.github/actions/restore-cache
322322
env:
323323
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
324-
- name: Lint source files
324+
- name: Run linter
325325
run: yarn lint
326-
- name: Validate ES5 builds
327-
run: yarn validate:es5
328326

329327
job_circular_dep_check:
330328
name: Circular Dependency Check

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"link:yarn": "lerna exec yarn link",
2424
"lint": "lerna run lint",
2525
"lint:eslint": "lerna run lint:eslint",
26-
"validate:es5": "lerna run validate:es5",
2726
"postpublish": "lerna run --stream --concurrency 1 postpublish",
2827
"test": "lerna run --ignore @sentry-internal/* test",
2928
"test:unit": "lerna run --ignore @sentry-internal/* test:unit",
@@ -90,7 +89,6 @@
9089
"chai": "^4.1.2",
9190
"codecov": "^3.6.5",
9291
"deepmerge": "^4.2.2",
93-
"es-check": "7.1.0",
9492
"eslint": "7.32.0",
9593
"jest": "^27.5.1",
9694
"jest-environment-node": "^27.5.1",

packages/browser/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"lint": "run-s lint:prettier lint:eslint",
6969
"lint:eslint": "eslint . --format stylish",
7070
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
71-
"validate:es5": "es-check es5 'build/bundles/*.es5*.js'",
7271
"size:check": "run-p size:check:es5 size:check:es6",
7372
"size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
7473
"size:check:es6": "cat build/bundles/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",

packages/eslint-config-sdk/src/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ module.exports = {
161161

162162
// All imports should be accounted for
163163
'import/no-extraneous-dependencies': 'error',
164-
165-
// Do not allow usage of functions we do not polyfill for ES5
166-
'@sentry-internal/sdk/no-unsupported-es6-methods': 'error',
167164
},
168165
},
169166
{

packages/eslint-plugin-sdk/src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ module.exports = {
1313
'no-optional-chaining': require('./rules/no-optional-chaining'),
1414
'no-nullish-coalescing': require('./rules/no-nullish-coalescing'),
1515
'no-eq-empty': require('./rules/no-eq-empty'),
16-
'no-unsupported-es6-methods': require('./rules/no-unsupported-es6-methods'),
1716
},
1817
};

packages/eslint-plugin-sdk/src/rules/no-unsupported-es6-methods.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/node/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ module.exports = {
66
rules: {
77
'@sentry-internal/sdk/no-optional-chaining': 'off',
88
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
9-
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
109
},
1110
};

packages/overhead-metrics/.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module.exports = {
1010
'import/no-unresolved': 'off',
1111
'@sentry-internal/sdk/no-optional-chaining': 'off',
1212
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
13-
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
1413
'jsdoc/require-jsdoc': 'off',
1514
},
1615
},

packages/replay/.eslintrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,21 @@ module.exports = {
77
extends: ['../../.eslintrc.js'],
88
overrides: [
99
{
10-
files: ['src/**/*.ts'],
11-
rules: {},
10+
files: ['worker/**/*.ts'],
11+
parserOptions: {
12+
// TODO: figure out if we need a worker-specific tsconfig
13+
project: ['tsconfig.worker.json'],
14+
},
15+
rules: {
16+
// We cannot use backticks, as that conflicts with the stringified worker
17+
'prefer-template': 'off',
18+
},
19+
},
20+
{
21+
files: ['src/worker/**/*.js'],
22+
parserOptions: {
23+
sourceType: 'module',
24+
},
1225
},
1326
{
1427
files: ['jest.setup.ts', 'jest.config.ts'],

packages/svelte/.eslintrc.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ module.exports = {
33
browser: true,
44
},
55
extends: ['../../.eslintrc.js'],
6-
rules: {
7-
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
8-
},
96
};

packages/vue/src/vendor/components.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const ANONYMOUS_COMPONENT_NAME = '<Anonymous>';
3333

3434
const repeat = (str: string, n: number): string => {
3535
// string.repeat() is not supported by IE11, we fall back to just using the string in that case
36-
// eslint-disable-next-line @sentry-internal/sdk/no-unsupported-es6-methods
3736
return str.repeat ? str.repeat(n) : str;
3837
};
3938

rollup/bundleHelpers.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
makeTerserPlugin,
1818
makeTSPlugin,
1919
makeSetSDKSourcePlugin,
20-
getEs5Polyfills,
2120
} from './plugins/index.js';
2221
import { mergePlugins } from './utils';
2322

@@ -26,8 +25,6 @@ const BUNDLE_VARIANTS = ['.js', '.min.js', '.debug.min.js'];
2625
export function makeBaseBundleConfig(options) {
2726
const { bundleType, entrypoints, jsVersion, licenseTitle, outputFileBase, packageSpecificConfig } = options;
2827

29-
const isEs5 = jsVersion.toLowerCase() === 'es5';
30-
3128
const nodeResolvePlugin = makeNodeResolvePlugin();
3229
const sucrasePlugin = makeSucrasePlugin();
3330
const cleanupPlugin = makeCleanupPlugin();
@@ -45,10 +42,6 @@ export function makeBaseBundleConfig(options) {
4542
output: {
4643
format: 'iife',
4744
name: 'Sentry',
48-
outro: () => {
49-
// Add polyfills for ES6 array/string methods at the end of the bundle
50-
return isEs5 ? getEs5Polyfills() : '';
51-
},
5245
},
5346
context: 'window',
5447
plugins: [markAsBrowserBuildPlugin],
@@ -108,9 +101,10 @@ export function makeBaseBundleConfig(options) {
108101
strict: false,
109102
esModule: false,
110103
},
111-
plugins: isEs5
112-
? [tsPlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin]
113-
: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin],
104+
plugins:
105+
jsVersion === 'es5'
106+
? [tsPlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin]
107+
: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin],
114108
treeshake: 'smallest',
115109
};
116110

rollup/plugins/bundlePlugins.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
* Typescript plugin docs: https://github.com/ezolenko/rollup-plugin-typescript2
99
*/
1010

11-
import * as fs from 'fs';
12-
import * as path from 'path';
13-
1411
import commonjs from '@rollup/plugin-commonjs';
1512
import deepMerge from 'deepmerge';
1613
import license from 'rollup-plugin-license';
@@ -41,11 +38,6 @@ export function makeLicensePlugin(title) {
4138
return plugin;
4239
}
4340

44-
export function getEs5Polyfills() {
45-
// Note: __dirname resolves to e.g. packages/browser or packages/tracing
46-
return fs.readFileSync(path.join(__dirname, '../../rollup/polyfills/es5.js'), 'utf-8');
47-
}
48-
4941
/**
5042
* Create a plugin to set the value of the `__SENTRY_DEBUG__` magic string.
5143
*

rollup/polyfills/es5.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)