@tarojs/runtime 3.6.24 → 3.6.25

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.
@@ -69,6 +69,8 @@ interface PageInstance extends PageLifeCycle {
69
69
  options?: Record<string, unknown>;
70
70
  /** 页面渲染引擎类型 */
71
71
  renderer?: 'webview' | 'skyline';
72
+ /** 获得一个 EventChannel 对象,用于页面间通讯 */
73
+ getOpenerEventChannel?(): Record<string, any>;
72
74
  }
73
75
  interface Show {
74
76
  componentDidShow?(): void;
@@ -706,6 +706,8 @@ interface PageInstance extends PageLifeCycle {
706
706
  options?: Record<string, unknown>;
707
707
  /** 页面渲染引擎类型 */
708
708
  renderer?: "webview" | "skyline";
709
+ /** 获得一个 EventChannel 对象,用于页面间通讯 */
710
+ getOpenerEventChannel?(): Record<string, any>;
709
711
  }
710
712
  interface Show {
711
713
  componentDidShow?(): void;
@@ -1,4 +1,4 @@
1
- import { noop, isFunction, getComponentsAlias as getComponentsAlias$1, internalComponents, EMPTY_OBJ, hooks, toCamelCase, isObject, warn, isArray, ensure, isNull, isUndefined, toDashed, isString, controlledComponent, Events, isNumber } from '@tarojs/shared';
1
+ import { noop, isFunction, getComponentsAlias as getComponentsAlias$1, internalComponents, EMPTY_OBJ, hooks, toCamelCase, isObject, warn, isArray, ensure, isNull, isUndefined, toDashed, isString, controlledComponent, Events, isNumber, EventChannel } from '@tarojs/shared';
2
2
  export { Events, hooks } from '@tarojs/shared';
3
3
  import { __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib';
4
4
 
@@ -434,6 +434,7 @@ function hydrate(node) {
434
434
  // 初始化 SPECIAL_NODES
435
435
  SPECIAL_NODES || (SPECIAL_NODES = hooks.call('getSpecialNodes'));
436
436
  const nodeName = node.nodeName;
437
+ let compileModeName = null;
437
438
  if (isText(node)) {
438
439
  return {
439
440
  sid: node.sid,
@@ -465,11 +466,14 @@ function hydrate(node) {
465
466
  propInCamelCase !== COMPILE_MODE) {
466
467
  data[propInCamelCase] = props[prop];
467
468
  }
468
- if (nodeName === VIEW && propInCamelCase === CATCHMOVE && props[prop] !== false) {
469
+ if (process.env.TARO_ENV !== 'swan' &&
470
+ nodeName === VIEW &&
471
+ propInCamelCase === CATCHMOVE &&
472
+ props[prop] !== false) {
469
473
  data["nn" /* Shortcuts.NodeName */] = CATCH_VIEW;
470
474
  }
471
475
  if (propInCamelCase === COMPILE_MODE) {
472
- data["nn" /* Shortcuts.NodeName */] = props[prop];
476
+ compileModeName = props[prop];
473
477
  }
474
478
  }
475
479
  // Children
@@ -493,6 +497,9 @@ function hydrate(node) {
493
497
  }
494
498
  }
495
499
  }
500
+ if (compileModeName !== null) {
501
+ data["nn" /* Shortcuts.NodeName */] = compileModeName;
502
+ }
496
503
  const resData = hooks.call('transferHydrateData', data, node, componentAlias);
497
504
  return resData || data;
498
505
  }
@@ -4067,6 +4074,11 @@ function createPageConfig(component, pageName, data, pageConfig) {
4067
4074
  eventCenter.trigger(getOnHideEventKey(id));
4068
4075
  }
4069
4076
  };
4077
+ if (process.env.TARO_PLATFORM === 'web') {
4078
+ config.getOpenerEventChannel = () => {
4079
+ return EventChannel.pageChannel;
4080
+ };
4081
+ }
4070
4082
  LIFECYCLES.forEach((lifecycle) => {
4071
4083
  let isDefer = false;
4072
4084
  lifecycle = lifecycle.replace(/^defer:/, () => {