@lynx-js/web-core 0.13.4 → 0.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @lynx-js/web-core
2
2
 
3
+ ## 0.13.5
4
+
5
+ ### Patch Changes
6
+
7
+ - refactor: move some internal status to dom's attribute ([#945](https://github.com/lynx-family/lynx-stack/pull/945))
8
+
9
+ It's essential for SSR
10
+
11
+ - refactor: avoid to create many style element for cssog ([#1026](https://github.com/lynx-family/lynx-stack/pull/1026))
12
+
13
+ - refactor: move component config info to attribute ([#984](https://github.com/lynx-family/lynx-stack/pull/984))
14
+
15
+ - fix: ensure render starts after dom connected ([#1020](https://github.com/lynx-family/lynx-stack/pull/1020))
16
+
17
+ - refactor: save dataset on an attribute ([#981](https://github.com/lynx-family/lynx-stack/pull/981))
18
+
19
+ On lynx, the `data-*` attributes have different behaviors than the HTMLElement has.
20
+
21
+ The dataset will be treated as properties, the key will not be applied the camel-case <-> hyphenate name transformation.
22
+
23
+ Before this commit we use it as a runtime data, but after this commit we will use encodeURI(JSON.stringify(dataset)) to encode it as a string.
24
+
25
+ - refactor: implement mts apis in closure pattern ([#1004](https://github.com/lynx-family/lynx-stack/pull/1004))
26
+
27
+ - Updated dependencies [[`70b82d2`](https://github.com/lynx-family/lynx-stack/commit/70b82d23744d6b6ec945dff9f8895ab3488ba4c8), [`5651e24`](https://github.com/lynx-family/lynx-stack/commit/5651e24827358963c3261252bcc53c2ad981c13e), [`9499ea9`](https://github.com/lynx-family/lynx-stack/commit/9499ea91debdf73b2d31af0b31bcbc216135543b), [`50f0193`](https://github.com/lynx-family/lynx-stack/commit/50f01933942268b697bf5abe790da86c932f1dfc), [`57bf0ef`](https://github.com/lynx-family/lynx-stack/commit/57bf0ef19f1d79bc52ab6a4f0cd2939e7901d98b), [`5651e24`](https://github.com/lynx-family/lynx-stack/commit/5651e24827358963c3261252bcc53c2ad981c13e), [`0525fbf`](https://github.com/lynx-family/lynx-stack/commit/0525fbf38baa7a977a7a8c66e8a4d8bf34cc3b68), [`b6b87fd`](https://github.com/lynx-family/lynx-stack/commit/b6b87fd11dbc76c28f3b5022aa8c6afeb773d90f), [`c014327`](https://github.com/lynx-family/lynx-stack/commit/c014327ad0cf599b32d4182d95116b46c35f5fa5)]:
28
+ - @lynx-js/web-mainthread-apis@0.13.5
29
+ - @lynx-js/web-constants@0.13.5
30
+ - @lynx-js/offscreen-document@0.1.1
31
+ - @lynx-js/web-worker-runtime@0.13.5
32
+ - @lynx-js/web-worker-rpc@0.13.5
33
+
3
34
  ## 0.13.4
4
35
 
5
36
  ### Patch Changes
@@ -54,6 +54,7 @@ export class LynxView extends HTMLElement {
54
54
  */
55
55
  static observedAttributes = LynxView.observedAttributeAsProperties.map(nm => nm.toLowerCase());
56
56
  #instance;
57
+ #connected = false;
57
58
  #url;
58
59
  /**
59
60
  * @public
@@ -304,7 +305,7 @@ export class LynxView extends HTMLElement {
304
305
  * @private
305
306
  */
306
307
  #render() {
307
- if (!this.#rendering) {
308
+ if (!this.#rendering && this.#connected) {
308
309
  this.#rendering = true;
309
310
  queueMicrotask(() => {
310
311
  this.#rendering = false;
@@ -382,6 +383,7 @@ export class LynxView extends HTMLElement {
382
383
  * @private
383
384
  */
384
385
  connectedCallback() {
386
+ this.#connected = true;
385
387
  this.#render();
386
388
  }
387
389
  }
@@ -7,13 +7,13 @@ export function createRenderAllOnUI(mainToBackgroundRpc, shadowRoot, markTimingI
7
7
  const { startMainThread } = prepareMainThreadAPIs(mainToBackgroundRpc, shadowRoot, document.createElement.bind(document), () => { }, markTimingInternal, () => {
8
8
  callbacks.onError?.();
9
9
  });
10
- let runtime;
10
+ let mtsGlobalThis;
11
11
  const start = async (configs) => {
12
12
  const mainThreadRuntime = startMainThread(configs);
13
- runtime = await mainThreadRuntime;
13
+ mtsGlobalThis = await mainThreadRuntime;
14
14
  };
15
15
  const updateDataMainThread = async (...args) => {
16
- runtime.updatePage?.(...args);
16
+ mtsGlobalThis.updatePage?.(...args);
17
17
  };
18
18
  return {
19
19
  start,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -24,15 +24,15 @@
24
24
  "**/*.css"
25
25
  ],
26
26
  "dependencies": {
27
- "@lynx-js/offscreen-document": "0.1.0",
28
- "@lynx-js/web-constants": "0.13.4",
29
- "@lynx-js/web-mainthread-apis": "0.13.4",
30
- "@lynx-js/web-worker-rpc": "0.13.4",
31
- "@lynx-js/web-worker-runtime": "0.13.4"
27
+ "@lynx-js/offscreen-document": "0.1.1",
28
+ "@lynx-js/web-constants": "0.13.5",
29
+ "@lynx-js/web-mainthread-apis": "0.13.5",
30
+ "@lynx-js/web-worker-rpc": "0.13.5",
31
+ "@lynx-js/web-worker-runtime": "0.13.5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@lynx-js/lynx-core": "0.1.2",
35
- "@lynx-js/web-elements": "0.7.4"
35
+ "@lynx-js/web-elements": "0.7.5"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@lynx-js/lynx-core": "0.1.2",