@lwc/engine-core 3.5.0 → 3.6.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.
@@ -3,5 +3,5 @@ export interface HTMLElementConstructor {
3
3
  prototype: HTMLElement;
4
4
  new (): HTMLElement;
5
5
  }
6
- export declare function HTMLBridgeElementFactory(SuperClass: HTMLElementConstructor, publicProperties: string[], methods: string[], observedFields: string[], proto: LightningElement | null): HTMLElementConstructor;
6
+ export declare function HTMLBridgeElementFactory(SuperClass: HTMLElementConstructor, publicProperties: string[], methods: string[], observedFields: string[], proto: LightningElement | null, hasCustomSuperClass: boolean): HTMLElementConstructor;
7
7
  export declare const BaseBridgeElement: HTMLElementConstructor;
@@ -30,7 +30,8 @@ export declare const enum ShadowMode {
30
30
  }
31
31
  export declare const enum ShadowSupportMode {
32
32
  Any = "any",
33
- Default = "reset"
33
+ Default = "reset",
34
+ Native = "native"
34
35
  }
35
36
  export declare const enum LwcDomMode {
36
37
  Manual = "manual"
package/dist/index.cjs.js CHANGED
@@ -2624,7 +2624,7 @@ function createAccessorThatWarns(propName) {
2624
2624
  configurable: true,
2625
2625
  };
2626
2626
  }
2627
- function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto) {
2627
+ function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
2628
2628
  const HTMLBridgeElement = class extends SuperClass {
2629
2629
  };
2630
2630
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
@@ -2635,7 +2635,8 @@ function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observe
2635
2635
  const descriptors = shared.create(null);
2636
2636
  // present a hint message so that developers are aware that they have not decorated property with @api
2637
2637
  if (process.env.NODE_ENV !== 'production') {
2638
- if (!shared.isUndefined(proto) && !shared.isNull(proto)) {
2638
+ // TODO [#3761]: enable for components that don't extend from LightningElement
2639
+ if (!shared.isUndefined(proto) && !shared.isNull(proto) && !hasCustomSuperClass) {
2639
2640
  const nonPublicPropertiesToWarnOn = new Set([
2640
2641
  // getters, setters, and methods
2641
2642
  ...shared.keys(shared.getOwnPropertyDescriptors(proto)),
@@ -2716,7 +2717,7 @@ function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observe
2716
2717
  shared.defineProperties(HTMLBridgeElement.prototype, descriptors);
2717
2718
  return HTMLBridgeElement;
2718
2719
  }
2719
- const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, shared.getOwnPropertyNames(HTMLElementOriginalDescriptors), [], [], null);
2720
+ const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, shared.getOwnPropertyNames(HTMLElementOriginalDescriptors), [], [], null, false);
2720
2721
  if (process.env.IS_BROWSER) {
2721
2722
  // This ARIA reflection only really makes sense in the browser. On the server, there is no `renderedCallback()`,
2722
2723
  // so you cannot do e.g. `this.template.querySelector('x-child').ariaBusy = 'true'`. So we don't need to expose
@@ -3026,7 +3027,8 @@ function createComponentDef(Ctor) {
3026
3027
  }
3027
3028
  if (!shared.isUndefined(ctorShadowSupportMode) &&
3028
3029
  ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ &&
3029
- ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */) {
3030
+ ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */ &&
3031
+ ctorShadowSupportMode !== "native" /* ShadowSupportMode.Native */) {
3030
3032
  logError(`Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
3031
3033
  }
3032
3034
  if (!shared.isUndefined(ctorRenderMode) &&
@@ -3040,8 +3042,9 @@ function createComponentDef(Ctor) {
3040
3042
  const proto = Ctor.prototype;
3041
3043
  let { connectedCallback, disconnectedCallback, renderedCallback, errorCallback, formAssociatedCallback, formResetCallback, formDisabledCallback, formStateRestoreCallback, render, } = proto;
3042
3044
  const superProto = getCtorProto(Ctor);
3043
- const superDef = superProto !== LightningElement ? getComponentInternalDef(superProto) : lightingElementDef;
3044
- const bridge = HTMLBridgeElementFactory(superDef.bridge, shared.keys(apiFields), shared.keys(apiMethods), shared.keys(observedFields), proto);
3045
+ const hasCustomSuperClass = superProto !== LightningElement;
3046
+ const superDef = hasCustomSuperClass ? getComponentInternalDef(superProto) : lightingElementDef;
3047
+ const bridge = HTMLBridgeElementFactory(superDef.bridge, shared.keys(apiFields), shared.keys(apiMethods), shared.keys(observedFields), proto, hasCustomSuperClass);
3045
3048
  const props = shared.assign(shared.create(null), superDef.props, apiFields);
3046
3049
  const propsConfig = shared.assign(shared.create(null), superDef.propsConfig, apiFieldsConfig);
3047
3050
  const methods = shared.assign(shared.create(null), superDef.methods, apiMethods);
@@ -5724,8 +5727,10 @@ function computeShadowMode(def, owner, renderer) {
5724
5727
  // everything defaults to native when the synthetic shadow polyfill is unavailable.
5725
5728
  shadowMode = 0 /* ShadowMode.Native */;
5726
5729
  }
5727
- else if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
5728
- if (def.shadowSupportMode === "any" /* ShadowSupportMode.Any */) {
5730
+ else if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE ||
5731
+ def.shadowSupportMode === "native" /* ShadowSupportMode.Native */) {
5732
+ if (def.shadowSupportMode === "any" /* ShadowSupportMode.Any */ ||
5733
+ def.shadowSupportMode === "native" /* ShadowSupportMode.Native */) {
5729
5734
  shadowMode = 0 /* ShadowMode.Native */;
5730
5735
  }
5731
5736
  else {
@@ -7125,5 +7130,5 @@ exports.swapTemplate = swapTemplate;
7125
7130
  exports.track = track;
7126
7131
  exports.unwrap = unwrap;
7127
7132
  exports.wire = wire;
7128
- /** version: 3.5.0 */
7133
+ /** version: 3.6.0 */
7129
7134
  //# sourceMappingURL=index.cjs.js.map