@lynx-js/react-canary 0.120.0 → 0.120.1-canary-20260428-e4ace875
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,11 @@
|
|
|
1
1
|
# @lynx-js/react
|
|
2
2
|
|
|
3
|
+
## 0.120.1-canary-20260428125019-e4ace875119eeeeaccbea0635b7f916a06d0d6d0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Default `fireEvent` to `bubbles: true` for the TouchEvent family in testing-library to match Lynx runtime semantics, and stop reassigning the read-only `Event.prototype` accessors which threw `TypeError` in strict mode. ([#2532](https://github.com/lynx-family/lynx-stack/pull/2532))
|
|
8
|
+
|
|
3
9
|
## 0.120.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -17,7 +23,6 @@
|
|
|
17
23
|
- Fix ref callbacks not being cleaned up or re-applied correctly when the ref at the same element slot changes across rerenders that happen before hydration (e.g. a `useEffect` triggering `setState` during the initial background render). ([#2500](https://github.com/lynx-family/lynx-stack/pull/2500))
|
|
18
24
|
|
|
19
25
|
- fix: reduce redundant updates for main-thread handlers and gestures ([#2188](https://github.com/lynx-family/lynx-stack/pull/2188))
|
|
20
|
-
|
|
21
26
|
- Updates are faster when the main-thread event handler or gesture object is stable across rerenders (fewer unnecessary native updates).
|
|
22
27
|
- Spread props rerenders that don't semantically change the handler/gesture no longer trigger redundant updates.
|
|
23
28
|
- Removing a gesture from spread props reliably clears the gesture state on the target element.
|
|
@@ -37,7 +42,6 @@
|
|
|
37
42
|
- Remove stale gestures when gestures are removed ([#2297](https://github.com/lynx-family/lynx-stack/pull/2297))
|
|
38
43
|
|
|
39
44
|
- Trace refactor ([#2466](https://github.com/lynx-family/lynx-stack/pull/2466))
|
|
40
|
-
|
|
41
45
|
- Remove `ReactLynx::renderOpcodes` from the trace
|
|
42
46
|
- Use `ReactLynx::transferRoot` to measure the time spent transferring the root to the background thread
|
|
43
47
|
|
|
@@ -48,8 +52,8 @@
|
|
|
48
52
|
Create a config file `rstest.config.ts` with the following content:
|
|
49
53
|
|
|
50
54
|
```ts
|
|
51
|
-
import { defineConfig } from
|
|
52
|
-
import { withLynxConfig } from
|
|
55
|
+
import { defineConfig } from "@rstest/core";
|
|
56
|
+
import { withLynxConfig } from "@lynx-js/react/testing-library/rstest-config";
|
|
53
57
|
|
|
54
58
|
export default defineConfig({
|
|
55
59
|
extends: withLynxConfig(),
|
|
@@ -99,7 +103,6 @@
|
|
|
99
103
|
### Minor Changes
|
|
100
104
|
|
|
101
105
|
- feat: export `GlobalPropsProvider`, `GlobalPropsConsumer`, `useGlobalProps` and `useGlobalPropsChanged` for `__globalProps` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
102
|
-
|
|
103
106
|
- `GlobalPropsProvider`: A Provider component that accepts `children`. It is used to provide the `lynx.__globalProps` context.
|
|
104
107
|
- `GlobalPropsConsumer`: A Consumer component that accepts a function as a child. It is used to consume the `lynx.__globalProps` context.
|
|
105
108
|
- `useGlobalProps`: A hook that returns the `lynx.__globalProps` object. It triggers a re-render when `lynx.__globalProps` changes.
|
|
@@ -114,7 +117,6 @@
|
|
|
114
117
|
Upgrade preact from [f7693b72](https://github.com/preactjs/preact/commit/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0) to [55254ef7](https://github.com/preactjs/preact/commit/55254ef7021e563cc1a86fb816058964a1b6a29a), see diffs at [f7693b72...55254ef7](https://github.com/preactjs/preact/compare/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0...preactjs:preact:55254ef7021e563cc1a86fb816058964a1b6a29a?expand=1).
|
|
115
118
|
|
|
116
119
|
- feat: add `globalPropsMode` option to `PluginReactLynxOptions` ([#2346](https://github.com/lynx-family/lynx-stack/pull/2346))
|
|
117
|
-
|
|
118
120
|
- When configured to `"event"`, `updateGlobalProps` will only trigger a global event and skip the `runWithForce` flow.
|
|
119
121
|
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger re-render automatically.
|
|
120
122
|
|
|
@@ -134,7 +136,6 @@
|
|
|
134
136
|
|
|
135
137
|
- Improve React runtime hook profiling. ([#2235](https://github.com/lynx-family/lynx-stack/pull/2235))
|
|
136
138
|
Enable Profiling recording first, then enter the target page so the trace includes full render/hydrate phases.
|
|
137
|
-
|
|
138
139
|
- Record trace events for `useEffect` / `useLayoutEffect` hook entry, callback, and cleanup phases.
|
|
139
140
|
- Log trace events for `useState` setter calls.
|
|
140
141
|
- Wire `profileFlowId` support in debug profile utilities and attach flow IDs to related hook traces.
|
|
@@ -183,7 +184,6 @@
|
|
|
183
184
|
- Bump `swc_core` v56. ([#2154](https://github.com/lynx-family/lynx-stack/pull/2154))
|
|
184
185
|
|
|
185
186
|
- Use `disableDeprecatedWarning` option to suppress BROKEN warnings during compilation. ([#2157](https://github.com/lynx-family/lynx-stack/pull/2157))
|
|
186
|
-
|
|
187
187
|
1. BROKEN: `getNodeRef`/`getNodeRefFromRoot`/`createSelectorQuery` on component instance is broken and MUST be migrated in ReactLynx 3.0, please use ref or lynx.createSelectorQuery instead.
|
|
188
188
|
2. BROKEN: `getElementById` on component instance is broken and MUST be migrated in ReactLynx 3.0, please use ref or lynx.getElementById instead.
|
|
189
189
|
|
|
@@ -221,9 +221,9 @@
|
|
|
221
221
|
|
|
222
222
|
```typescript
|
|
223
223
|
function getStyle(ele: MainThread.Element) {
|
|
224
|
-
|
|
225
|
-
const width = ele.getComputedStyleProperty(
|
|
226
|
-
const transformMatrix = ele.getComputedStyleProperty(
|
|
224
|
+
"main thread";
|
|
225
|
+
const width = ele.getComputedStyleProperty("width"); // Returns 300px
|
|
226
|
+
const transformMatrix = ele.getComputedStyleProperty("transform"); // Returns matrix(2, 0, 0, 2, 200, 400)
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
```ts
|
|
239
239
|
const LazyComponent = lazy(async () => {
|
|
240
240
|
try {
|
|
241
|
-
const mod = await import(
|
|
241
|
+
const mod = await import("./lazy-bundle");
|
|
242
242
|
return mod.default;
|
|
243
243
|
} catch (error) {
|
|
244
244
|
console.error(`Lazy Bundle load failed message: ${error.message}`);
|
|
@@ -266,14 +266,13 @@
|
|
|
266
266
|
- Auto define lynx.loadLazyBundle when using `import(/* relative path */)`. ([#1956](https://github.com/lynx-family/lynx-stack/pull/1956))
|
|
267
267
|
|
|
268
268
|
- feat: support declaring cross-thread shared modules via Import Attributes, enabling Main Thread Functions to call standard JS functions directly. ([#1968](https://github.com/lynx-family/lynx-stack/pull/1968))
|
|
269
|
-
|
|
270
269
|
- Usage: Add `with { runtime: "shared" }` to the `import` statement. For example:
|
|
271
270
|
|
|
272
271
|
```ts
|
|
273
|
-
import { func } from
|
|
272
|
+
import { func } from "./utils.js" with { runtime: "shared" };
|
|
274
273
|
|
|
275
274
|
function worklet() {
|
|
276
|
-
|
|
275
|
+
"main thread";
|
|
277
276
|
func(); // callable inside a main thread function
|
|
278
277
|
}
|
|
279
278
|
```
|
|
@@ -289,13 +288,11 @@
|
|
|
289
288
|
- **BREAKING CHANGE**: Delay the `createSnapshot` operation to `Snapshot` constructor to speed up IFR. ([#1899](https://github.com/lynx-family/lynx-stack/pull/1899))
|
|
290
289
|
|
|
291
290
|
This change refactors how snapshots are created and registered:
|
|
292
|
-
|
|
293
291
|
- Removed the `entryUniqID` function
|
|
294
292
|
- Snapshots are now lazily created via `snapshotCreatorMap` instead of eagerly at bundle load time
|
|
295
293
|
- Snapshot IDs are generated at compile time and only prefixed with `${globDynamicComponentEntry}:` for standalone lazy bundles
|
|
296
294
|
|
|
297
295
|
**⚠️ Lazy Bundle Compatibility:**
|
|
298
|
-
|
|
299
296
|
- **Backward compatibility (new runtime → old lazy bundles)**: ✅ **Supported**. Old lazy bundles will work with the new runtime.
|
|
300
297
|
|
|
301
298
|
- **Forward compatibility (old runtime → new lazy bundles)**: ❌ **NOT Supported**. Lower version consumers **will not be able to load lazy bundles produced by this version** due to the changed snapshot creation mechanism.
|
|
@@ -350,11 +347,11 @@
|
|
|
350
347
|
- Support testing React Compiler in testing library. Enable React Compiler by setting the `experimental_enableReactCompiler` option of `createVitestConfig` to `true`. ([#1269](https://github.com/lynx-family/lynx-stack/pull/1269))
|
|
351
348
|
|
|
352
349
|
```js
|
|
353
|
-
import { defineConfig, mergeConfig } from
|
|
354
|
-
import { createVitestConfig } from
|
|
350
|
+
import { defineConfig, mergeConfig } from "vitest/config";
|
|
351
|
+
import { createVitestConfig } from "@lynx-js/react/testing-library/vitest-config";
|
|
355
352
|
|
|
356
353
|
const defaultConfig = await createVitestConfig({
|
|
357
|
-
runtimePkgName:
|
|
354
|
+
runtimePkgName: "@lynx-js/react",
|
|
358
355
|
experimental_enableReactCompiler: true,
|
|
359
356
|
});
|
|
360
357
|
|
|
@@ -384,7 +381,7 @@
|
|
|
384
381
|
```tsx
|
|
385
382
|
function App() {
|
|
386
383
|
function handleInnerTap(event: MainThread.TouchEvent) {
|
|
387
|
-
|
|
384
|
+
"main thread";
|
|
388
385
|
event.stopPropagation();
|
|
389
386
|
// Or stop immediate propagation with
|
|
390
387
|
// event.stopImmediatePropagation();
|
|
@@ -482,10 +479,10 @@
|
|
|
482
479
|
- Add `animate` API in Main Thread Script(MTS), so you can now control a CSS animation imperatively ([#1534](https://github.com/lynx-family/lynx-stack/pull/1534))
|
|
483
480
|
|
|
484
481
|
```ts
|
|
485
|
-
import type { MainThread } from
|
|
482
|
+
import type { MainThread } from "@lynx-js/types";
|
|
486
483
|
|
|
487
484
|
function startAnimation(ele: MainThread.Element) {
|
|
488
|
-
|
|
485
|
+
"main thread";
|
|
489
486
|
const animation = ele.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
490
487
|
duration: 3000,
|
|
491
488
|
});
|
|
@@ -514,13 +511,12 @@
|
|
|
514
511
|
- Supports `recyclable` attribute in `<list-item>` to control whether the list item is recyclable. The `recyclable` attribute depends on Lynx Engine 3.4 or later. ([#1388](https://github.com/lynx-family/lynx-stack/pull/1388))
|
|
515
512
|
|
|
516
513
|
```jsx
|
|
517
|
-
<list-item recyclable={false}
|
|
514
|
+
<list-item recyclable={false} />
|
|
518
515
|
```
|
|
519
516
|
|
|
520
517
|
- feat: Support using a host element as direct child of Suspense ([#1455](https://github.com/lynx-family/lynx-stack/pull/1455))
|
|
521
518
|
|
|
522
519
|
- Add profile in production build: ([#1336](https://github.com/lynx-family/lynx-stack/pull/1336))
|
|
523
|
-
|
|
524
520
|
1. `diff:__COMPONENT_NAME__`: how long ReactLynx diff took.
|
|
525
521
|
2. `render:__COMPONENT_NAME__`: how long your render function took.
|
|
526
522
|
3. `setState`: an instant trace event, indicate when your setState was called.
|
|
@@ -535,7 +531,7 @@
|
|
|
535
531
|
|
|
536
532
|
```ts
|
|
537
533
|
function handleTap() {
|
|
538
|
-
|
|
534
|
+
"main thread";
|
|
539
535
|
// The following check always returned false before this fix
|
|
540
536
|
if (myHandleTap) {
|
|
541
537
|
runOnBackground(myHandleTap)();
|
|
@@ -558,7 +554,6 @@
|
|
|
558
554
|
- feat: Force synchronous rendering for background initial renders to support Suspense fallbacks ([#1323](https://github.com/lynx-family/lynx-stack/pull/1323))
|
|
559
555
|
|
|
560
556
|
- Introduces `@lynx-js/react/compat` submodule exporting Preact implementations of: ([#1316](https://github.com/lynx-family/lynx-stack/pull/1316))
|
|
561
|
-
|
|
562
557
|
- `startTransition`
|
|
563
558
|
- `useTransition`
|
|
564
559
|
|
|
@@ -596,10 +591,10 @@
|
|
|
596
591
|
Add the import to `@lynx-js/react/debug` at the first line of the entry:
|
|
597
592
|
|
|
598
593
|
```js
|
|
599
|
-
import
|
|
600
|
-
import { root } from
|
|
594
|
+
import "@lynx-js/react/debug";
|
|
595
|
+
import { root } from "@lynx-js/react";
|
|
601
596
|
|
|
602
|
-
import { App } from
|
|
597
|
+
import { App } from "./App.jsx";
|
|
603
598
|
|
|
604
599
|
root.render(<App />);
|
|
605
600
|
```
|
|
@@ -609,9 +604,9 @@
|
|
|
609
604
|
For example, you can use it like this:
|
|
610
605
|
|
|
611
606
|
```jsx
|
|
612
|
-
<list-item defer={{ unmountRecycled: true }} item-key=
|
|
607
|
+
<list-item defer={{ unmountRecycled: true }} item-key="1">
|
|
613
608
|
<WillBeUnmountIfRecycled />
|
|
614
|
-
</list-item
|
|
609
|
+
</list-item>
|
|
615
610
|
```
|
|
616
611
|
|
|
617
612
|
Now the component will be unmounted when it is recycled, which can help with performance in certain scenarios.
|
|
@@ -619,7 +614,7 @@
|
|
|
619
614
|
- Avoid some unexpected `__SetAttribute` in hydrate when `undefined` is passed as an attribute value to intrinsic elements, for example: ([#1318](https://github.com/lynx-family/lynx-stack/pull/1318))
|
|
620
615
|
|
|
621
616
|
```jsx
|
|
622
|
-
<image async-mode={undefined}
|
|
617
|
+
<image async-mode={undefined} />
|
|
623
618
|
```
|
|
624
619
|
|
|
625
620
|
## 0.111.1
|
|
@@ -658,14 +653,13 @@
|
|
|
658
653
|
- Fixed: An issue where the `lynxViewDidUpdate` callback did not trigger when data was updated from native. ([#1171](https://github.com/lynx-family/lynx-stack/pull/1171))
|
|
659
654
|
|
|
660
655
|
Notice:
|
|
661
|
-
|
|
662
656
|
- Even if no data changes are actually processed after calling `updateData()`, the `lynxViewDidUpdate` callback will still be triggered.
|
|
663
657
|
- Only one `lynxViewDidUpdate` callback will be triggered per render cycle. Consequently, if multiple `updateData()` calls are made within a single cycle but the data updates are batched, the number of `lynxViewDidUpdate` callbacks triggered may be less than the number of `updateData()` calls.
|
|
664
658
|
|
|
665
659
|
- Supports `act` in testing library. ([#1182](https://github.com/lynx-family/lynx-stack/pull/1182))
|
|
666
660
|
|
|
667
661
|
```js
|
|
668
|
-
import { act } from
|
|
662
|
+
import { act } from "@lynx-js/react/testing-library";
|
|
669
663
|
|
|
670
664
|
act(() => {
|
|
671
665
|
// ...
|
|
@@ -685,14 +679,12 @@
|
|
|
685
679
|
- Fixed closure variable capture issue in effect hooks to prevent stale values and ensured proper execution order between refs, effects, and event handlers. ([#770](https://github.com/lynx-family/lynx-stack/pull/770))
|
|
686
680
|
|
|
687
681
|
**Breaking Changes**:
|
|
688
|
-
|
|
689
682
|
- The execution timing of `ref`, `useEffect()` callback, `componentDidMount`, `componentDidUpdate`, `componentWillUnmount` and the callback of `setState` have been moved forward. These effects will now execute before hydration is complete, rather than waiting for the main thread update to complete.
|
|
690
683
|
- For components inside `<list />`, `ref` callbacks will now be triggered during background thread rendering, regardless of component visibility. If your code depends on component visibility timing, use `main-thread:ref` instead of regular `ref`.
|
|
691
684
|
|
|
692
685
|
### Patch Changes
|
|
693
686
|
|
|
694
687
|
- Fixed two memory leaks: ([#1071](https://github.com/lynx-family/lynx-stack/pull/1071))
|
|
695
|
-
|
|
696
688
|
1. When JSX is rendered on the main thread and removed, FiberElement can still be referenced by `__root.__jsx` through `props.children`;
|
|
697
689
|
|
|
698
690
|
2. When the SnapshotInstance tree is removed from the root node, its child nodes form a cycle reference because the `__previousSibling` and `__nextSibling` properties point to each other, thus causing a FiberElement leak.
|
|
@@ -771,8 +763,7 @@
|
|
|
771
763
|
* 3: Full Resolution - Batch render with async property and element tree resolution for list item subtree
|
|
772
764
|
*/
|
|
773
765
|
experimental-batch-render-strategy={3}
|
|
774
|
-
>
|
|
775
|
-
</list>;
|
|
766
|
+
></list>
|
|
776
767
|
```
|
|
777
768
|
|
|
778
769
|
- rename @lynx-js/test-environment to @lynx-js/testing-environment ([#704](https://github.com/lynx-family/lynx-stack/pull/704))
|
|
@@ -798,7 +789,6 @@
|
|
|
798
789
|
### Minor Changes
|
|
799
790
|
|
|
800
791
|
- Some of the timing keys are renamed to match the naming convention of the Lynx Engine. ([#438](https://github.com/lynx-family/lynx-stack/pull/438))
|
|
801
|
-
|
|
802
792
|
- `update_set_state_trigger` -> `updateSetStateTrigger`
|
|
803
793
|
- `update_diff_vdom_start` -> `updateDiffVdomStart`
|
|
804
794
|
- `update_diff_vdom_end` -> `updateDiffVdomEnd`
|
|
@@ -890,7 +880,7 @@
|
|
|
890
880
|
You can now use `useErrorBoundary` it in TypeScript like this:
|
|
891
881
|
|
|
892
882
|
```tsx
|
|
893
|
-
import { useErrorBoundary } from
|
|
883
|
+
import { useErrorBoundary } from "@lynx-js/react";
|
|
894
884
|
```
|
|
895
885
|
|
|
896
886
|
- Modified the format of data sent from background threads to the main thread. ([#207](https://github.com/lynx-family/lynx-stack/pull/207))
|
|
@@ -942,13 +932,13 @@
|
|
|
942
932
|
Now you can get the return value from `runOnBackground()` and `runOnMainThread()`, which enables more flexible data flow between the main thread and the background thread.
|
|
943
933
|
|
|
944
934
|
```js
|
|
945
|
-
import { runOnBackground } from
|
|
935
|
+
import { runOnBackground } from "@lynx-js/react";
|
|
946
936
|
|
|
947
937
|
const onTap = async () => {
|
|
948
|
-
|
|
938
|
+
"main thread";
|
|
949
939
|
const text = await runOnBackground(() => {
|
|
950
|
-
|
|
951
|
-
return
|
|
940
|
+
"background only";
|
|
941
|
+
return "Hello, world!";
|
|
952
942
|
})();
|
|
953
943
|
console.log(text);
|
|
954
944
|
};
|
|
@@ -983,9 +973,9 @@
|
|
|
983
973
|
|
|
984
974
|
```ts
|
|
985
975
|
// These imports will be removed from the final bundle
|
|
986
|
-
import type { Foo } from
|
|
987
|
-
import { type Bar } from
|
|
988
|
-
import { xyz } from
|
|
976
|
+
import type { Foo } from "xyz";
|
|
977
|
+
import { type Bar } from "xyz";
|
|
978
|
+
import { xyz } from "xyz"; // When xyz is not used
|
|
989
979
|
```
|
|
990
980
|
|
|
991
981
|
See [TypeScript - verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax) for details.
|
|
@@ -1025,7 +1015,7 @@
|
|
|
1025
1015
|
const f = undefined;
|
|
1026
1016
|
|
|
1027
1017
|
function mts() {
|
|
1028
|
-
|
|
1018
|
+
"main thread";
|
|
1029
1019
|
// throws in background rendering
|
|
1030
1020
|
f && runOnBackground(f)();
|
|
1031
1021
|
}
|
|
@@ -1059,14 +1049,14 @@
|
|
|
1059
1049
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
1060
1050
|
|
|
1061
1051
|
```js
|
|
1062
|
-
import { pluginReactLynx } from
|
|
1063
|
-
import { defineConfig } from
|
|
1052
|
+
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
|
|
1053
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
1064
1054
|
|
|
1065
1055
|
export default defineConfig({
|
|
1066
1056
|
plugins: [
|
|
1067
1057
|
pluginReactLynx({
|
|
1068
1058
|
compat: {
|
|
1069
|
-
removeComponentAttrRegex:
|
|
1059
|
+
removeComponentAttrRegex: "YOUR REGEX",
|
|
1070
1060
|
},
|
|
1071
1061
|
}),
|
|
1072
1062
|
],
|
|
@@ -1143,7 +1133,6 @@
|
|
|
1143
1133
|
</table>
|
|
1144
1134
|
|
|
1145
1135
|
This requires `@lynx-js/react-rsbuild-plugin` v0.5.1 to work.
|
|
1146
|
-
|
|
1147
1136
|
- Inject `globDynamicComponentEntry` for background script. ([#311](https://github.com/lynx-wg/lynx-stack/pull/311))
|
|
1148
1137
|
- Inject `globDynamicComponentEntry` for main thread script. ([#312](https://github.com/lynx-wg/lynx-stack/pull/312))
|
|
1149
1138
|
|
|
@@ -1152,22 +1141,22 @@
|
|
|
1152
1141
|
Gesture Handler is a set of gesture handling capabilities built on top of the Main Thread Script. It currently supports drag, inertial scrolling, long press, and tap gestures for `<view>`, `<scroll-view>`, `<list>`, and `<text>`. In the future, it will also support multi-finger zoom, multi-finger rotation, and other gesture capabilities.
|
|
1153
1142
|
|
|
1154
1143
|
```tsx
|
|
1155
|
-
import { useGesture, PanGesture } from
|
|
1144
|
+
import { useGesture, PanGesture } from "@lynx-js/gesture-runtime";
|
|
1156
1145
|
|
|
1157
1146
|
function App() {
|
|
1158
1147
|
const pan = useGesture(PanGesture);
|
|
1159
1148
|
|
|
1160
1149
|
pan
|
|
1161
1150
|
.onBegin((event, stateManager) => {
|
|
1162
|
-
|
|
1151
|
+
"main thread";
|
|
1163
1152
|
// some logic
|
|
1164
1153
|
})
|
|
1165
1154
|
.onUpdate((event, stateManager) => {
|
|
1166
|
-
|
|
1155
|
+
"main thread";
|
|
1167
1156
|
// some logic
|
|
1168
1157
|
})
|
|
1169
1158
|
.onEnd((event, stateManager) => {
|
|
1170
|
-
|
|
1159
|
+
"main thread";
|
|
1171
1160
|
// some logic
|
|
1172
1161
|
});
|
|
1173
1162
|
|
|
@@ -1187,7 +1176,7 @@
|
|
|
1187
1176
|
return;
|
|
1188
1177
|
}
|
|
1189
1178
|
|
|
1190
|
-
console.log(
|
|
1179
|
+
console.log("not __LEPUS__"); // This can be removed now
|
|
1191
1180
|
}
|
|
1192
1181
|
```
|
|
1193
1182
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export declare const fireEvent: any;
|
|
2
2
|
export declare const eventMap: {
|
|
3
3
|
tap: {
|
|
4
|
-
defaultInit: {
|
|
4
|
+
defaultInit: {
|
|
5
|
+
bubbles: boolean;
|
|
6
|
+
};
|
|
5
7
|
};
|
|
6
8
|
longtap: {
|
|
7
|
-
defaultInit: {
|
|
9
|
+
defaultInit: {
|
|
10
|
+
bubbles: boolean;
|
|
11
|
+
};
|
|
8
12
|
};
|
|
9
13
|
bgload: {
|
|
10
14
|
defaultInit: {};
|
|
@@ -13,19 +17,29 @@ export declare const eventMap: {
|
|
|
13
17
|
defaultInit: {};
|
|
14
18
|
};
|
|
15
19
|
touchstart: {
|
|
16
|
-
defaultInit: {
|
|
20
|
+
defaultInit: {
|
|
21
|
+
bubbles: boolean;
|
|
22
|
+
};
|
|
17
23
|
};
|
|
18
24
|
touchmove: {
|
|
19
|
-
defaultInit: {
|
|
25
|
+
defaultInit: {
|
|
26
|
+
bubbles: boolean;
|
|
27
|
+
};
|
|
20
28
|
};
|
|
21
29
|
touchcancel: {
|
|
22
|
-
defaultInit: {
|
|
30
|
+
defaultInit: {
|
|
31
|
+
bubbles: boolean;
|
|
32
|
+
};
|
|
23
33
|
};
|
|
24
34
|
touchend: {
|
|
25
|
-
defaultInit: {
|
|
35
|
+
defaultInit: {
|
|
36
|
+
bubbles: boolean;
|
|
37
|
+
};
|
|
26
38
|
};
|
|
27
39
|
longpress: {
|
|
28
|
-
defaultInit: {
|
|
40
|
+
defaultInit: {
|
|
41
|
+
bubbles: boolean;
|
|
42
|
+
};
|
|
29
43
|
};
|
|
30
44
|
transitionstart: {
|
|
31
45
|
defaultInit: {};
|
|
@@ -14294,10 +14294,14 @@ const fire_event_fireEvent = (elemOrNodesRef, ...args)=>{
|
|
|
14294
14294
|
};
|
|
14295
14295
|
const fire_event_eventMap = {
|
|
14296
14296
|
tap: {
|
|
14297
|
-
defaultInit: {
|
|
14297
|
+
defaultInit: {
|
|
14298
|
+
bubbles: true
|
|
14299
|
+
}
|
|
14298
14300
|
},
|
|
14299
14301
|
longtap: {
|
|
14300
|
-
defaultInit: {
|
|
14302
|
+
defaultInit: {
|
|
14303
|
+
bubbles: true
|
|
14304
|
+
}
|
|
14301
14305
|
},
|
|
14302
14306
|
bgload: {
|
|
14303
14307
|
defaultInit: {}
|
|
@@ -14306,19 +14310,29 @@ const fire_event_eventMap = {
|
|
|
14306
14310
|
defaultInit: {}
|
|
14307
14311
|
},
|
|
14308
14312
|
touchstart: {
|
|
14309
|
-
defaultInit: {
|
|
14313
|
+
defaultInit: {
|
|
14314
|
+
bubbles: true
|
|
14315
|
+
}
|
|
14310
14316
|
},
|
|
14311
14317
|
touchmove: {
|
|
14312
|
-
defaultInit: {
|
|
14318
|
+
defaultInit: {
|
|
14319
|
+
bubbles: true
|
|
14320
|
+
}
|
|
14313
14321
|
},
|
|
14314
14322
|
touchcancel: {
|
|
14315
|
-
defaultInit: {
|
|
14323
|
+
defaultInit: {
|
|
14324
|
+
bubbles: true
|
|
14325
|
+
}
|
|
14316
14326
|
},
|
|
14317
14327
|
touchend: {
|
|
14318
|
-
defaultInit: {
|
|
14328
|
+
defaultInit: {
|
|
14329
|
+
bubbles: true
|
|
14330
|
+
}
|
|
14319
14331
|
},
|
|
14320
14332
|
longpress: {
|
|
14321
|
-
defaultInit: {
|
|
14333
|
+
defaultInit: {
|
|
14334
|
+
bubbles: true
|
|
14335
|
+
}
|
|
14322
14336
|
},
|
|
14323
14337
|
transitionstart: {
|
|
14324
14338
|
defaultInit: {}
|
|
@@ -14415,7 +14429,8 @@ Object.keys(fire_event_eventMap).forEach((key)=>{
|
|
|
14415
14429
|
...init
|
|
14416
14430
|
};
|
|
14417
14431
|
const event = createEvent(`${eventType}:${key}`, elem, init);
|
|
14418
|
-
|
|
14432
|
+
const { bubbles, cancelable, composed, ...assignableInit } = init;
|
|
14433
|
+
Object.assign(event, assignableInit);
|
|
14419
14434
|
const ans = fireEvent(elem, event);
|
|
14420
14435
|
if (isMainThread) lynxTestingEnv.switchToMainThread();
|
|
14421
14436
|
return ans;
|