Skip to content

Commit 6804a5a

Browse files
committed
bundle only es20217 (no es5/es6)
1 parent 2e8b662 commit 6804a5a

File tree

48 files changed

+129
-324
lines changed

Some content is hidden

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

48 files changed

+129
-324
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
module.exports = {
77
root: true,
88
env: {
9-
es6: true,
9+
es2017: true,
1010
},
1111
parserOptions: {
1212
ecmaVersion: 2018,

.github/workflows/build.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,6 @@ jobs:
336336
run: yarn lint:lerna
337337
- name: Lint C++ files
338338
run: yarn lint:clang
339-
- name: Validate ES5 builds
340-
run: yarn validate:es5
341339

342340
job_check_format:
343341
name: Check file formatting
@@ -627,28 +625,24 @@ jobs:
627625
matrix:
628626
bundle:
629627
- esm
630-
- bundle_es5
631-
- bundle_es5_min
632-
- bundle_es6
633-
- bundle_es6_min
634-
- bundle_replay_es6
635-
- bundle_replay_es6_min
636-
- bundle_tracing_es5
637-
- bundle_tracing_es5_min
638-
- bundle_tracing_es6
639-
- bundle_tracing_es6_min
640-
- bundle_tracing_replay_es6
641-
- bundle_tracing_replay_es6_min
628+
- bundle
629+
- bundle_min
630+
- bundle_replay
631+
- bundle_replay_min
632+
- bundle_tracing
633+
- bundle_tracing_min
634+
- bundle_tracing_replay
635+
- bundle_tracing_replay_min
642636
project:
643637
- chromium
644638
include:
645639
# Only check all projects for esm & full bundle
646640
# We also shard the tests as they take the longest
647-
- bundle: bundle_tracing_replay_es6_min
641+
- bundle: bundle_tracing_replay_min
648642
project: ''
649643
shard: 1
650644
shards: 2
651-
- bundle: bundle_tracing_replay_es6_min
645+
- bundle: bundle_tracing_replay_min
652646
project: ''
653647
shard: 2
654648
shards: 2
@@ -665,7 +659,7 @@ jobs:
665659
shards: 3
666660
exclude:
667661
# Do not run the default chromium-only tests
668-
- bundle: bundle_tracing_replay_es6_min
662+
- bundle: bundle_tracing_replay_min
669663
project: 'chromium'
670664
- bundle: esm
671665
project: 'chromium'

MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ stable release of `8.x` comes out).
2424
`@sentry/node` and all of our node-based server-side sdks (`@sentry/nextjs`, `@sentry/serverless`, etc.). We no longer
2525
test against Node 8, 10, or 12 and cannot guarantee that the SDK will work as expected on these versions.
2626

27-
**Browser**: Our browser SDKs (`@sentry/browser`, `@sentry/react`, `@sentry/vue`, etc.) now require ES6+ compatible
27+
**Browser**: Our browser SDKs (`@sentry/browser`, `@sentry/react`, `@sentry/vue`, etc.) now require ES2017+ compatible
2828
browsers. This means that we no longer support IE11 (end of an era). This also means that the Browser SDK requires the
2929
fetch API to be available in the environment.
3030

dev-packages/browser-integration-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ To filter tests by their title:
6161
You can refer to [Playwright documentation](https://playwright.dev/docs/test-cli) for other CLI options.
6262

6363
You can set env variable `PW_BUNDLE` to set specific build or bundle to test against.
64-
Available options: `esm`, `cjs`, `bundle_es5`, `bundle_es5_min`, `bundle_es6`, `bundle_es6_min`
64+
Available options: `esm`, `cjs`, `bundle`, `bundle_min`
6565

6666
### Troubleshooting
6767

dev-packages/browser-integration-tests/package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,12 @@
1717
"pretest": "yarn clean && yarn type-check",
1818
"test": "yarn test:all --project='chromium'",
1919
"test:all": "npx playwright test -c playwright.browser.config.ts",
20-
"test:bundle:es5": "PW_BUNDLE=bundle_es5 yarn test",
21-
"test:bundle:es5:min": "PW_BUNDLE=bundle_es5_min yarn test",
22-
"test:bundle:es6": "PW_BUNDLE=bundle_es6 yarn test",
23-
"test:bundle:es6:min": "PW_BUNDLE=bundle_es6_min yarn test",
24-
"test:bundle:replay:es6": "PW_BUNDLE=bundle_replay_es6 yarn test",
25-
"test:bundle:replay:es6:min": "PW_BUNDLE=bundle_replay_es6_min yarn test",
26-
"test:bundle:tracing:es5": "PW_BUNDLE=bundle_tracing_es5 yarn test",
27-
"test:bundle:tracing:es5:min": "PW_BUNDLE=bundle_tracing_es5_min yarn test",
28-
"test:bundle:tracing:es6": "PW_BUNDLE=bundle_tracing_es6 yarn test",
29-
"test:bundle:tracing:es6:min": "PW_BUNDLE=bundle_tracing_es6_min yarn test",
30-
"test:bundle:tracing:replay:es6": "PW_BUNDLE=bundle_tracing_replay_es6 yarn test",
31-
"test:bundle:tracing:replay:es6:min": "PW_BUNDLE=bundle_tracing_replay_es6_min yarn test",
20+
"test:bundle": "PW_BUNDLE=bundle yarn test",
21+
"test:bundle:min": "PW_BUNDLE=bundle_min yarn test",
22+
"test:bundle:replay": "PW_BUNDLE=bundle_replay yarn test",
23+
"test:bundle:replay:min": "PW_BUNDLE=bundle_replay_min yarn test",
24+
"test:bundle:tracing": "PW_BUNDLE=bundle_tracing yarn test",
25+
"test:bundle:tracing:min": "PW_BUNDLE=bundle_tracing_min yarn test",
3226
"test:cjs": "PW_BUNDLE=cjs yarn test",
3327
"test:esm": "PW_BUNDLE=esm yarn test",
3428
"test:loader": "npx playwright test -c playwright.loader.config.ts --project='chromium'",
@@ -40,8 +34,7 @@
4034
"test:loader:debug": "PW_BUNDLE=loader_debug yarn test:loader",
4135
"test:ci": "yarn test:all --reporter='line'",
4236
"test:update-snapshots": "yarn test:all --update-snapshots",
43-
"test:detect-flaky": "ts-node scripts/detectFlakyTests.ts",
44-
"validate:es5": "es-check es5 'fixtures/loader.js'"
37+
"test:detect-flaky": "ts-node scripts/detectFlakyTests.ts"
4538
},
4639
"dependencies": {
4740
"@babel/preset-typescript": "^7.16.7",

dev-packages/browser-integration-tests/suites/transport/offline/queued/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function delay(ms: number) {
1010

1111
sentryTest('should queue and retry events when they fail to send', async ({ getLocalTestPath, page }) => {
1212
// makeBrowserOfflineTransport is not included in any CDN bundles
13-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_')) {
13+
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle')) {
1414
sentryTest.skip();
1515
}
1616

dev-packages/browser-integration-tests/utils/generatePlugin.ts

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,38 +47,32 @@ const BUNDLE_PATHS: Record<string, Record<string, string>> = {
4747
browser: {
4848
cjs: 'build/npm/cjs/index.js',
4949
esm: 'build/npm/esm/index.js',
50-
bundle_es5: 'build/bundles/bundle.es5.js',
51-
bundle_es5_min: 'build/bundles/bundle.es5.min.js',
52-
bundle_es6: 'build/bundles/bundle.js',
53-
bundle_es6_min: 'build/bundles/bundle.min.js',
54-
bundle_replay_es6: 'build/bundles/bundle.replay.js',
55-
bundle_replay_es6_min: 'build/bundles/bundle.replay.min.js',
56-
bundle_tracing_es5: 'build/bundles/bundle.tracing.es5.js',
57-
bundle_tracing_es5_min: 'build/bundles/bundle.tracing.es5.min.js',
58-
bundle_tracing_es6: 'build/bundles/bundle.tracing.js',
59-
bundle_tracing_es6_min: 'build/bundles/bundle.tracing.min.js',
60-
bundle_tracing_replay_es6: 'build/bundles/bundle.tracing.replay.js',
61-
bundle_tracing_replay_es6_min: 'build/bundles/bundle.tracing.replay.min.js',
62-
loader_base: 'build/bundles/bundle.es5.min.js',
63-
loader_eager: 'build/bundles/bundle.es5.min.js',
64-
loader_debug: 'build/bundles/bundle.es5.debug.min.js',
65-
loader_tracing: 'build/bundles/bundle.tracing.es5.min.js',
50+
bundle: 'build/bundles/bundle.js',
51+
bundle_min: 'build/bundles/bundle.min.js',
52+
bundle_replay: 'build/bundles/bundle.replay.js',
53+
bundle_replay_min: 'build/bundles/bundle.replay.min.js',
54+
bundle_tracing: 'build/bundles/bundle.tracing.js',
55+
bundle_tracing_min: 'build/bundles/bundle.tracing.min.js',
56+
bundle_tracing_replay: 'build/bundles/bundle.tracing.replay.js',
57+
bundle_tracing_replay_min: 'build/bundles/bundle.tracing.replay.min.js',
58+
loader_base: 'build/bundles/bundle.min.js',
59+
loader_eager: 'build/bundles/bundle.min.js',
60+
loader_debug: 'build/bundles/bundle.debug.min.js',
61+
loader_tracing: 'build/bundles/bundle.tracing.min.js',
6662
loader_replay: 'build/bundles/bundle.replay.min.js',
6763
loader_tracing_replay: 'build/bundles/bundle.tracing.replay.debug.min.js',
6864
},
6965
integrations: {
7066
cjs: 'build/npm/cjs/index.js',
7167
esm: 'build/npm/esm/index.js',
72-
bundle_es5: 'build/bundles/[INTEGRATION_NAME].es5.js',
73-
bundle_es5_min: 'build/bundles/[INTEGRATION_NAME].es5.min.js',
74-
bundle_es6: 'build/bundles/[INTEGRATION_NAME].js',
75-
bundle_es6_min: 'build/bundles/[INTEGRATION_NAME].min.js',
68+
bundle: 'build/bundles/[INTEGRATION_NAME].js',
69+
bundle_min: 'build/bundles/[INTEGRATION_NAME].min.js',
7670
},
7771
wasm: {
7872
cjs: 'build/npm/cjs/index.js',
7973
esm: 'build/npm/esm/index.js',
80-
bundle_es6: 'build/bundles/wasm.js',
81-
bundle_es6_min: 'build/bundles/wasm.min.js',
74+
bundle: 'build/bundles/wasm.js',
75+
bundle_min: 'build/bundles/wasm.min.js',
8276
},
8377
};
8478

@@ -229,7 +223,7 @@ class SentryScenarioGenerationPlugin {
229223
});
230224
}
231225

232-
// Convert e.g. bundle_tracing_es5_min to bundle_es5_min
226+
// Convert e.g. bundle_tracing_min to bundle_min
233227
const integrationBundleKey = bundleKey
234228
.replace('loader_', 'bundle_')
235229
.replace('_replay', '')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* We can only test WASM tests in certain bundles/packages:
33
* - NPM (ESM, CJS)
4-
* - ES6 CDN bundles
4+
* - CDN bundles
55
* - On browsers other than WebKit
66
*
77
* @returns `true` if we should skip the replay test
@@ -11,5 +11,5 @@ export function shouldSkipWASMTests(browser: string): boolean {
1111
return true;
1212
}
1313
const bundle = process.env.PW_BUNDLE as string | undefined;
14-
return bundle != null && bundle.includes('es5');
14+
return bundle != null;
1515
}

dev-packages/e2e-tests/test-applications/create-next-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/e2e-tests/test-applications/create-react-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"include": ["index.ts"],
33
"compilerOptions": {
4-
"lib": ["es6", "DOM"],
4+
"lib": ["es2017", "DOM"],
55
"skipLibCheck": false,
66
"noEmit": true,
77
"types": [],
8-
"target": "es6",
8+
"target": "es2017",
99
"moduleResolution": "node"
1010
}
1111
}

dev-packages/e2e-tests/test-applications/nextjs-14/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/e2e-tests/test-applications/nextjs-app-dir/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/e2e-tests/test-applications/node-exports-test-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"types": ["node"],
44
"esModuleInterop": true,
5-
"lib": ["ES6"],
5+
"lib": ["es2017"],
66
"strict": true,
77
"outDir": "dist",
88
"target": "ESNext",

dev-packages/e2e-tests/test-applications/node-express-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"types": ["node"],
44
"esModuleInterop": true,
5-
"lib": ["ES6"],
5+
"lib": ["es2017"],
66
"strict": true,
77
"outDir": "dist"
88
},

dev-packages/e2e-tests/test-applications/react-create-hash-router/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/e2e-tests/test-applications/react-router-6-use-routes/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/e2e-tests/test-applications/standard-frontend-react/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,

dev-packages/overhead-metrics/.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module.exports = {
99
'@typescript-eslint/no-non-null-assertion': 'off',
1010
'@sentry-internal/sdk/no-optional-chaining': 'off',
1111
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
12-
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
1312
'@sentry-internal/sdk/no-class-field-initializers': 'off',
1413
'jsdoc/require-jsdoc': 'off',
1514
},

dev-packages/rollup-utils/bundleHelpers.mjs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { builtinModules } from 'module';
77
import deepMerge from 'deepmerge';
88

99
import {
10-
getEs5Polyfills,
1110
makeBrowserBuildPlugin,
1211
makeCleanupPlugin,
1312
makeCommonJSPlugin,
@@ -17,24 +16,20 @@ import {
1716
makeRrwebBuildPlugin,
1817
makeSetSDKSourcePlugin,
1918
makeSucrasePlugin,
20-
makeTSPlugin,
2119
makeTerserPlugin,
2220
} from './plugins/index.mjs';
2321
import { mergePlugins } from './utils.mjs';
2422

2523
const BUNDLE_VARIANTS = ['.js', '.min.js', '.debug.min.js'];
2624

2725
export function makeBaseBundleConfig(options) {
28-
const { bundleType, entrypoints, jsVersion, licenseTitle, outputFileBase, packageSpecificConfig } = options;
29-
30-
const isEs5 = jsVersion.toLowerCase() === 'es5';
26+
const { bundleType, entrypoints, licenseTitle, outputFileBase, packageSpecificConfig } = options;
3127

3228
const nodeResolvePlugin = makeNodeResolvePlugin();
3329
const sucrasePlugin = makeSucrasePlugin();
3430
const cleanupPlugin = makeCleanupPlugin();
3531
const markAsBrowserBuildPlugin = makeBrowserBuildPlugin(true);
3632
const licensePlugin = makeLicensePlugin(licenseTitle);
37-
const tsPlugin = makeTSPlugin('es5');
3833
const rrwebBuildPlugin = makeRrwebBuildPlugin({
3934
excludeIframe: false,
4035
excludeShadowDom: false,
@@ -50,10 +45,6 @@ export function makeBaseBundleConfig(options) {
5045
output: {
5146
format: 'iife',
5247
name: 'Sentry',
53-
outro: () => {
54-
// Add polyfills for ES6 array/string methods at the end of the bundle
55-
return isEs5 ? getEs5Polyfills() : '';
56-
},
5748
},
5849
context: 'window',
5950
plugins: [rrwebBuildPlugin, markAsBrowserBuildPlugin],
@@ -123,9 +114,7 @@ export function makeBaseBundleConfig(options) {
123114
strict: false,
124115
esModule: false,
125116
},
126-
plugins: isEs5
127-
? [tsPlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin]
128-
: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin],
117+
plugins: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin],
129118
treeshake: 'smallest',
130119
};
131120

0 commit comments

Comments
 (0)