Skip to content

Commit

Permalink
fix: compile away class static blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Mar 29, 2022
1 parent 48f5fae commit 1bb1428
Show file tree
Hide file tree
Showing 14 changed files with 318 additions and 148 deletions.
14 changes: 14 additions & 0 deletions .changeset/soft-numbers-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@apollo-elements/atomico": patch
"@apollo-elements/components": patch
"@apollo-elements/core": patch
"@apollo-elements/fast": patch
"@apollo-elements/gluon": patch
"@apollo-elements/haunted": patch
"@apollo-elements/hybrids": patch
"@apollo-elements/lit-apollo": patch
"@apollo-elements/mixins": patch
"@apollo-elements/polymer": patch
---

Compiles away [class static blocks](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Class_static_initialization_blocks)
162 changes: 162 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
"@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0",
"@airbnb/node-memwatch": "^2.0.0",
"@apollo/client": "^3.5.9",
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-class-static-block": "^7.17.6",
"@borgar/textbox": "^1.3.0",
"@changesets/cli": "^2.22.0",
"@commitlint/cli": "^16.2.3",
Expand Down
21 changes: 7 additions & 14 deletions packages/atomico/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@
"type": "module",
"typings": "index.d.ts",
"exports": {
".": {
"esbuild": "./index.ts",
"default": "./index.js"
},
"./*": {
"esbuild": "./*.ts",
"default": "./*.js"
},
"./*.js": {
"esbuild": "./*.ts",
"default": "./*.js"
}
".": "./index.js",
"./*": "./*.js",
"./*.js": "./*.js"
},
"files": [
"custom-elements.json",
Expand All @@ -30,8 +21,10 @@
"**/*.js.map"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "tsc -b .",
"prepublishOnly": "npm run analyze && npm run build",
"build": "run-s build:*",
"build:tsc": "tsc -b .",
"build:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
"analyze": "custom-elements-manifest analyze",
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
},
Expand Down
19 changes: 6 additions & 13 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@
"module": "index.js",
"customElements": "custom-elements.json",
"exports": {
".": {
"esbuild": "./index.ts",
"default": "./index.js"
},
"./*": {
"esbuild": "./*.ts",
"default": "./*.js"
},
"./*.js": {
"esbuild": "./*.ts",
"default": "./*.js"
}
".": "./index.js",
"./*": "./*.js",
"./*.js": "./*.js"
},
"files": [
"custom-elements.json",
Expand All @@ -33,7 +24,9 @@
"prepublishOnly": "npm run build",
"build": "run-s build:*",
"build:analyze": "npm run analyze",
"build:build": "tsc -b .",
"build:build": "run-s build:build:*",
"build:build:tsc": "tsc -b .",
"build:babel:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
"analyze": "custom-elements-manifest analyze --litelement",
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
},
Expand Down
21 changes: 7 additions & 14 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@
"type": "module",
"typings": "index.d.ts",
"exports": {
".": {
"esbuild": "./index.ts",
"default": "./index.js"
},
"./*": {
"esbuild": "./*.ts",
"default": "./*.js"
},
"./*.js": {
"esbuild": "./*.ts",
"default": "./*.js"
}
".": "./index.js",
"./*": "./*.js",
"./*.js": "./*.js"
},
"files": [
"custom-elements.json",
Expand All @@ -30,9 +21,11 @@
"**/*.js.map"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "tsc -b .",
"prepublishOnly": "npm run analyze && npm run build",
"analyze": "custom-elements-manifest analyze",
"build": "run-s build:*",
"build:tsc": "tsc -b .",
"build:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
},
"repository": {
Expand Down
31 changes: 9 additions & 22 deletions packages/fast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,11 @@
"type": "module",
"typings": "index.d.ts",
"exports": {
".": {
"esbuild": "./index.ts",
"default": "./index.js"
},
"./*": {
"esbuild": "./*.ts",
"default": "./*.js"
},
"./*.js": {
"esbuild": "./*.ts",
"default": "./*.js"
},
"./bases/*": {
"esbuild": "./bases/*.ts",
"default": "./bases/*.js"
},
"./bases/*.js": {
"esbuild": "./bases/*.ts",
"default": "./bases/*.js"
}
".": "./index.js",
"./*": "./*.js",
"./*.js": "./*.js",
"./bases/*": "./bases/*.js",
"./bases/*.js": "./bases/*.js"
},
"files": [
"custom-elements.json",
Expand All @@ -38,9 +23,11 @@
"**/*.js.map"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "tsc -b .",
"prepublishOnly": "npm run analyze && npm run build",
"analyze": "custom-elements-manifest analyze --fast",
"build": "run-s build:*",
"build:tsc": "tsc -b .",
"build:babel": "babel --source-maps --ignore '*.config.js' --plugins @babel/plugin-proposal-class-static-block --out-dir . .",
"test": "wtr --coverage --config ../../web-test-runner.config.js --root-dir '../..' './*.test.ts'"
},
"repository": {
Expand Down
Loading

0 comments on commit 1bb1428

Please sign in to comment.