@lynx-js/web-constants 0.15.0 → 0.15.2
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 +24 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/types/Element.d.ts +1 -0
- package/dist/types/MainThreadGlobalThis.d.ts +8 -4
- package/dist/types/SSR.d.ts +22 -0
- package/dist/types/SSR.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/generateTemplate.js +4 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @lynx-js/web-constants
|
|
2
2
|
|
|
3
|
+
## 0.15.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: move SSR hydrate essential info to the ssr attribute ([#1292](https://github.com/lynx-family/lynx-stack/pull/1292))
|
|
8
|
+
|
|
9
|
+
We found that in browser there is no simple tool to decode a base64 string
|
|
10
|
+
|
|
11
|
+
Therefore we move the data to `ssr` attribute
|
|
12
|
+
|
|
13
|
+
Also fix some ssr issues
|
|
14
|
+
|
|
15
|
+
- feat: support \_\_MarkTemplateElement, \_\_MarkPartElement and \_\_GetTemplateParts for all-on-ui ([#1275](https://github.com/lynx-family/lynx-stack/pull/1275))
|
|
16
|
+
|
|
17
|
+
- Updated dependencies []:
|
|
18
|
+
- @lynx-js/web-worker-rpc@0.15.2
|
|
19
|
+
|
|
20
|
+
## 0.15.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies []:
|
|
25
|
+
- @lynx-js/web-worker-rpc@0.15.1
|
|
26
|
+
|
|
3
27
|
## 0.15.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/dist/constants.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export declare const lynxTagAttribute: "lynx-tag";
|
|
|
6
6
|
export declare const lynxDatasetAttribute: "l-dset";
|
|
7
7
|
export declare const lynxComponentConfigAttribute: "l-comp-cfg";
|
|
8
8
|
export declare const lynxDisposedAttribute: "l-disposed";
|
|
9
|
+
export declare const lynxElementTemplateMarkerAttribute: "l-template";
|
|
10
|
+
export declare const lynxPartIdAttribute: "l-part";
|
|
9
11
|
export declare const lynxDefaultDisplayLinearAttribute: "lynx-default-display-linear";
|
|
10
12
|
export declare const lynxDefaultOverflowVisibleAttribute: "lynx-default-overflow-visible";
|
|
11
13
|
export declare const __lynx_timing_flag: "__lynx_timing_flag";
|
package/dist/constants.js
CHANGED
|
@@ -9,6 +9,8 @@ export const lynxTagAttribute = 'lynx-tag';
|
|
|
9
9
|
export const lynxDatasetAttribute = 'l-dset';
|
|
10
10
|
export const lynxComponentConfigAttribute = 'l-comp-cfg';
|
|
11
11
|
export const lynxDisposedAttribute = 'l-disposed';
|
|
12
|
+
export const lynxElementTemplateMarkerAttribute = 'l-template';
|
|
13
|
+
export const lynxPartIdAttribute = 'l-part';
|
|
12
14
|
export const lynxDefaultDisplayLinearAttribute = 'lynx-default-display-linear';
|
|
13
15
|
export const lynxDefaultOverflowVisibleAttribute = 'lynx-default-overflow-visible';
|
|
14
16
|
export const __lynx_timing_flag = '__lynx_timing_flag';
|
package/dist/types/Element.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export interface ElementAnimationOptions {
|
|
|
35
35
|
timingOptions?: Record<string, any>;
|
|
36
36
|
}
|
|
37
37
|
export interface WebFiberElementImpl {
|
|
38
|
+
querySelectorAll?: (selectors: string) => WebFiberElementImpl[];
|
|
38
39
|
getAttributeNames: () => string[];
|
|
39
40
|
getAttribute: (name: string) => string | null;
|
|
40
41
|
setAttribute: (name: string, value: string) => void;
|
|
@@ -25,7 +25,7 @@ export type SetEventsPAPI = (element: WebFiberElementImpl, listeners: {
|
|
|
25
25
|
export type AppendElementPAPI = (parent: WebFiberElementImpl, child: WebFiberElementImpl) => void;
|
|
26
26
|
export type ElementIsEqualPAPI = (left: WebFiberElementImpl, right: WebFiberElementImpl) => boolean;
|
|
27
27
|
export type FirstElementPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
|
|
28
|
-
export type GetChildrenPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl[];
|
|
28
|
+
export type GetChildrenPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl[] | null;
|
|
29
29
|
export type GetParentPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
|
|
30
30
|
export type InsertElementBeforePAPI = (parent: WebFiberElementImpl, child: WebFiberElementImpl, ref?: WebFiberElementImpl | null) => WebFiberElementImpl;
|
|
31
31
|
export type LastElementPAPI = (element: WebFiberElementImpl) => WebFiberElementImpl | null;
|
|
@@ -75,11 +75,16 @@ export type AddInlineStylePAPI = (element: WebFiberElementImpl, key: number | st
|
|
|
75
75
|
export type SetInlineStylesPAPI = (element: WebFiberElementImpl, value: string | Record<string, string> | undefined) => void;
|
|
76
76
|
export type SetCSSIdPAPI = (elements: WebFiberElementImpl[], cssId: number | null) => void;
|
|
77
77
|
export type GetPageElementPAPI = () => WebFiberElementImpl | undefined;
|
|
78
|
-
export type
|
|
78
|
+
export type MarkTemplateElementPAPI = (element: WebFiberElementImpl) => void;
|
|
79
|
+
export type MarkPartElementPAPI = (element: WebFiberElementImpl, partId: string) => void;
|
|
80
|
+
export type GetTemplatePartsPAPI = (templateElement: WebFiberElementImpl) => Record<string, WebFiberElementImpl>;
|
|
79
81
|
interface JSErrorInfo {
|
|
80
82
|
release: string;
|
|
81
83
|
}
|
|
82
84
|
export interface MainThreadGlobalThis {
|
|
85
|
+
__GetTemplateParts?: GetTemplatePartsPAPI;
|
|
86
|
+
__MarkPartElement: MarkPartElementPAPI;
|
|
87
|
+
__MarkTemplateElement: MarkTemplateElementPAPI;
|
|
83
88
|
__AddEvent: AddEventPAPI;
|
|
84
89
|
__GetEvent: GetEventPAPI;
|
|
85
90
|
__GetEvents: GetEventsPAPI;
|
|
@@ -130,14 +135,13 @@ export interface MainThreadGlobalThis {
|
|
|
130
135
|
__SetInlineStyles: SetInlineStylesPAPI;
|
|
131
136
|
__SetCSSId: SetCSSIdPAPI;
|
|
132
137
|
__GetPageElement: GetPageElementPAPI;
|
|
133
|
-
__GetTemplateParts: GetTemplatePartsPAPI;
|
|
134
138
|
__globalProps: unknown;
|
|
135
139
|
SystemInfo: typeof systemInfo;
|
|
136
140
|
globalThis?: MainThreadGlobalThis;
|
|
137
141
|
lynx: MainThreadLynx;
|
|
138
142
|
processData?: ProcessDataCallback;
|
|
139
143
|
ssrEncode?: () => string;
|
|
140
|
-
ssrHydrate?: (encodeData?: string) => void;
|
|
144
|
+
ssrHydrate?: (encodeData?: string | null) => void;
|
|
141
145
|
_ReportError: (error: Error, _: unknown) => void;
|
|
142
146
|
_SetSourceMapRelease: (errInfo: JSErrorInfo) => void;
|
|
143
147
|
__OnLifecycleEvent: (lifeCycleEvent: Cloneable) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WebFiberElementImpl } from './Element.js';
|
|
2
|
+
import type { AddEventPAPI } from './MainThreadGlobalThis.js';
|
|
3
|
+
export type SSREventReplayInfo = [
|
|
4
|
+
number,
|
|
5
|
+
Parameters<AddEventPAPI>[1],
|
|
6
|
+
Parameters<AddEventPAPI>[2],
|
|
7
|
+
Parameters<AddEventPAPI>[3]
|
|
8
|
+
];
|
|
9
|
+
export type SSRDumpInfo = {
|
|
10
|
+
ssrEncodeData: string | null | undefined;
|
|
11
|
+
events: SSREventReplayInfo[];
|
|
12
|
+
};
|
|
13
|
+
export interface SSRHydrateInfo extends SSRDumpInfo {
|
|
14
|
+
/** WeakRef<Element> */
|
|
15
|
+
lynxUniqueIdToElement: WeakRef<WebFiberElementImpl>[];
|
|
16
|
+
/** for cssog */
|
|
17
|
+
lynxUniqueIdToStyleRulesIndex: number[];
|
|
18
|
+
cardStyleElement: HTMLStyleElement | null;
|
|
19
|
+
}
|
|
20
|
+
export type SSRDehydrateHooks = {
|
|
21
|
+
__AddEvent: AddEventPAPI;
|
|
22
|
+
};
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -62,6 +62,10 @@ const mainThreadInjectVars = [
|
|
|
62
62
|
'SystemInfo',
|
|
63
63
|
'_I18nResourceTranslation',
|
|
64
64
|
'_AddEventListener',
|
|
65
|
+
'__GetTemplateParts',
|
|
66
|
+
'__MarkPartElement',
|
|
67
|
+
'__MarkTemplateElement',
|
|
68
|
+
'__GetPageElement',
|
|
65
69
|
];
|
|
66
70
|
const backgroundInjectVars = [
|
|
67
71
|
'NativeModules',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/web-constants",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"**/*.css"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@lynx-js/web-worker-rpc": "0.15.
|
|
26
|
+
"@lynx-js/web-worker-rpc": "0.15.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@lynx-js/offscreen-document": "0.1.3"
|