Skip to content

Commit 1bb1428

Browse files
committed
fix: compile away class static blocks
See microsoft/TypeScript#46291 (comment)
1 parent 48f5fae commit 1bb1428

14 files changed

Lines changed: 318 additions & 148 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@apollo-elements/atomico": patch
3+
"@apollo-elements/components": patch
4+
"@apollo-elements/core": patch
5+
"@apollo-elements/fast": patch
6+
"@apollo-elements/gluon": patch
7+
"@apollo-elements/haunted": patch
8+
"@apollo-elements/hybrids": patch
9+
"@apollo-elements/lit-apollo": patch
10+
"@apollo-elements/mixins": patch
11+
"@apollo-elements/polymer": patch
12+
---
13+
14+
Compiles away [class static blocks](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Class_static_initialization_blocks)

β€Žpackage-lock.jsonβ€Ž

Lines changed: 162 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
"@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0",
7070
"@airbnb/node-memwatch": "^2.0.0",
7171
"@apollo/client": "^3.5.9",
72+
"@babel/cli": "^7.17.6",
73+
"@babel/core": "^7.17.8",
74+
"@babel/plugin-proposal-class-static-block": "^7.17.6",
7275
"@borgar/textbox": "^1.3.0",
7376
"@changesets/cli": "^2.22.0",
7477
"@commitlint/cli": "^16.2.3",

β€Žpackages/atomico/package.jsonβ€Ž

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,9 @@
77
"type": "module",
88
"typings": "index.d.ts",
99
"exports": {
10-
".": {
11-
"esbuild": "./index.ts",
12-
"default": "./index.js"
13-
},
14-
"./*": {
15-
"esbuild": "./*.ts",
16-
"default": "./*.js"
17-
},
18-
"./*.js": {
19-
"esbuild": "./*.ts",
20-
"default": "./*.js"
21-
}
10+
".": "./index.js",
11+
"./*": "./*.js",
12+
"./*.js": "./*.js"
2213
},
2314
"files": [
2415
"custom-elements.json",
@@ -30,8 +21,10 @@
3021
"**/*.js.map"
3122
],
3223
"scripts": {
33-
"prepublishOnly": "npm run build",
34-
"build": "tsc -b .",
24+
"prepublishOnly": "npm run analyze && npm run build",
25+
"build": "run-s build:*",
26+
"build:tsc": "tsc -b .",
27+
"build:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
3528
"analyze": "custom-elements-manifest analyze",
3629
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
3730
},

β€Žpackages/components/package.jsonβ€Ž

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,9 @@
77
"module": "index.js",
88
"customElements": "custom-elements.json",
99
"exports": {
10-
".": {
11-
"esbuild": "./index.ts",
12-
"default": "./index.js"
13-
},
14-
"./*": {
15-
"esbuild": "./*.ts",
16-
"default": "./*.js"
17-
},
18-
"./*.js": {
19-
"esbuild": "./*.ts",
20-
"default": "./*.js"
21-
}
10+
".": "./index.js",
11+
"./*": "./*.js",
12+
"./*.js": "./*.js"
2213
},
2314
"files": [
2415
"custom-elements.json",
@@ -33,7 +24,9 @@
3324
"prepublishOnly": "npm run build",
3425
"build": "run-s build:*",
3526
"build:analyze": "npm run analyze",
36-
"build:build": "tsc -b .",
27+
"build:build": "run-s build:build:*",
28+
"build:build:tsc": "tsc -b .",
29+
"build:babel:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
3730
"analyze": "custom-elements-manifest analyze --litelement",
3831
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
3932
},

β€Žpackages/core/package.jsonβ€Ž

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,9 @@
77
"type": "module",
88
"typings": "index.d.ts",
99
"exports": {
10-
".": {
11-
"esbuild": "./index.ts",
12-
"default": "./index.js"
13-
},
14-
"./*": {
15-
"esbuild": "./*.ts",
16-
"default": "./*.js"
17-
},
18-
"./*.js": {
19-
"esbuild": "./*.ts",
20-
"default": "./*.js"
21-
}
10+
".": "./index.js",
11+
"./*": "./*.js",
12+
"./*.js": "./*.js"
2213
},
2314
"files": [
2415
"custom-elements.json",
@@ -30,9 +21,11 @@
3021
"**/*.js.map"
3122
],
3223
"scripts": {
33-
"prepublishOnly": "npm run build",
34-
"build": "tsc -b .",
24+
"prepublishOnly": "npm run analyze && npm run build",
3525
"analyze": "custom-elements-manifest analyze",
26+
"build": "run-s build:*",
27+
"build:tsc": "tsc -b .",
28+
"build:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
3629
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
3730
},
3831
"repository": {

β€Žpackages/fast/package.jsonβ€Ž

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,11 @@
77
"type": "module",
88
"typings": "index.d.ts",
99
"exports": {
10-
".": {
11-
"esbuild": "./index.ts",
12-
"default": "./index.js"
13-
},
14-
"./*": {
15-
"esbuild": "./*.ts",
16-
"default": "./*.js"
17-
},
18-
"./*.js": {
19-
"esbuild": "./*.ts",
20-
"default": "./*.js"
21-
},
22-
"./bases/*": {
23-
"esbuild": "./bases/*.ts",
24-
"default": "./bases/*.js"
25-
},
26-
"./bases/*.js": {
27-
"esbuild": "./bases/*.ts",
28-
"default": "./bases/*.js"
29-
}
10+
".": "./index.js",
11+
"./*": "./*.js",
12+
"./*.js": "./*.js",
13+
"./bases/*": "./bases/*.js",
14+
"./bases/*.js": "./bases/*.js"
3015
},
3116
"files": [
3217
"custom-elements.json",
@@ -38,9 +23,11 @@
3823
"**/*.js.map"
3924
],
4025
"scripts": {
41-
"prepublishOnly": "npm run build",
42-
"build": "tsc -b .",
26+
"prepublishOnly": "npm run analyze && npm run build",
4327
"analyze": "custom-elements-manifest analyze --fast",
28+
"build": "run-s build:*",
29+
"build:tsc": "tsc -b .",
30+
"build:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
4431
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
4532
},
4633
"repository": {

0 commit comments

Comments
Β (0)