Skip to content

Commit f2d4e54

Browse files
david-lunatrentm
andauthored
feat!: set compilation target to es2022 for all packages but api and semantic-conventions (#5456)
Co-authored-by: Trent Mick <[email protected]>
1 parent 492ed35 commit f2d4e54

File tree

29 files changed

+125
-74
lines changed

29 files changed

+125
-74
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
120120
* (user-facing): `ENVIRONMENT` has been removed without replacement
121121
* (user-facing): `RAW_ENVIRONMENT` has been removed without replacement
122122
* (user-facing): `parseEnvironment` has been removed without replacement
123+
* feat!: set compilation target to ES2022 for all packages except `@opentelemetry/api`, `@opentelemetry/api-logs`, `@opentelemetry/api-events`, and `@opentelemetry/semantic-conventions` [#5456](https://github.com/open-telemetry/opentelemetry-js/pull/5456) @david-luna
124+
* (user-facing): drops browser runtimes which do not support ES2022 features
123125

124126
### :rocket: (Enhancement)
125127

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ underlying language features used.
141141
The current minumum language feature support is set as [ECMAScript 2020](https://262.ecma-international.org/11.0/) that are available
142142
in all modern browsers / runtimes.
143143

144-
This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2020, you will need
144+
This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2022, you will need
145145
to transpile the code and provide any necessary polyfills for the missing features to ensure compatibility with your target
146-
environments. Any support issues that arise from using a browser or runtime that does not support ES2020 will be closed as "won't fix".
146+
environments. Any support issues that arise from using a browser or runtime that does not support ES2022 will be closed as "won't fix".
147147

148148
This minimum support level is subject to change as the project evolves and as the underlying language features evolve.
149149

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"devDependencies": {
7676
"@types/mocha": "10.0.10",
77-
"@types/node": "18.6.5",
77+
"@types/node": "^8.10.66",
7878
"@types/sinon": "17.0.3",
7979
"@types/webpack": "5.28.5",
8080
"@types/webpack-env": "1.16.3",

api/src/platform/browser/globalThis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ export const _globalThis: typeof globalThis =
3434
: typeof window === 'object'
3535
? window
3636
: typeof global === 'object'
37-
? global
37+
? (global as unknown as typeof globalThis)
3838
: ({} as typeof globalThis);

api/test/common/baggage/Baggage.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ describe('Baggage', () => {
5252

5353
const entry = bag.getEntry('key');
5454
assert.ok(entry);
55-
entry.value = 'mutated';
55+
if (entry) {
56+
entry.value = 'mutated';
57+
}
5658

5759
assert.strictEqual(bag.getEntry('key')?.value, 'value');
5860
});

api/test/tree-shaking/tree-shaking.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import * as assert from 'assert';
1818
import { webpack, Stats } from 'webpack';
1919
import * as path from 'path';
20-
import { Union } from 'unionfs';
20+
import { IFS, Union } from 'unionfs';
2121
import { fs as mfs } from 'memfs';
2222
import * as realFs from 'fs';
2323

@@ -86,7 +86,7 @@ describe('tree-shaking', function () {
8686
});
8787

8888
const fs = new Union();
89-
fs.use(mfs as any).use(realFs);
89+
fs.use(mfs as any).use(realFs as unknown as IFS);
9090

9191
// direct webpack to use unionfs for file input
9292
// needs workaround from https://github.com/webpack/webpack/issues/18242#issuecomment-2018116985 since webpack 5.91.0

api/tsconfig.esm.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"extends": "../tsconfig.base.esm.json",
33
"compilerOptions": {
4+
"lib": [
5+
"es2017",
6+
"dom"
7+
],
48
"outDir": "build/esm",
59
"rootDir": "src",
10+
"target": "es2017",
611
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
712
},
813
"include": [

api/tsconfig.esnext.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"extends": "../tsconfig.base.esnext.json",
33
"compilerOptions": {
4+
"lib": [
5+
"es2017",
6+
"dom"
7+
],
48
"outDir": "build/esnext",
59
"rootDir": "src",
10+
"target": "es2017",
611
"tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo"
712
},
813
"include": [

api/tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
4+
"lib": [
5+
"es2017",
6+
"dom"
7+
],
48
"outDir": "build",
5-
"rootDir": "."
9+
"rootDir": ".",
10+
"target": "es2017"
611
},
712
"files": [],
813
"include": [

experimental/packages/api-events/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"author": "OpenTelemetry Authors",
4141
"license": "Apache-2.0",
4242
"engines": {
43-
"node": "^18.19.0 || >=20.6.0"
43+
"node": ">=8.0.0"
4444
},
4545
"files": [
4646
"build/esm/**/*.js",
@@ -65,7 +65,7 @@
6565
},
6666
"devDependencies": {
6767
"@types/mocha": "10.0.10",
68-
"@types/node": "18.6.5",
68+
"@types/node": "^8.10.66",
6969
"@types/webpack-env": "1.16.3",
7070
"babel-plugin-istanbul": "7.0.0",
7171
"cross-var": "1.1.0",

0 commit comments

Comments
 (0)