@lynx-js/web-constants-canary 0.17.2 → 0.18.0-canary-20251010-7e06ca90

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,22 @@
1
1
  # @lynx-js/web-constants
2
2
 
3
+ ## 0.18.0-canary-20251010093237-7e06ca90219bfcda958ae57cb91eb0a2e284eb02
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: ([#1837](https://github.com/lynx-family/lynx-stack/pull/1837))
8
+
9
+ 1. `LynxView.updateData()` cannot trigger `dataProcessor`.
10
+
11
+ 2. **This is a break change:** The second parameter of `LynxView.updateData()` has been changed from `UpdateDataType` to `string`, which is the `processorName` (default is `default` which will use `defaultDataProcessor`). This change is to better align with Native. The current complete type is as follows:
12
+
13
+ ```ts
14
+ LynxView.updateData(data: Cloneable, processorName?: string | undefined, callback?: (() => void) | undefined): void
15
+ ```
16
+
17
+ - Updated dependencies []:
18
+ - @lynx-js/web-worker-rpc@0.18.0-canary-20251010093237-7e06ca90219bfcda958ae57cb91eb0a2e284eb02
19
+
3
20
  ## 0.17.2
4
21
 
5
22
  ### Patch Changes
@@ -219,25 +236,25 @@
219
236
  lynxView.initI18nResources = [
220
237
  {
221
238
  options: {
222
- locale: 'en',
223
- channel: '1',
224
- fallback_url: '',
239
+ locale: "en",
240
+ channel: "1",
241
+ fallback_url: "",
225
242
  },
226
243
  resource: {
227
- hello: 'hello',
228
- lynx: 'lynx web platform1',
244
+ hello: "hello",
245
+ lynx: "lynx web platform1",
229
246
  },
230
247
  },
231
248
  ];
232
- lynxView.addEventListener('i18nResourceMissed', (e) => {
249
+ lynxView.addEventListener("i18nResourceMissed", (e) => {
233
250
  console.log(e);
234
251
  });
235
252
 
236
253
  // mts
237
254
  _I18nResourceTranslation({
238
- locale: 'en',
239
- channel: '1',
240
- fallback_url: '',
255
+ locale: "en",
256
+ channel: "1",
257
+ fallback_url: "",
241
258
  });
242
259
  ```
243
260
 
@@ -476,8 +493,8 @@
476
493
  }
477
494
  };`,
478
495
  ],
479
- { type: 'text/javascript' },
480
- ),
496
+ { type: "text/javascript" }
497
+ )
481
498
  ),
482
499
  };
483
500
  lynxView.nativeModulesMap = nativeModulesMap;
@@ -563,8 +580,8 @@
563
580
  };
564
581
  };`,
565
582
  ],
566
- { type: 'text/javascript' },
567
- ),
583
+ { type: "text/javascript" }
584
+ )
568
585
  );
569
586
 
570
587
  const color_methods = URL.createObjectURL(
@@ -579,8 +596,8 @@
579
596
  };
580
597
  };`,
581
598
  ],
582
- { type: 'text/javascript' },
583
- ),
599
+ { type: "text/javascript" }
600
+ )
584
601
  );
585
602
 
586
603
  lynxView.napiModuleMap = {
@@ -597,7 +614,7 @@
597
614
 
598
615
  ```js
599
616
  lynxView.onNapiModulesCall = (name, data, moduleName) => {
600
- if (name === 'getColor' && moduleName === 'color_methods') {
617
+ if (name === "getColor" && moduleName === "color_methods") {
601
618
  return data.color;
602
619
  }
603
620
  };
@@ -661,8 +678,8 @@
661
678
  }
662
679
  };`,
663
680
  ],
664
- { type: 'text/javascript' },
665
- ),
681
+ { type: "text/javascript" }
682
+ )
666
683
  );
667
684
  ```
668
685
 
@@ -674,7 +691,7 @@
674
691
 
675
692
  ```js
676
693
  lynxView.onNativeModulesCall = (name, data, callback) => {
677
- if (name === 'getColor') {
694
+ if (name === "getColor") {
678
695
  callback(data.color);
679
696
  }
680
697
  };
@@ -684,7 +701,7 @@
684
701
 
685
702
  ```js
686
703
  lynxView.onNativeModulesCall = (name, data, moduleName) => {
687
- if (name === 'getColor' && moduleName === 'bridge') {
704
+ if (name === "getColor" && moduleName === "bridge") {
688
705
  return data.color;
689
706
  }
690
707
  };
@@ -4,6 +4,7 @@ import type { StartMainThreadContextConfig } from './types/MainThreadStartConfig
4
4
  import type { IdentifierType, InvokeCallbackRes } from './types/NativeApp.js';
5
5
  import type { ElementAnimationOptions } from './types/Element.js';
6
6
  import type { BackMainThreadContextConfig, LynxTemplate, MarkTiming } from './types/index.js';
7
+ import type { UpdateDataOptions } from './types/UpdateDataOptions.js';
7
8
  export declare const postExposureEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[{
8
9
  exposures: ExposureWorkerEvent[];
9
10
  disExposures: ExposureWorkerEvent[];
@@ -17,7 +18,7 @@ export declare const publishEventEndpoint: import("@lynx-js/web-worker-rpc/dist/
17
18
  export declare const postOffscreenEventEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[eventType: string, targetUniqueId: number, bubbles: boolean, unknown]>;
18
19
  export declare const switchExposureServiceEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[boolean, boolean]>;
19
20
  export declare const mainThreadStartEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[StartMainThreadContextConfig]>;
20
- export declare const updateDataEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsync<[Cloneable, Record<string, string>], void>;
21
+ export declare const updateDataEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsync<[Cloneable, UpdateDataOptions | undefined], void>;
21
22
  export declare const sendGlobalEventEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[string, Cloneable[] | undefined]>;
22
23
  export declare const disposeEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsync<[], void>;
23
24
  export declare const BackgroundThreadStartEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsync<[BackMainThreadContextConfig], void>;
@@ -6,6 +6,7 @@ import type { FlushElementTreeOptions } from './FlushElementTreeOptions.js';
6
6
  import type { I18nResourceTranslationOptions } from './index.js';
7
7
  import type { MainThreadLynx } from './MainThreadLynx.js';
8
8
  import type { ProcessDataCallback } from './ProcessDataCallback.js';
9
+ import type { UpdateDataOptions } from './UpdateDataOptions.js';
9
10
  type ElementPAPIEventHandler = string | {
10
11
  type: 'worklet';
11
12
  value: unknown;
@@ -171,7 +172,7 @@ export interface MainThreadGlobalThis {
171
172
  __QueryComponent: QueryComponentPAPI;
172
173
  processEvalResult?: (exports: unknown, schema: string) => unknown;
173
174
  renderPage: ((data: unknown) => void) | undefined;
174
- updatePage?: (data: Cloneable, options?: Record<string, string>) => void;
175
+ updatePage?: (data: Cloneable, options?: UpdateDataOptions) => void;
175
176
  runWorklet?: (obj: unknown, event: unknown) => void;
176
177
  }
177
178
  export {};
@@ -2,13 +2,7 @@ export declare const enum NativeUpdateDataType {
2
2
  UPDATE = 0,
3
3
  RESET = 1
4
4
  }
5
- export declare const enum UpdateDataType {
6
- Unknown = 0,
7
- UpdateExplicitByUser = 1,
8
- UpdateByKernelFromCtor = 2,
9
- UpdateByKernelFromRender = 4,
10
- UpdateByKernelFromHydrate = 8,
11
- UpdateByKernelFromGetDerived = 16,
12
- UpdateByKernelFromConflict = 32,
13
- UpdateByKernelFromHMR = 64
5
+ export interface UpdateDataOptions {
6
+ type?: NativeUpdateDataType;
7
+ processorName?: string;
14
8
  }
@@ -3,23 +3,4 @@ export var NativeUpdateDataType;
3
3
  NativeUpdateDataType[NativeUpdateDataType["UPDATE"] = 0] = "UPDATE";
4
4
  NativeUpdateDataType[NativeUpdateDataType["RESET"] = 1] = "RESET";
5
5
  })(NativeUpdateDataType || (NativeUpdateDataType = {}));
6
- export var UpdateDataType;
7
- (function (UpdateDataType) {
8
- // default
9
- UpdateDataType[UpdateDataType["Unknown"] = 0] = "Unknown";
10
- // update by `setState` or `setData`
11
- UpdateDataType[UpdateDataType["UpdateExplicitByUser"] = 1] = "UpdateExplicitByUser";
12
- // update by lynx_core from ctor
13
- UpdateDataType[UpdateDataType["UpdateByKernelFromCtor"] = 2] = "UpdateByKernelFromCtor";
14
- // update by lynx_core from render
15
- UpdateDataType[UpdateDataType["UpdateByKernelFromRender"] = 4] = "UpdateByKernelFromRender";
16
- // update by hydrate
17
- UpdateDataType[UpdateDataType["UpdateByKernelFromHydrate"] = 8] = "UpdateByKernelFromHydrate";
18
- // update by `getDerivedStateFromProps`
19
- UpdateDataType[UpdateDataType["UpdateByKernelFromGetDerived"] = 16] = "UpdateByKernelFromGetDerived";
20
- // update by conflict detected
21
- UpdateDataType[UpdateDataType["UpdateByKernelFromConflict"] = 32] = "UpdateByKernelFromConflict";
22
- // update by HMR
23
- UpdateDataType[UpdateDataType["UpdateByKernelFromHMR"] = 64] = "UpdateByKernelFromHMR";
24
- })(UpdateDataType || (UpdateDataType = {}));
25
6
  //# sourceMappingURL=UpdateDataOptions.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-constants-canary",
3
- "version": "0.17.2",
3
+ "version": "0.18.0-canary-20251010-7e06ca90",
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": "npm:@lynx-js/web-worker-rpc-canary@0.17.2"
26
+ "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.18.0-canary-20251010-7e06ca90"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4"