Skip to content

Commit

Permalink
lit update
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Nov 29, 2023
1 parent bf3424a commit 794f1cf
Show file tree
Hide file tree
Showing 11 changed files with 330 additions and 19 deletions.
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"license": "Apache-2.0",
"scripts": {
"postinstall": "patch-package",
"bootstrap": "lerna bootstrap",
"lint": "eslint -c package.json --ignore-path .gitignore --no-eslintrc .",
"format": "eslint -c package.json --ignore-path .gitignore --no-eslintrc --fix .",
Expand All @@ -31,6 +32,11 @@
"yarn": ">=1.22.0"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-logical-assignment-operators": "^7.14.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
"@open-wc/building-utils": "2.18.3",
"@open-wc/demoing-storybook": "2.4.7",
"@open-wc/storybook": "0.2.8",
Expand All @@ -42,11 +48,17 @@
"eslint-plugin-prettier": "3.3.1",
"lerna": "3.22.1",
"prettier": "1.19.1",
"polymer-cli": "^1.9.11",
"polymer-build": "3.1.4",
"symlink-dir": "4.1.0"
},
"dependencies": {
"@open-wc/storybook-prebuilt": "1.2.0",
"postinstall-postinstall": "2.1.0",
"rollup-plugin-cpy": "2.0.1"
},
"resolutions": {
"polymer-cli": "1.9.11",
"polymer-build": "3.1.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@
"@web/test-runner-puppeteer": "0.9.3"
},
"dependencies": {
"lit": "^2.7.5",
"@lit/reactive-element": "^1.0.0",
"lit-element": "^3.0.0",
"lit-html": "^2.0.0",
"lit": "^3.1.0",
"lit-element": "4.0.2",
"lit-html": "3.1.0",
"@lrnwebcomponents/deduping-fix": "^7.0.4"
},
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs"
},
"dependencies": {
"lit": "^2.7.5",
"@lrnwebcomponents/haxcms-elements": "^7.0.9",
"@lrnwebcomponents/simple-colors": "^7.0.5"
"lit": "^3.1.0",
"@lrnwebcomponents/haxcms-elements": "^7.0.18",
"@lrnwebcomponents/simple-colors": "^7.0.18"
},
"devDependencies": {
"@wcfactory/rollup-umd-build": "^0.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs"
},
"dependencies": {
"lit": "^2.7.5"
"lit": "^3.1.0"
},
"devDependencies": {
"@wcfactory/rollup-umd-build": "^0.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs"
},
"dependencies": {
"lit": "^2.7.5"
"lit": "^3.1.0"
},
"devDependencies": {
"@wcfactory/rollup-umd-build": "^0.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs"
},
"dependencies": {
"lit": "^2.7.5",
"@lrnwebcomponents/haxcms-elements": "^7.0.9",
"@lrnwebcomponents/simple-colors": "^7.0.5"
"lit": "^3.1.0",
"@lrnwebcomponents/haxcms-elements": "^7.0.18",
"@lrnwebcomponents/simple-colors": "^7.0.18"
},
"devDependencies": {
"@wcfactory/rollup-umd-build": "^0.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs"
},
"dependencies": {
"lit": "^2.7.5"
"lit": "^3.1.0"
},
"devDependencies": {
"@wcfactory/rollup-umd-build": "^0.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs"
},
"dependencies": {
"lit": "^2.7.5"
"lit": "^3.1.0"
},
"devDependencies": {
"@wcfactory/rollup-umd-build": "^0.12.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"fuse.js": "^3.4.2",
"graphql-tag": "^2.10.1",
"is-valid-element-name": "^1.0.0",
"lit": "^2.7.5",
"mobx": "^5.9.0"
"lit": "^3.1.0",
"mobx": "^6.12.0"
},
"devDependencies": {
"@open-wc/building-webpack": "0.1.10",
Expand Down
134 changes: 134 additions & 0 deletions patches/polymer-build+3.1.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
diff --git a/node_modules/polymer-build/lib/js-transform.js b/node_modules/polymer-build/lib/js-transform.js
index 00b71cb..9af536e 100644
--- a/node_modules/polymer-build/lib/js-transform.js
+++ b/node_modules/polymer-build/lib/js-transform.js
@@ -66,6 +66,17 @@ const babelTransformEs2018 = [
require('@babel/plugin-proposal-object-rest-spread'),
require('@babel/plugin-proposal-async-generator-functions'),
];
+const babelTransformEs2020 = [
+ require('@babel/plugin-proposal-optional-chaining'),
+ require('@babel/plugin-proposal-nullish-coalescing-operator'),
+ require('@babel/plugin-syntax-optional-catch-binding'),
+];
+const babelTransformEs2021 = [
+ require('@babel/plugin-proposal-logical-assignment-operators'),
+];
+const babelTransformEs2022 = [
+ require('@babel/plugin-proposal-class-properties'),
+];
// Loading this plugin removes inlined Babel helpers.
const babelExternalHelpersPlugin = require('@babel/plugin-external-helpers');
const babelTransformModulesAmd = [
@@ -136,21 +147,33 @@ function jsTransform(js, options) {
plugins.push(...babelTransformEs2016);
plugins.push(...babelTransformEs2017);
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
}
else if (options.compile === 'es2015') {
doBabelTransform = true;
plugins.push(...babelTransformEs2016);
plugins.push(...babelTransformEs2017);
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
}
else if (options.compile === 'es2016') {
doBabelTransform = true;
plugins.push(...babelTransformEs2017);
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
}
else if (options.compile === 'es2017') {
doBabelTransform = true;
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
}
if (options.moduleResolution === 'node') {
if (!options.filePath) {
@@ -180,6 +203,10 @@ function jsTransform(js, options) {
// tslint:disable-next-line: no-any
'importMeta',
'objectRestSpread',
+ 'optionalChaining',
+ 'nullishCoalescingOperator',
+ 'classProperties',
+ 'logicalAssignment',
],
});
}
diff --git a/node_modules/polymer-build/src/js-transform.ts b/node_modules/polymer-build/src/js-transform.ts
index 91e6a8b..cd03e46 100644
--- a/node_modules/polymer-build/src/js-transform.ts
+++ b/node_modules/polymer-build/src/js-transform.ts
@@ -73,6 +73,20 @@ const babelTransformEs2018 = [
require('@babel/plugin-proposal-async-generator-functions'),
];

+const babelTransformEs2020 = [
+ require('@babel/plugin-proposal-optional-chaining'),
+ require('@babel/plugin-proposal-nullish-coalescing-operator'),
+ require('@babel/plugin-syntax-optional-catch-binding'),
+];
+
+const babelTransformEs2021 = [
+ require('@babel/plugin-proposal-logical-assignment-operators'),
+];
+
+const babelTransformEs2022 = [
+ require('@babel/plugin-proposal-class-properties'),
+];
+
// Loading this plugin removes inlined Babel helpers.
const babelExternalHelpersPlugin = require('@babel/plugin-external-helpers');

@@ -207,18 +221,30 @@ export function jsTransform(js: string, options: JsTransformOptions): string {
plugins.push(...babelTransformEs2016);
plugins.push(...babelTransformEs2017);
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
} else if (options.compile === 'es2015') {
doBabelTransform = true;
plugins.push(...babelTransformEs2016);
plugins.push(...babelTransformEs2017);
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
} else if (options.compile === 'es2016') {
doBabelTransform = true;
plugins.push(...babelTransformEs2017);
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
} else if (options.compile === 'es2017') {
doBabelTransform = true;
plugins.push(...babelTransformEs2018);
+ plugins.push(...babelTransformEs2020);
+ plugins.push(...babelTransformEs2021);
+ plugins.push(...babelTransformEs2022);
}
if (options.moduleResolution === 'node') {
if (!options.filePath) {
@@ -258,6 +284,10 @@ export function jsTransform(js: string, options: JsTransformOptions): string {
// tslint:disable-next-line: no-any
'importMeta' as any,
'objectRestSpread',
+ 'optionalChaining',
+ 'nullishCoalescingOperator',
+ 'classProperties',
+ 'logicalAssignment'
],
});
} catch (e) {
Loading

0 comments on commit 794f1cf

Please sign in to comment.