From 3d3dbfee36404db2687649a31ba36214a2874d1a Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Thu, 11 Jan 2024 10:02:23 +0200 Subject: [PATCH] feat: update to pion BREAKING CHANGE: Update to pion and allow lit@3 --- package-lock.json | 67 +++++--------------------- package.json | 2 +- src/directives/consume.ts | 4 +- src/directives/provide.ts | 4 +- src/elements/cz-icon.ts | 2 +- src/elements/cz-spinner.ts | 2 +- src/haunted-polymer.ts | 2 +- src/hooks/use-abort-signal.ts | 2 +- src/hooks/use-debounce-raf.ts | 2 +- src/hooks/use-drag-items.ts | 2 +- src/hooks/use-dropped-files.ts | 2 +- src/hooks/use-handle-drop.ts | 2 +- src/hooks/use-host-bounds.ts | 2 +- src/hooks/use-host.ts | 2 +- src/hooks/use-imperative-api.ts | 2 +- src/hooks/use-meta.ts | 2 +- src/hooks/use-notify-property.ts | 2 +- src/hooks/use-promise.js | 75 ++++++++++++++--------------- src/hooks/use-property.ts | 2 +- src/tag.ts | 19 +++++--- test/array.test.js | 5 +- test/consume.test.js | 24 +++++---- test/directive-lazy-until.test.js | 2 +- test/directive-measure.test.js | 2 +- test/directive-portal.test.js | 55 +++++++++++---------- test/directive-spread-props.test.js | 2 +- test/haunted-polymer.test.js | 2 +- test/provide.test.js | 21 ++++---- test/tag.test.js | 2 +- test/use-abort-signal.test.js | 2 +- test/use-debounce-raf.test.js | 2 +- test/use-dropped-files.test.js | 2 +- test/use-handle-drop.test.js | 2 +- test/use-host-bounds.test.js | 2 +- test/use-imperative-api.test.js | 16 +++--- test/use-meta.test.js | 2 +- test/use-notify-property.test.js | 2 +- test/use-promise.test.js | 2 +- 38 files changed, 152 insertions(+), 194 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28d81f1..a50388e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "5.39.0", "license": "Apache-2.0", "dependencies": { - "haunted": "^5.0.0" + "@pionjs/pion": "^2.0.0" }, "devDependencies": { "@commitlint/cli": "^18.0.0", @@ -1047,7 +1047,8 @@ "node_modules/@lit-labs/ssr-dom-shim": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.2.tgz", - "integrity": "sha512-jnOD+/+dSrfTWYfSXBXlo5l5f0q1UuJo3tkbMDCYA2lKUYq79jaxqtGEvnRoh049nt1vdo1+45RinipU6FGY2g==" + "integrity": "sha512-jnOD+/+dSrfTWYfSXBXlo5l5f0q1UuJo3tkbMDCYA2lKUYq79jaxqtGEvnRoh049nt1vdo1+45RinipU6FGY2g==", + "dev": true }, "node_modules/@lit/reactive-element": { "version": "2.0.3", @@ -1321,6 +1322,14 @@ "lit-html": "^2.0.0 || ^3.0.0" } }, + "node_modules/@pionjs/pion": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@pionjs/pion/-/pion-2.0.0.tgz", + "integrity": "sha512-Xznu1+e9Hfc64rqhNwlGPq6BsH2kd/Oc2besQ2dhosty+Uyl7sw+Sp9/12CyHmj/UYcxGsi1/+Iw0uwgx+kWGg==", + "dependencies": { + "lit-html": "^2.0.0 || ^3.0.0" + } + }, "node_modules/@playwright/test": { "version": "1.40.1", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", @@ -6259,42 +6268,6 @@ "node": ">= 0.4" } }, - "node_modules/haunted": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/haunted/-/haunted-5.0.0.tgz", - "integrity": "sha512-hyv9KIp4F6/oL5V6GQ6b85RQIcxdV/KTjfgLxkPozQOj+KmCVZ3pDuSzlAAXoZK0lOYLekumbDqZLfzloO2s3w==", - "dependencies": { - "lit": "^2.0.0" - } - }, - "node_modules/haunted/node_modules/@lit/reactive-element": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz", - "integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.0.0" - } - }, - "node_modules/haunted/node_modules/lit": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-2.8.0.tgz", - "integrity": "sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==", - "dependencies": { - "@lit/reactive-element": "^1.6.0", - "lit-element": "^3.3.0", - "lit-html": "^2.8.0" - } - }, - "node_modules/haunted/node_modules/lit-element": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.3.3.tgz", - "integrity": "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.1.0", - "@lit/reactive-element": "^1.3.0", - "lit-html": "^2.8.0" - } - }, "node_modules/hook-std": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", @@ -7400,28 +7373,10 @@ "lit-html": "^3.1.0" } }, - "node_modules/lit-element/node_modules/lit-html": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.1.tgz", - "integrity": "sha512-x/EwfGk2D/f4odSFM40hcGumzqoKv0/SUh6fBO+1Ragez81APrcAMPo1jIrCDd9Sn+Z4CT867HWKViByvkDZUA==", - "dev": true, - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, "node_modules/lit-html": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.8.0.tgz", - "integrity": "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==", - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, - "node_modules/lit/node_modules/lit-html": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.1.tgz", "integrity": "sha512-x/EwfGk2D/f4odSFM40hcGumzqoKv0/SUh6fBO+1Ragez81APrcAMPo1jIrCDd9Sn+Z4CT867HWKViByvkDZUA==", - "dev": true, "dependencies": { "@types/trusted-types": "^2.0.2" } diff --git a/package.json b/package.json index 17bdc9a..96a67af 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "./memoize": "./dist/memoize.js" }, "dependencies": { - "haunted": "^5.0.0" + "@pionjs/pion": "^2.0.0" }, "devDependencies": { "@commitlint/cli": "^18.0.0", diff --git a/src/directives/consume.ts b/src/directives/consume.ts index 6917879..c864268 100644 --- a/src/directives/consume.ts +++ b/src/directives/consume.ts @@ -1,5 +1,5 @@ -import { Context, ContextDetail } from 'haunted/lib/create-context'; -import { contextEvent } from 'haunted/lib/symbols'; +import { Context, ContextDetail } from '@pionjs/pion/lib/create-context'; +import { contextEvent } from '@pionjs/pion/lib/symbols'; import { AttributePart, noChange } from 'lit-html'; import { AsyncDirective, directive } from 'lit-html/async-directive.js'; import { ChildPart, DirectiveParameters } from 'lit-html/directive.js'; diff --git a/src/directives/provide.ts b/src/directives/provide.ts index 192dbe9..10c12f5 100644 --- a/src/directives/provide.ts +++ b/src/directives/provide.ts @@ -1,5 +1,5 @@ -import { Context, ContextDetail } from 'haunted/lib/create-context'; -import { contextEvent } from 'haunted/lib/symbols'; +import { Context, ContextDetail } from '@pionjs/pion/lib/create-context'; +import { contextEvent } from '@pionjs/pion/lib/symbols'; import { noChange, nothing } from 'lit-html'; import { AsyncDirective, directive } from 'lit-html/async-directive.js'; import { ChildPart } from 'lit-html/directive.js'; diff --git a/src/elements/cz-icon.ts b/src/elements/cz-icon.ts index 82281f9..a517fc3 100644 --- a/src/elements/cz-icon.ts +++ b/src/elements/cz-icon.ts @@ -1,6 +1,6 @@ import { html, svg } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { component } from 'haunted'; +import { component } from '@pionjs/pion'; interface Ico { icon?: ReturnType; diff --git a/src/elements/cz-spinner.ts b/src/elements/cz-spinner.ts index c54335a..61e7eaa 100644 --- a/src/elements/cz-spinner.ts +++ b/src/elements/cz-spinner.ts @@ -1,4 +1,4 @@ -import { component, html } from 'haunted'; +import { component, html } from '@pionjs/pion'; export const Spinner = () => html`