@lynx-js/web-core 0.7.0
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 +597 -0
- package/LICENSE.txt +202 -0
- package/Notice.txt +1 -0
- package/README.md +21 -0
- package/dist/apis/LynxView.d.ts +137 -0
- package/dist/apis/LynxView.js +368 -0
- package/dist/apis/createLynxView.d.ts +18 -0
- package/dist/apis/createLynxView.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/types/LynxExposureModule.d.ts +4 -0
- package/dist/types/LynxExposureModule.js +5 -0
- package/dist/types/RuntimePropertyOnElement.d.ts +17 -0
- package/dist/types/RuntimePropertyOnElement.js +2 -0
- package/dist/types/UpdatePageCallback.d.ts +7 -0
- package/dist/types/UpdatePageCallback.js +2 -0
- package/dist/uiThread/bootWorkers.d.ts +8 -0
- package/dist/uiThread/bootWorkers.js +60 -0
- package/dist/uiThread/crossThreadHandlers/bootTimingSystem.d.ts +5 -0
- package/dist/uiThread/crossThreadHandlers/bootTimingSystem.js +50 -0
- package/dist/uiThread/crossThreadHandlers/createDispose.d.ts +3 -0
- package/dist/uiThread/crossThreadHandlers/createDispose.js +11 -0
- package/dist/uiThread/crossThreadHandlers/createExposureService.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/createExposureService.js +55 -0
- package/dist/uiThread/crossThreadHandlers/createUpdateData.d.ts +3 -0
- package/dist/uiThread/crossThreadHandlers/createUpdateData.js +14 -0
- package/dist/uiThread/crossThreadHandlers/queryNodes.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/queryNodes.js +65 -0
- package/dist/uiThread/crossThreadHandlers/registerFlushElementTreeHandler.d.ts +18 -0
- package/dist/uiThread/crossThreadHandlers/registerFlushElementTreeHandler.js +116 -0
- package/dist/uiThread/crossThreadHandlers/registerInvokeUIMethodHandler.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/registerInvokeUIMethodHandler.js +51 -0
- package/dist/uiThread/crossThreadHandlers/registerLoadNewTagHandler.d.ts +3 -0
- package/dist/uiThread/crossThreadHandlers/registerLoadNewTagHandler.js +7 -0
- package/dist/uiThread/crossThreadHandlers/registerNativeModulesCallHandler.d.ts +3 -0
- package/dist/uiThread/crossThreadHandlers/registerNativeModulesCallHandler.js +5 -0
- package/dist/uiThread/crossThreadHandlers/registerReportErrorHandler.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/registerReportErrorHandler.js +10 -0
- package/dist/uiThread/crossThreadHandlers/registerSelectComponentHandler.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/registerSelectComponentHandler.js +15 -0
- package/dist/uiThread/crossThreadHandlers/registerSetNativePropsHandler.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/registerSetNativePropsHandler.js +32 -0
- package/dist/uiThread/crossThreadHandlers/registerTriggerComponentEventHandler.d.ts +2 -0
- package/dist/uiThread/crossThreadHandlers/registerTriggerComponentEventHandler.js +14 -0
- package/dist/uiThread/decodeElementOperation.d.ts +13 -0
- package/dist/uiThread/decodeElementOperation.js +183 -0
- package/dist/uiThread/getElementTag.d.ts +1 -0
- package/dist/uiThread/getElementTag.js +20 -0
- package/dist/uiThread/startUIThread.d.ts +7 -0
- package/dist/uiThread/startUIThread.js +78 -0
- package/dist/utils/browser.d.ts +3 -0
- package/dist/utils/browser.js +9 -0
- package/dist/utils/createCrossThreadEvent.d.ts +2 -0
- package/dist/utils/createCrossThreadEvent.js +43 -0
- package/dist/utils/loadTemplate.d.ts +2 -0
- package/dist/utils/loadTemplate.js +53 -0
- package/index.css +66 -0
- package/package.json +34 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
# @lynx-js/web-core
|
|
2
|
+
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1abf8f0: feat(web):
|
|
8
|
+
|
|
9
|
+
**This is a breaking change**
|
|
10
|
+
|
|
11
|
+
1. A new param for `lynx-view`: `nativeModulesUrl`, which allows you to pass an esm url to add a new module to `NativeModules`. And we bind the `nativeModulesCall` method to each function on the module, run `this.nativeModulesCall()` to trigger onNativeModulesCall.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
export type NativeModuleHandlerContext = {
|
|
15
|
+
nativeModulesCall: (name: string, data: Cloneable) => Promise<Cloneable>;
|
|
16
|
+
};
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
a simple case:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
lynxView.nativeModules = URL.createObjectURL(
|
|
23
|
+
new Blob(
|
|
24
|
+
[
|
|
25
|
+
`export default {
|
|
26
|
+
myNativeModules: {
|
|
27
|
+
async getColor(data, callback) {
|
|
28
|
+
// trigger onNativeModulesCall and get the result
|
|
29
|
+
const color = await this.nativeModulesCall('getColor', data);
|
|
30
|
+
// return the result to caller
|
|
31
|
+
callback(color);
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
};`,
|
|
35
|
+
],
|
|
36
|
+
{ type: 'text/javascript' },
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. `onNativeModulesCall` is no longer the value handler of `NativeModules.bridge.call`, it will be the value handler of all `NativeModules` modules.
|
|
42
|
+
|
|
43
|
+
**Warning: This is a breaking change.**
|
|
44
|
+
|
|
45
|
+
Before this commit, you listen to `NativeModules.bridge.call('getColor')` like this:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
lynxView.onNativeModulesCall = (name, data, callback) => {
|
|
49
|
+
if (name === 'getColor') {
|
|
50
|
+
callback(data.color);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Now you should use it like this:
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
lynxView.onNativeModulesCall = (name, data, moduleName) => {
|
|
59
|
+
if (name === 'getColor' && moduleName === 'bridge') {
|
|
60
|
+
return data.color;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
You need to use `moduleName` to determine the NativeModules-module. And you don’t need to run callback, just return the result!
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [1abf8f0]
|
|
70
|
+
- @lynx-js/web-worker-runtime@0.7.0
|
|
71
|
+
- @lynx-js/web-constants@0.7.0
|
|
72
|
+
- @lynx-js/web-worker-rpc@0.7.0
|
|
73
|
+
|
|
74
|
+
## 0.6.2
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- 15381ca: fix: the 'page' should have default style width:100%; height:100%;
|
|
79
|
+
- 0412db0: fix: The runtime wrapper parameter name is changed from `runtime` to `lynx_runtime`.
|
|
80
|
+
|
|
81
|
+
This is because some project logic may use `runtime`, which may cause duplication of declarations.
|
|
82
|
+
|
|
83
|
+
- 2738fdc: feat: support linear-direction
|
|
84
|
+
- Updated dependencies [0412db0]
|
|
85
|
+
- Updated dependencies [085b99e]
|
|
86
|
+
- @lynx-js/web-constants@0.6.2
|
|
87
|
+
- @lynx-js/web-worker-runtime@0.6.2
|
|
88
|
+
- @lynx-js/web-worker-rpc@0.6.2
|
|
89
|
+
|
|
90
|
+
## 0.6.1
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- 9c25c3d: feat: support synchronously chunk loading
|
|
95
|
+
|
|
96
|
+
now the `lynx.requireModule` is available in bts.
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [62b7841]
|
|
99
|
+
- @lynx-js/web-worker-runtime@0.6.1
|
|
100
|
+
- @lynx-js/web-constants@0.6.1
|
|
101
|
+
- @lynx-js/web-worker-rpc@0.6.1
|
|
102
|
+
|
|
103
|
+
## 0.6.0
|
|
104
|
+
|
|
105
|
+
### Minor Changes
|
|
106
|
+
|
|
107
|
+
- e406d69: refractor: update output json format
|
|
108
|
+
|
|
109
|
+
**This is a breaking change**
|
|
110
|
+
|
|
111
|
+
Before this change the style info is dump in Javascript code.
|
|
112
|
+
|
|
113
|
+
After this change the style info will be pure JSON data.
|
|
114
|
+
|
|
115
|
+
Now we're using the css-serializer tool's output only. If you're using plugins for it, now they're enabled.
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- bfae2ab: feat: We will only preheat the mainThreadWorker now, and the backgroundWorker will be created when renderPage is called, which can save some memory.
|
|
120
|
+
|
|
121
|
+
Before this change, We will preheat two workers: mainThreadWorker and backgroundWorker.
|
|
122
|
+
|
|
123
|
+
- b80e2bb: feat: add reload() method
|
|
124
|
+
- Updated dependencies [e406d69]
|
|
125
|
+
- @lynx-js/web-worker-runtime@0.6.0
|
|
126
|
+
- @lynx-js/web-constants@0.6.0
|
|
127
|
+
- @lynx-js/web-worker-rpc@0.6.0
|
|
128
|
+
|
|
129
|
+
## 0.5.1
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- c49b1fb: feat: updateData api needs to have the correct format, now you can pass a callback.
|
|
134
|
+
- ee340da: feat: add SystemInfo.platform as 'web'. now you can use `SystemInfo.platform`.
|
|
135
|
+
- b5ef20e: feat: updateData should also call `updatePage` in main-thread.
|
|
136
|
+
- Updated dependencies [c49b1fb]
|
|
137
|
+
- Updated dependencies [ee340da]
|
|
138
|
+
- Updated dependencies [b5ef20e]
|
|
139
|
+
- @lynx-js/web-constants@0.5.1
|
|
140
|
+
- @lynx-js/web-worker-runtime@0.5.1
|
|
141
|
+
- @lynx-js/web-worker-rpc@0.5.1
|
|
142
|
+
|
|
143
|
+
## 0.5.0
|
|
144
|
+
|
|
145
|
+
### Minor Changes
|
|
146
|
+
|
|
147
|
+
- 7b84edf: feat: introduce new output chunk format
|
|
148
|
+
|
|
149
|
+
**This is a breaking change**
|
|
150
|
+
|
|
151
|
+
After this commit, we new introduce a new output format for web platform.
|
|
152
|
+
|
|
153
|
+
This new output file is a JSON file, includes all essential info.
|
|
154
|
+
|
|
155
|
+
Now we'll add the chunk global scope wrapper on runtime, this will help us to provide a better backward compatibility.
|
|
156
|
+
|
|
157
|
+
Also we have a intergrated output file cache for one session.
|
|
158
|
+
|
|
159
|
+
Now your `output.filename` will work.
|
|
160
|
+
|
|
161
|
+
The split-chunk feature has been temporary removed until the rspeedy team supports this feature for us.
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- 3050faf: refractor: housekeeping
|
|
166
|
+
- dc6216c: feat: add selectComponent of nativeApp
|
|
167
|
+
- 5eaa052: refractor: unifiying worker runtime
|
|
168
|
+
- Updated dependencies [04607bd]
|
|
169
|
+
- Updated dependencies [3050faf]
|
|
170
|
+
- Updated dependencies [7b84edf]
|
|
171
|
+
- Updated dependencies [e0f0793]
|
|
172
|
+
- @lynx-js/web-worker-rpc@0.5.0
|
|
173
|
+
- @lynx-js/web-worker-runtime@0.5.0
|
|
174
|
+
- @lynx-js/web-constants@0.5.0
|
|
175
|
+
|
|
176
|
+
## 0.4.2
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- 958efda: feat(web): bundle background.js into main-thread.js for web
|
|
181
|
+
|
|
182
|
+
To enable this feature:
|
|
183
|
+
|
|
184
|
+
1. set the performance.chunkSplit.strategy to `all-in-one`
|
|
185
|
+
2. use the `mode:'production'` to build
|
|
186
|
+
|
|
187
|
+
The output will be only one file.
|
|
188
|
+
|
|
189
|
+
- 283e6bd: fix: invoke callback should be called after invoke && the correct callback params should be passed to callback function.
|
|
190
|
+
|
|
191
|
+
Before this commit the invoke() success and fail callback function was be called.
|
|
192
|
+
|
|
193
|
+
- 8d583f5: refactor: organize internal dependencies
|
|
194
|
+
- 8cd3f65: feat: add triggerComponentEvent of NativeApp.
|
|
195
|
+
- 38f21e4: fix: avoid card freezing on the background.js starts too fast
|
|
196
|
+
|
|
197
|
+
if the background thread starts too fast, Reactlynx runtime will assign an lazy handler first and then replace it by the real handler.
|
|
198
|
+
|
|
199
|
+
Before this commit we cannot handle such "replace" operation for cross-threading call.
|
|
200
|
+
|
|
201
|
+
Now we fix this issue
|
|
202
|
+
|
|
203
|
+
- 8714140: fix(web): check and assign globalThis property of nativeTTObject
|
|
204
|
+
- 7c3c2a1: feat: support `sendGlobalEvent` method.
|
|
205
|
+
|
|
206
|
+
Now developers can do this:
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
const lynxView = createLynxView(configs);
|
|
210
|
+
lynxView.sendGlobalEvent(eventName, params);
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
- 168b4fa: feat: rename CloneableObject to Cloneable, Now its type refers to a structure that can be cloned; CloneableObject type is added, which only refers to object types that can be cloned.
|
|
214
|
+
- Updated dependencies [8d583f5]
|
|
215
|
+
- Updated dependencies [38f21e4]
|
|
216
|
+
- Updated dependencies [168b4fa]
|
|
217
|
+
- @lynx-js/web-worker-rpc@0.4.2
|
|
218
|
+
- @lynx-js/web-constants@0.4.2
|
|
219
|
+
- @lynx-js/web-mainthread-apis@0.4.2
|
|
220
|
+
|
|
221
|
+
## 0.4.1
|
|
222
|
+
|
|
223
|
+
### Patch Changes
|
|
224
|
+
|
|
225
|
+
- 2a49a42: fix(web): gen 2nd parameter for updateData
|
|
226
|
+
- 084eb17: feat: At any time, a worker is reserved for preheating subsequent cards.
|
|
227
|
+
- d3eac58: fix(web): refractor worker terminate system
|
|
228
|
+
- de2f62b: fix(web): performance doesn't handle main-thread timings correctly
|
|
229
|
+
- e72aae0: feat(web): support onNativeAppReady
|
|
230
|
+
- 27c0e6e: feat(web): infer the cssId if parent component unique id is set
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
(The following info is provided for DSL maintainers)
|
|
234
|
+
|
|
235
|
+
- the 'infer' operation only happens on fiber element creating, changing the parent's cssId, changing children's parent component unique id will cause an issue
|
|
236
|
+
- __SetCSSId will be called for setting inferred cssId value. Runtime could use the same `__SetCSSId` to overwrite this value.
|
|
237
|
+
- cssId: `0` will be treated as an void value
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
- 500057e: fix: `__GetElementUniqueID` return -1 for illegal param
|
|
241
|
+
|
|
242
|
+
(Only DSL developers need to care this)
|
|
243
|
+
|
|
244
|
+
- Updated dependencies [27c0e6e]
|
|
245
|
+
- Updated dependencies [500057e]
|
|
246
|
+
- @lynx-js/web-mainthread-apis@0.4.1
|
|
247
|
+
- @lynx-js/web-constants@0.4.1
|
|
248
|
+
|
|
249
|
+
## 0.4.0
|
|
250
|
+
|
|
251
|
+
### Minor Changes
|
|
252
|
+
|
|
253
|
+
- a3c39d6: fix: enableRemoveCSSScope:false with descendant combinator does not work
|
|
254
|
+
|
|
255
|
+
**THIS IS A BREAKING CHANGE**
|
|
256
|
+
|
|
257
|
+
Before this commit, we will add a [lynx-css-id=""] selector at the beginning of all selector, like this
|
|
258
|
+
|
|
259
|
+
```css
|
|
260
|
+
[lynx-css-id="12345"].bg-pink {
|
|
261
|
+
background-color: pink;
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
However, for selector with descendant combinator, this will cause an issue
|
|
266
|
+
|
|
267
|
+
```css
|
|
268
|
+
[lynx-css-id="12345"].light .bg-pink {
|
|
269
|
+
background-color: pink;
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
What we actually want is
|
|
274
|
+
|
|
275
|
+
```css
|
|
276
|
+
.light .bg-pink[lynx-css-id="12345"] {
|
|
277
|
+
background-color: pink;
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
After this commit, we changed the data structor of the styleinfo which bundled into the main-thread.js.
|
|
282
|
+
This allows us to add class selectors at the begining of selector and the end of plain selector(before the pseudo part).
|
|
283
|
+
|
|
284
|
+
**THIS IS A BREAKING CHANGE**
|
|
285
|
+
|
|
286
|
+
After this version, you will need to upgrade the version of @lynx-js/web-core^0.4.0
|
|
287
|
+
|
|
288
|
+
- 2dd0aef: feat: support performance apis for lynx
|
|
289
|
+
|
|
290
|
+
- support `nativeApp.generatePipelineOptions`
|
|
291
|
+
- support `nativeApp.onPipelineStart`
|
|
292
|
+
- support `nativeApp.markPipelineTiming`
|
|
293
|
+
- support `nativeApp.bindPipelineIdWithTimingFlag`
|
|
294
|
+
|
|
295
|
+
for lynx developers, the following apis are now supported
|
|
296
|
+
|
|
297
|
+
- `lynx.performance.addTimingListener`
|
|
298
|
+
- `__lynx_timing_flag` attribute
|
|
299
|
+
|
|
300
|
+
for lynx-view container developers
|
|
301
|
+
|
|
302
|
+
- `mainChunkReady` event has been removed
|
|
303
|
+
- add a new `timing` event
|
|
304
|
+
|
|
305
|
+
### Patch Changes
|
|
306
|
+
|
|
307
|
+
- 3123b86: fix(web): do not use @scope for safari for enableCSSSelector:false
|
|
308
|
+
|
|
309
|
+
We this there is a bug in webkit.
|
|
310
|
+
|
|
311
|
+
- 585d55a: feat(web): support animation-_ and transition-_ event
|
|
312
|
+
|
|
313
|
+
Now we will append the correct `event.params` property for animation events and transition events
|
|
314
|
+
|
|
315
|
+
- @lynx-js/web-constants@0.4.0
|
|
316
|
+
- @lynx-js/web-mainthread-apis@0.4.0
|
|
317
|
+
|
|
318
|
+
## 0.3.1
|
|
319
|
+
|
|
320
|
+
### Patch Changes
|
|
321
|
+
|
|
322
|
+
- 9f2ad5e: feat: add worker name for debug
|
|
323
|
+
|
|
324
|
+
before this commit, all web workers will be named as `main-thread` or `worker-thread`
|
|
325
|
+
|
|
326
|
+
now we name based on it's entryId
|
|
327
|
+
|
|
328
|
+
- 583c003: fix:
|
|
329
|
+
|
|
330
|
+
1. custom-element pre-check before define to avoid duplicate registration.
|
|
331
|
+
|
|
332
|
+
2. make sure @lynx-js/lynx-core is bundled into @lynx-js/web-core.
|
|
333
|
+
|
|
334
|
+
- 61a7014: refractor: migrate to publishEvent
|
|
335
|
+
- c3726e8: feat: pre heat the worker runtime at the very beginning
|
|
336
|
+
|
|
337
|
+
We cecently found that the worker booting takes some time.
|
|
338
|
+
|
|
339
|
+
Here we boot the first 2 workers for the first lynx-view.
|
|
340
|
+
|
|
341
|
+
This will help use to improve performance
|
|
342
|
+
|
|
343
|
+
- @lynx-js/web-constants@0.3.1
|
|
344
|
+
- @lynx-js/web-mainthread-apis@0.3.1
|
|
345
|
+
|
|
346
|
+
## 0.3.0
|
|
347
|
+
|
|
348
|
+
### Minor Changes
|
|
349
|
+
|
|
350
|
+
- 267c935: feat: make cardType could be configurable
|
|
351
|
+
- f44c589: feat: support exports field of the lynx-core
|
|
352
|
+
|
|
353
|
+
### Patch Changes
|
|
354
|
+
|
|
355
|
+
- 884e31c: fix: bind lazy rpc handlers
|
|
356
|
+
- 6e873bc: fix: incorrect parent component id value on publishComponentEvent
|
|
357
|
+
- Updated dependencies [d255d24]
|
|
358
|
+
- Updated dependencies [6e873bc]
|
|
359
|
+
- Updated dependencies [267c935]
|
|
360
|
+
- @lynx-js/web-mainthread-apis@0.3.0
|
|
361
|
+
- @lynx-js/web-constants@0.3.0
|
|
362
|
+
|
|
363
|
+
## 0.2.0
|
|
364
|
+
|
|
365
|
+
### Minor Changes
|
|
366
|
+
|
|
367
|
+
- 32d47c4: chore: upgrate dep version of web-core
|
|
368
|
+
|
|
369
|
+
### Patch Changes
|
|
370
|
+
|
|
371
|
+
- 272db24: refractor: the main-thread worker will be dedicated for every lynx view
|
|
372
|
+
- @lynx-js/web-constants@0.2.0
|
|
373
|
+
- @lynx-js/web-mainthread-apis@0.2.0
|
|
374
|
+
|
|
375
|
+
## 0.1.0
|
|
376
|
+
|
|
377
|
+
### Minor Changes
|
|
378
|
+
|
|
379
|
+
- 78638dc: feat: support invokeUIMethod and setNativeProps
|
|
380
|
+
- 06fe3cd: feat: support splitchunk and lynx.requireModuleAsync
|
|
381
|
+
|
|
382
|
+
- support splitchunk option of rspeedy
|
|
383
|
+
- add implementation for lynx.requireModuleAsync for both main-thread and background-thread
|
|
384
|
+
- mark worker `ready` after \_OnLifeCycleEvent is assigned
|
|
385
|
+
|
|
386
|
+
close #96
|
|
387
|
+
|
|
388
|
+
- fe0d06f: feat: add onError callback to `LynxCard`
|
|
389
|
+
|
|
390
|
+
The onError callback is a wrapper of the ElementAPI `_reportError`.
|
|
391
|
+
|
|
392
|
+
This allows the externel caller to detect errors.
|
|
393
|
+
|
|
394
|
+
- 66ce343: feat: support config `defaultDisplayLinear`
|
|
395
|
+
- c43f436: feat: add `dispose()` method for lynxview
|
|
396
|
+
- 068f677: feat: suppport createSelectorQuery
|
|
397
|
+
- 3547621: feat(web): use `<lynx-wrapper/>` to replace `<div style="display:content"/>`
|
|
398
|
+
- d551d81: feat: support customSection
|
|
399
|
+
|
|
400
|
+
- support lynx.getCustomSection
|
|
401
|
+
- support lynx.getCustomSectionSync
|
|
402
|
+
|
|
403
|
+
- f1ddb5a: feat: never need to pass background entry url
|
|
404
|
+
- b323923: feat(web): support **ReplaceElement, **CreateImage, \_\_CreateScrollView
|
|
405
|
+
- 3a370ab: feat: support global identifier `lynxCoreInject` and `SystemInfo`
|
|
406
|
+
- 23e6fa5: feat(web): support enableCSSSelector:false
|
|
407
|
+
|
|
408
|
+
We will extract all selectors with single class selector and rules in a Json object.
|
|
409
|
+
|
|
410
|
+
These classes will be applied on runtime.
|
|
411
|
+
|
|
412
|
+
**About enableCSSSelector:false**
|
|
413
|
+
|
|
414
|
+
This flag changes the behaviour of cascading. It provide a way to do this
|
|
415
|
+
|
|
416
|
+
```jsx
|
|
417
|
+
<view class='class-a class-b' />;
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
The class-b will override (cascading) styles of class-a.
|
|
421
|
+
|
|
422
|
+
- 39cf3ae: feat: improve performance for supporting linear layout
|
|
423
|
+
|
|
424
|
+
Before this commit, we'll use `getComputedStyle()` to find out if a dom is a linear container.
|
|
425
|
+
|
|
426
|
+
After this commit, we'll use the css variable cyclic toggle pattern and `@container style()`
|
|
427
|
+
|
|
428
|
+
This feature requires **Chrome 111, Safari 18**.
|
|
429
|
+
|
|
430
|
+
We'll provide a fallback implementation for firefox and legacy browsers.
|
|
431
|
+
|
|
432
|
+
After this commit, your `flex-direction`, `flex-shrink`, `flex`, `flex-grow`, `flex-basis` will be transformed to a css variable expression.
|
|
433
|
+
|
|
434
|
+
- 2973ba5: feat: move lynx main-thread to web worker
|
|
435
|
+
|
|
436
|
+
Move The Mainthread of Lynx to a web worker.
|
|
437
|
+
|
|
438
|
+
This helps the performance.
|
|
439
|
+
|
|
440
|
+
- 6327fa8: feat(web): add support for \_\_CreateWrapperElement
|
|
441
|
+
- 2047658: feat: support exposure system
|
|
442
|
+
|
|
443
|
+
support the following APIs:
|
|
444
|
+
|
|
445
|
+
- lynx.stopExposure({sendEvent?:boolean})
|
|
446
|
+
- lynx.resumeExposure()
|
|
447
|
+
- GlobalEvent: 'exposure'
|
|
448
|
+
- GlobalEvent: 'disexposure'
|
|
449
|
+
- uiappear event
|
|
450
|
+
- uidisappear event
|
|
451
|
+
|
|
452
|
+
- 269bf61: feat: support rspeedy layer model and support sharing chunk between main and background
|
|
453
|
+
- c95430c: feat: support `updateData`
|
|
454
|
+
|
|
455
|
+
Now developers can do this:
|
|
456
|
+
|
|
457
|
+
```javascript
|
|
458
|
+
const lynxView = createLynxView(configs);
|
|
459
|
+
lynxView.updateData(newData);
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
- 29f24aa: feat(web): support removeCSSScope:false
|
|
463
|
+
|
|
464
|
+
- add element api `__SetCSSId`
|
|
465
|
+
- add new WebpackPlugin `@lynx-js/web-webpack-plugin`
|
|
466
|
+
- add support for removeCSSSCope
|
|
467
|
+
- pass all configs via thie \*.lepus.js
|
|
468
|
+
- support to scope styles of lynx card for browsers do not support `@scope` and nesting
|
|
469
|
+
|
|
470
|
+
- 216ed68: feat: add a new <lynx-view> element
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
* @param {string} url [required] The url of the entry of your Lynx card
|
|
474
|
+
* @param {Cloneable} globalProps [optional] The globalProps value of this Lynx card
|
|
475
|
+
* @param {Cloneable} initData [oprional] The initial data of this Lynx card
|
|
476
|
+
* @param {Record<string,string>} overrideLynxTagToHTMLTagMap [optional] use this property/attribute to override the lynx tag -> html tag map
|
|
477
|
+
* @param {NativeModulesCallHandler} onNativeModulesCall [optional] the NativeModules.bridge.call value handler. Arguments will be cached before this property is assigned.
|
|
478
|
+
*
|
|
479
|
+
* @property entryId the currently Lynx view entryId.
|
|
480
|
+
*
|
|
481
|
+
* @event error lynx card fired an error
|
|
482
|
+
* @event mainchunkready performance event. All mainthread chunks are ready
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
- HTML Exmaple
|
|
486
|
+
|
|
487
|
+
Note that you should declarae the size of lynx-view
|
|
488
|
+
|
|
489
|
+
```html
|
|
490
|
+
<lynx-view
|
|
491
|
+
url="https://path/to/main-thread.js"
|
|
492
|
+
rawData="{}"
|
|
493
|
+
globalProps="{}"
|
|
494
|
+
style="height:300px;width:300px"
|
|
495
|
+
>
|
|
496
|
+
</lynx-view>
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
- React 19 Example
|
|
500
|
+
|
|
501
|
+
```jsx
|
|
502
|
+
<lynx-view url={myLynxCardUrl} rawData={{}} globalProps={{}} style={{height:'300px', width:'300px'}}>
|
|
503
|
+
</lynx-vew>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
- f8d1d98: feat: allow custom elements to be lazy loaded
|
|
507
|
+
|
|
508
|
+
After this commit, we'll allow developer to define custom elements lazy.
|
|
509
|
+
|
|
510
|
+
A new api `onElementLoad` will be added to the `LynxCard`.
|
|
511
|
+
|
|
512
|
+
Once a new element is creating, it will be called with the tag name.
|
|
513
|
+
|
|
514
|
+
There is also a simple way to use this feature
|
|
515
|
+
|
|
516
|
+
```javascript
|
|
517
|
+
import { LynxCard } from '@lynx-js/web-core';
|
|
518
|
+
import { loadElement } from '@lynx-js/web-elements/lazy';
|
|
519
|
+
import '@lynx-js/web-elements/index.css';
|
|
520
|
+
import '@lynx-js/web-core/index.css';
|
|
521
|
+
import './index.css';
|
|
522
|
+
|
|
523
|
+
const lynxcard = new LynxCard({
|
|
524
|
+
...beforeConfigs,
|
|
525
|
+
onElementLoad: loadElement,
|
|
526
|
+
});
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
- 906e894: feat(web): support dataset & \_\_AddDataset
|
|
530
|
+
- 6e003e8: feat(web): support linear layout and add tests
|
|
531
|
+
- 2b85d73: feat(web): support Nativemodules.bridge.call
|
|
532
|
+
- 0fc1826: feat(web): add \_\_CreateListElement Element API
|
|
533
|
+
|
|
534
|
+
### Patch Changes
|
|
535
|
+
|
|
536
|
+
- 238df71: fix(web): fix bugs of Elements
|
|
537
|
+
includes:
|
|
538
|
+
**AddClass,
|
|
539
|
+
**ReplaceElements,
|
|
540
|
+
**GetElementUniqueID,
|
|
541
|
+
**GetConfig,
|
|
542
|
+
**GetChildren,
|
|
543
|
+
**FlushElementTree,
|
|
544
|
+
\_\_SetInlineStyles
|
|
545
|
+
- 32952fb: chore: bump target to esnext
|
|
546
|
+
- f900b75: refactor: do not use inline style to apply css-in-js styles
|
|
547
|
+
|
|
548
|
+
Now you will see your css-in-js styles applied under a `[lynx-unique-id="<id>"]` selector.
|
|
549
|
+
|
|
550
|
+
- 9c23659: fix(web): \_\_SetAttribute allows the value to be null
|
|
551
|
+
- d3acc7b: fix: we should call \_\_FlushElementTree after renderPage
|
|
552
|
+
- 314cb44: fix(web): x-textarea replace blur,focus with lynxblur,lynxfocus.
|
|
553
|
+
- e170052: chore: remove tslib
|
|
554
|
+
|
|
555
|
+
We provide ESNext output for this lib.
|
|
556
|
+
|
|
557
|
+
- Updated dependencies [987da15]
|
|
558
|
+
- Updated dependencies [3e66349]
|
|
559
|
+
- Updated dependencies [2b7a4fe]
|
|
560
|
+
- Updated dependencies [461d965]
|
|
561
|
+
- Updated dependencies [2973ba5]
|
|
562
|
+
- Updated dependencies [7ee0dc1]
|
|
563
|
+
- Updated dependencies [7c752d9]
|
|
564
|
+
- Updated dependencies [29e4684]
|
|
565
|
+
- Updated dependencies [068f677]
|
|
566
|
+
- Updated dependencies [3547621]
|
|
567
|
+
- Updated dependencies [bed4f24]
|
|
568
|
+
- Updated dependencies [33691cd]
|
|
569
|
+
- Updated dependencies [2047658]
|
|
570
|
+
- Updated dependencies [b323923]
|
|
571
|
+
- Updated dependencies [39cf3ae]
|
|
572
|
+
- Updated dependencies [2973ba5]
|
|
573
|
+
- Updated dependencies [917e496]
|
|
574
|
+
- Updated dependencies [532380d]
|
|
575
|
+
- Updated dependencies [a41965d]
|
|
576
|
+
- Updated dependencies [f900b75]
|
|
577
|
+
- Updated dependencies [2e0a780]
|
|
578
|
+
- Updated dependencies [a7a222b]
|
|
579
|
+
- Updated dependencies [f8d1d98]
|
|
580
|
+
- Updated dependencies [c04669b]
|
|
581
|
+
- Updated dependencies [81be6cf]
|
|
582
|
+
- Updated dependencies [f8d1d98]
|
|
583
|
+
- Updated dependencies [5018d8f]
|
|
584
|
+
- Updated dependencies [c0a482a]
|
|
585
|
+
- Updated dependencies [314cb44]
|
|
586
|
+
- Updated dependencies [8c6eeb9]
|
|
587
|
+
- Updated dependencies [c43f436]
|
|
588
|
+
- Updated dependencies [67a70ac]
|
|
589
|
+
- Updated dependencies [e0854a8]
|
|
590
|
+
- Updated dependencies [e170052]
|
|
591
|
+
- Updated dependencies [e86bba0]
|
|
592
|
+
- Updated dependencies [1fe49a2]
|
|
593
|
+
- Updated dependencies [f0a50b6]
|
|
594
|
+
- @lynx-js/web-elements@0.1.0
|
|
595
|
+
- @lynx-js/web-constants@0.1.0
|
|
596
|
+
- @lynx-js/lynx-core@0.0.1
|
|
597
|
+
- @lynx-js/web-mainthread-apis@0.1.0
|