lwc 2.5.10-alpha1 → 2.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.
Files changed (54) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +168 -134
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +169 -135
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +154 -133
  5. package/dist/engine-dom/iife/es5/engine-dom.js +185 -145
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +172 -145
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +170 -136
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +155 -134
  11. package/dist/engine-dom/umd/es5/engine-dom.js +186 -146
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +173 -146
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +179 -142
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +179 -142
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -130
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +30 -131
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +30 -131
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +37 -128
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +37 -128
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +31 -132
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +31 -132
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +38 -129
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +38 -129
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +3 -3
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -3
  33. package/dist/wire-service/iife/es5/wire-service.js +12 -12
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +12 -12
  36. package/dist/wire-service/umd/es2017/wire-service.js +4 -4
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +4 -4
  38. package/dist/wire-service/umd/es5/wire-service.js +13 -13
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +13 -13
  41. package/package.json +8 -8
  42. package/dist/engine/esm/es2017/engine.js +0 -7981
  43. package/dist/engine/iife/es2017/engine.js +0 -8013
  44. package/dist/engine/iife/es2017/engine.min.js +0 -9
  45. package/dist/engine/iife/es2017/engine_debug.js +0 -6541
  46. package/dist/engine/iife/es5/engine.js +0 -6060
  47. package/dist/engine/iife/es5/engine.min.js +0 -23
  48. package/dist/engine/iife/es5/engine_debug.js +0 -4856
  49. package/dist/engine/umd/es2017/engine.js +0 -8014
  50. package/dist/engine/umd/es2017/engine.min.js +0 -9
  51. package/dist/engine/umd/es2017/engine_debug.js +0 -6542
  52. package/dist/engine/umd/es5/engine.js +0 -6061
  53. package/dist/engine/umd/es5/engine.min.js +0 -23
  54. package/dist/engine/umd/es5/engine_debug.js +0 -4857
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LWC = {}));
5
- }(this, (function (exports) { 'use strict';
5
+ })(this, (function (exports) { 'use strict';
6
6
 
7
7
  /* proxy-compat-disable */
8
8
 
@@ -75,7 +75,7 @@
75
75
  find: ArrayFind,
76
76
  indexOf: ArrayIndexOf,
77
77
  join: ArrayJoin,
78
- map: ArrayMap$1,
78
+ map: ArrayMap,
79
79
  push: ArrayPush$1,
80
80
  reduce: ArrayReduce,
81
81
  reverse: ArrayReverse,
@@ -142,7 +142,7 @@
142
142
  // Array.prototype.toString directly will cause an error Iterate through
143
143
  // all the items and handle individually.
144
144
  if (isArray$1(obj)) {
145
- return ArrayJoin.call(ArrayMap$1.call(obj, toString$1), ',');
145
+ return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
146
146
  }
147
147
 
148
148
  return obj.toString();
@@ -305,7 +305,7 @@
305
305
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
306
306
  return attributeName;
307
307
  }
308
- /** version: 2.5.10-alpha1 */
308
+ /** version: 2.7.0 */
309
309
 
310
310
  /*
311
311
  * Copyright (c) 2018, salesforce.com, inc.
@@ -419,7 +419,6 @@
419
419
  ENABLE_NODE_LIST_PATCH: null,
420
420
  ENABLE_HTML_COLLECTIONS_PATCH: null,
421
421
  ENABLE_NODE_PATCH: null,
422
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
423
422
  ENABLE_MIXED_SHADOW_MODE: null,
424
423
  ENABLE_WIRE_SYNC_EMIT: null
425
424
  };
@@ -485,7 +484,7 @@
485
484
  setFeatureFlag(name, value);
486
485
  }
487
486
  }
488
- /** version: 2.5.10-alpha1 */
487
+ /** version: 2.7.0 */
489
488
 
490
489
  /* proxy-compat-disable */
491
490
 
@@ -1932,10 +1931,10 @@
1932
1931
  isArray
1933
1932
  } = Array;
1934
1933
  const {
1934
+ prototype: ObjectDotPrototype,
1935
1935
  getPrototypeOf,
1936
1936
  create: ObjectCreate,
1937
1937
  defineProperty: ObjectDefineProperty,
1938
- defineProperties: ObjectDefineProperties,
1939
1938
  isExtensible,
1940
1939
  getOwnPropertyDescriptor,
1941
1940
  getOwnPropertyNames,
@@ -1945,8 +1944,7 @@
1945
1944
  } = Object;
1946
1945
  const {
1947
1946
  push: ArrayPush,
1948
- concat: ArrayConcat,
1949
- map: ArrayMap
1947
+ concat: ArrayConcat
1950
1948
  } = Array.prototype;
1951
1949
  const OtS = {}.toString;
1952
1950
 
@@ -2011,7 +2009,9 @@
2011
2009
  // but it will always be compatible with the previous descriptor
2012
2010
  // to preserve the object invariants, which makes these lines safe.
2013
2011
 
2014
- const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
2012
+ const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
2013
+
2014
+ /* istanbul ignore else */
2015
2015
 
2016
2016
  if (!isUndefined(originalDescriptor)) {
2017
2017
  const wrappedDesc = this.wrapDescriptor(originalDescriptor);
@@ -2039,11 +2039,17 @@
2039
2039
 
2040
2040
  preventExtensions(shadowTarget);
2041
2041
  } // Shared Traps
2042
+ // TODO: apply() is never called
2043
+
2044
+ /* istanbul ignore next */
2042
2045
 
2043
2046
 
2044
2047
  apply(shadowTarget, thisArg, argArray) {
2045
2048
  /* No op */
2046
- }
2049
+ } // TODO: construct() is never called
2050
+
2051
+ /* istanbul ignore next */
2052
+
2047
2053
 
2048
2054
  construct(shadowTarget, argArray, newTarget) {
2049
2055
  /* No op */
@@ -2156,8 +2162,8 @@
2156
2162
 
2157
2163
  }
2158
2164
 
2159
- const getterMap = new WeakMap();
2160
- const setterMap = new WeakMap();
2165
+ const getterMap$1 = new WeakMap();
2166
+ const setterMap$1 = new WeakMap();
2161
2167
  const reverseGetterMap = new WeakMap();
2162
2168
  const reverseSetterMap = new WeakMap();
2163
2169
 
@@ -2167,7 +2173,7 @@
2167
2173
  }
2168
2174
 
2169
2175
  wrapGetter(originalGet) {
2170
- const wrappedGetter = getterMap.get(originalGet);
2176
+ const wrappedGetter = getterMap$1.get(originalGet);
2171
2177
 
2172
2178
  if (!isUndefined(wrappedGetter)) {
2173
2179
  return wrappedGetter;
@@ -2180,13 +2186,13 @@
2180
2186
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2181
2187
  };
2182
2188
 
2183
- getterMap.set(originalGet, get);
2189
+ getterMap$1.set(originalGet, get);
2184
2190
  reverseGetterMap.set(get, originalGet);
2185
2191
  return get;
2186
2192
  }
2187
2193
 
2188
2194
  wrapSetter(originalSet) {
2189
- const wrappedSetter = setterMap.get(originalSet);
2195
+ const wrappedSetter = setterMap$1.get(originalSet);
2190
2196
 
2191
2197
  if (!isUndefined(wrappedSetter)) {
2192
2198
  return wrappedSetter;
@@ -2197,7 +2203,7 @@
2197
2203
  originalSet.call(unwrap$1(this), unwrap$1(v));
2198
2204
  };
2199
2205
 
2200
- setterMap.set(originalSet, set);
2206
+ setterMap$1.set(originalSet, set);
2201
2207
  reverseSetterMap.set(set, originalSet);
2202
2208
  return set;
2203
2209
  }
@@ -2238,7 +2244,7 @@
2238
2244
  return unwrap$1(redGet.call(handler.wrapValue(this)));
2239
2245
  };
2240
2246
 
2241
- getterMap.set(get, redGet);
2247
+ getterMap$1.set(get, redGet);
2242
2248
  reverseGetterMap.set(redGet, get);
2243
2249
  return get;
2244
2250
  }
@@ -2257,7 +2263,7 @@
2257
2263
  redSet.call(handler.wrapValue(this), handler.wrapValue(v));
2258
2264
  };
2259
2265
 
2260
- setterMap.set(set, redSet);
2266
+ setterMap$1.set(set, redSet);
2261
2267
  reverseSetterMap.set(redSet, set);
2262
2268
  return set;
2263
2269
  }
@@ -2298,6 +2304,7 @@
2298
2304
  }
2299
2305
 
2300
2306
  setPrototypeOf(shadowTarget, prototype) {
2307
+ /* istanbul ignore else */
2301
2308
  if (process.env.NODE_ENV !== 'production') {
2302
2309
  throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
2303
2310
  }
@@ -2311,6 +2318,11 @@
2311
2318
  preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
2312
2319
  // the preventExtension call, in which case we should not attempt to lock down
2313
2320
  // the shadow target.
2321
+ // TODO: It should not actually be possible to reach this `if` statement.
2322
+ // If a proxy rejects extensions, then calling preventExtensions will throw an error:
2323
+ // https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
2324
+
2325
+ /* istanbul ignore if */
2314
2326
 
2315
2327
  if (isExtensible(originalTarget)) {
2316
2328
  return false;
@@ -2352,8 +2364,8 @@
2352
2364
 
2353
2365
  }
2354
2366
 
2355
- const getterMap$1 = new WeakMap();
2356
- const setterMap$1 = new WeakMap();
2367
+ const getterMap = new WeakMap();
2368
+ const setterMap = new WeakMap();
2357
2369
 
2358
2370
  class ReadOnlyHandler extends BaseProxyHandler {
2359
2371
  wrapValue(value) {
@@ -2361,7 +2373,7 @@
2361
2373
  }
2362
2374
 
2363
2375
  wrapGetter(originalGet) {
2364
- const wrappedGetter = getterMap$1.get(originalGet);
2376
+ const wrappedGetter = getterMap.get(originalGet);
2365
2377
 
2366
2378
  if (!isUndefined(wrappedGetter)) {
2367
2379
  return wrappedGetter;
@@ -2374,12 +2386,12 @@
2374
2386
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2375
2387
  };
2376
2388
 
2377
- getterMap$1.set(originalGet, get);
2389
+ getterMap.set(originalGet, get);
2378
2390
  return get;
2379
2391
  }
2380
2392
 
2381
2393
  wrapSetter(originalSet) {
2382
- const wrappedSetter = setterMap$1.get(originalSet);
2394
+ const wrappedSetter = setterMap.get(originalSet);
2383
2395
 
2384
2396
  if (!isUndefined(wrappedSetter)) {
2385
2397
  return wrappedSetter;
@@ -2388,6 +2400,7 @@
2388
2400
  const handler = this;
2389
2401
 
2390
2402
  const set = function (v) {
2403
+ /* istanbul ignore else */
2391
2404
  if (process.env.NODE_ENV !== 'production') {
2392
2405
  const {
2393
2406
  originalTarget
@@ -2396,33 +2409,41 @@
2396
2409
  }
2397
2410
  };
2398
2411
 
2399
- setterMap$1.set(originalSet, set);
2412
+ setterMap.set(originalSet, set);
2400
2413
  return set;
2401
2414
  }
2402
2415
 
2403
2416
  set(shadowTarget, key, value) {
2417
+ /* istanbul ignore else */
2404
2418
  if (process.env.NODE_ENV !== 'production') {
2405
2419
  const {
2406
2420
  originalTarget
2407
2421
  } = this;
2408
- throw new Error(`Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
2422
+ const msg = isArray(originalTarget) ? `Invalid mutation: Cannot mutate array at index ${key.toString()}. Array is read-only.` : `Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`;
2423
+ throw new Error(msg);
2409
2424
  }
2425
+ /* istanbul ignore next */
2426
+
2410
2427
 
2411
2428
  return false;
2412
2429
  }
2413
2430
 
2414
2431
  deleteProperty(shadowTarget, key) {
2432
+ /* istanbul ignore else */
2415
2433
  if (process.env.NODE_ENV !== 'production') {
2416
2434
  const {
2417
2435
  originalTarget
2418
2436
  } = this;
2419
2437
  throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
2420
2438
  }
2439
+ /* istanbul ignore next */
2440
+
2421
2441
 
2422
2442
  return false;
2423
2443
  }
2424
2444
 
2425
2445
  setPrototypeOf(shadowTarget, prototype) {
2446
+ /* istanbul ignore else */
2426
2447
  if (process.env.NODE_ENV !== 'production') {
2427
2448
  const {
2428
2449
  originalTarget
@@ -2432,23 +2453,29 @@
2432
2453
  }
2433
2454
 
2434
2455
  preventExtensions(shadowTarget) {
2456
+ /* istanbul ignore else */
2435
2457
  if (process.env.NODE_ENV !== 'production') {
2436
2458
  const {
2437
2459
  originalTarget
2438
2460
  } = this;
2439
2461
  throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
2440
2462
  }
2463
+ /* istanbul ignore next */
2464
+
2441
2465
 
2442
2466
  return false;
2443
2467
  }
2444
2468
 
2445
2469
  defineProperty(shadowTarget, key, descriptor) {
2470
+ /* istanbul ignore else */
2446
2471
  if (process.env.NODE_ENV !== 'production') {
2447
2472
  const {
2448
2473
  originalTarget
2449
2474
  } = this;
2450
2475
  throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
2451
2476
  }
2477
+ /* istanbul ignore next */
2478
+
2452
2479
 
2453
2480
  return false;
2454
2481
  }
@@ -2506,6 +2533,8 @@
2506
2533
  }; // Inspired from paulmillr/es6-shim
2507
2534
  // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
2508
2535
 
2536
+ /* istanbul ignore next */
2537
+
2509
2538
  function getGlobal() {
2510
2539
  // the only reliable means to get the global object is `Function('return this')()`
2511
2540
  // However, this causes CSP violations in Chrome apps.
@@ -2530,6 +2559,7 @@
2530
2559
  }
2531
2560
 
2532
2561
  function init() {
2562
+ /* istanbul ignore if */
2533
2563
  if (process.env.NODE_ENV === 'production') {
2534
2564
  // this method should never leak to prod
2535
2565
  throw new ReferenceError();
@@ -2544,13 +2574,13 @@
2544
2574
  ArrayPush.call(devtoolsFormatters, formatter);
2545
2575
  global.devtoolsFormatters = devtoolsFormatters;
2546
2576
  }
2577
+ /* istanbul ignore else */
2578
+
2547
2579
 
2548
2580
  if (process.env.NODE_ENV !== 'production') {
2549
2581
  init();
2550
2582
  }
2551
2583
 
2552
- const ObjectDotPrototype = Object.prototype;
2553
-
2554
2584
  function defaultValueIsObservable(value) {
2555
2585
  // intentionally checking for null
2556
2586
  if (value === null) {
@@ -2578,106 +2608,85 @@
2578
2608
  /* do nothing */
2579
2609
  };
2580
2610
 
2581
- const defaultValueDistortion = value => value;
2582
-
2583
2611
  function createShadowTarget(value) {
2584
2612
  return isArray(value) ? [] : {};
2585
2613
  }
2586
2614
 
2587
- class ReactiveMembrane {
2588
- constructor(options) {
2589
- this.valueDistortion = defaultValueDistortion;
2590
- this.valueMutated = defaultValueMutated;
2591
- this.valueObserved = defaultValueObserved;
2592
- this.valueIsObservable = defaultValueIsObservable;
2593
- this.objectGraph = new WeakMap();
2594
-
2595
- if (!isUndefined(options)) {
2596
- const {
2597
- valueDistortion,
2598
- valueMutated,
2599
- valueObserved,
2600
- valueIsObservable,
2601
- tagPropertyKey
2602
- } = options;
2603
- this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
2604
- this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2605
- this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2606
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2607
- this.tagPropertyKey = tagPropertyKey;
2608
- }
2615
+ class ObservableMembrane {
2616
+ constructor(options = {}) {
2617
+ this.readOnlyObjectGraph = new WeakMap();
2618
+ this.reactiveObjectGraph = new WeakMap();
2619
+ const {
2620
+ valueMutated,
2621
+ valueObserved,
2622
+ valueIsObservable,
2623
+ tagPropertyKey
2624
+ } = options;
2625
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2626
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2627
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2628
+ this.tagPropertyKey = tagPropertyKey;
2609
2629
  }
2610
2630
 
2611
2631
  getProxy(value) {
2612
2632
  const unwrappedValue = unwrap$1(value);
2613
- const distorted = this.valueDistortion(unwrappedValue);
2614
2633
 
2615
- if (this.valueIsObservable(distorted)) {
2616
- const o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
2617
- // we return the readonly.
2634
+ if (this.valueIsObservable(unwrappedValue)) {
2635
+ // When trying to extract the writable version of a readonly we return the readonly.
2636
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2637
+ return value;
2638
+ }
2618
2639
 
2619
- return o.readOnly === value ? value : o.reactive;
2640
+ return this.getReactiveHandler(unwrappedValue);
2620
2641
  }
2621
2642
 
2622
- return distorted;
2643
+ return unwrappedValue;
2623
2644
  }
2624
2645
 
2625
2646
  getReadOnlyProxy(value) {
2626
2647
  value = unwrap$1(value);
2627
- const distorted = this.valueDistortion(value);
2628
2648
 
2629
- if (this.valueIsObservable(distorted)) {
2630
- return this.getReactiveState(value, distorted).readOnly;
2649
+ if (this.valueIsObservable(value)) {
2650
+ return this.getReadOnlyHandler(value);
2631
2651
  }
2632
2652
 
2633
- return distorted;
2653
+ return value;
2634
2654
  }
2635
2655
 
2636
2656
  unwrapProxy(p) {
2637
2657
  return unwrap$1(p);
2638
2658
  }
2639
2659
 
2640
- getReactiveState(value, distortedValue) {
2641
- const {
2642
- objectGraph
2643
- } = this;
2644
- let reactiveState = objectGraph.get(distortedValue);
2660
+ getReactiveHandler(value) {
2661
+ let proxy = this.reactiveObjectGraph.get(value);
2645
2662
 
2646
- if (reactiveState) {
2647
- return reactiveState;
2663
+ if (isUndefined(proxy)) {
2664
+ // caching the proxy after the first time it is accessed
2665
+ const handler = new ReactiveProxyHandler(this, value);
2666
+ proxy = new Proxy(createShadowTarget(value), handler);
2667
+ registerProxy(proxy, value);
2668
+ this.reactiveObjectGraph.set(value, proxy);
2648
2669
  }
2649
2670
 
2650
- const membrane = this;
2651
- reactiveState = {
2652
- get reactive() {
2653
- const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
2654
-
2655
- const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
2656
- registerProxy(proxy, value);
2657
- ObjectDefineProperty(this, 'reactive', {
2658
- value: proxy
2659
- });
2660
- return proxy;
2661
- },
2671
+ return proxy;
2672
+ }
2662
2673
 
2663
- get readOnly() {
2664
- const readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
2674
+ getReadOnlyHandler(value) {
2675
+ let proxy = this.readOnlyObjectGraph.get(value);
2665
2676
 
2666
- const proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
2667
- registerProxy(proxy, value);
2668
- ObjectDefineProperty(this, 'readOnly', {
2669
- value: proxy
2670
- });
2671
- return proxy;
2672
- }
2677
+ if (isUndefined(proxy)) {
2678
+ // caching the proxy after the first time it is accessed
2679
+ const handler = new ReadOnlyHandler(this, value);
2680
+ proxy = new Proxy(createShadowTarget(value), handler);
2681
+ registerProxy(proxy, value);
2682
+ this.readOnlyObjectGraph.set(value, proxy);
2683
+ }
2673
2684
 
2674
- };
2675
- objectGraph.set(distortedValue, reactiveState);
2676
- return reactiveState;
2685
+ return proxy;
2677
2686
  }
2678
2687
 
2679
2688
  }
2680
- /** version: 1.0.0 */
2689
+ /** version: 2.0.0 */
2681
2690
 
2682
2691
  /*
2683
2692
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2688,15 +2697,9 @@
2688
2697
 
2689
2698
 
2690
2699
  const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2691
-
2692
- function valueDistortion(value) {
2693
- return value;
2694
- }
2695
-
2696
- const reactiveMembrane = new ReactiveMembrane({
2700
+ const reactiveMembrane = new ObservableMembrane({
2697
2701
  valueObserved,
2698
2702
  valueMutated,
2699
- valueDistortion,
2700
2703
  tagPropertyKey: lockerLivePropertyKey
2701
2704
  });
2702
2705
  /**
@@ -2705,16 +2708,9 @@
2705
2708
  * change or being removed.
2706
2709
  */
2707
2710
 
2708
- const unwrap = function (value) {
2709
- const unwrapped = reactiveMembrane.unwrapProxy(value);
2710
-
2711
- if (unwrapped !== value) {
2712
- // if value is a proxy, unwrap to access original value and apply distortion
2713
- return valueDistortion(unwrapped);
2714
- }
2715
-
2716
- return value;
2717
- };
2711
+ function unwrap(value) {
2712
+ return reactiveMembrane.unwrapProxy(value);
2713
+ }
2718
2714
  /*
2719
2715
  * Copyright (c) 2018, salesforce.com, inc.
2720
2716
  * All rights reserved.
@@ -4699,13 +4695,15 @@
4699
4695
 
4700
4696
  function updateChildrenHook(oldVnode, vnode) {
4701
4697
  const {
4702
- children,
4703
- owner
4698
+ elm,
4699
+ children
4704
4700
  } = vnode;
4705
- const fn = hasDynamicChildren(children) ? updateDynamicChildren : updateStaticChildren;
4706
- runWithBoundaryProtection(owner, owner.owner, noop, () => {
4707
- fn(vnode.elm, oldVnode.children, children);
4708
- }, noop);
4701
+
4702
+ if (hasDynamicChildren(children)) {
4703
+ updateDynamicChildren(elm, oldVnode.children, children);
4704
+ } else {
4705
+ updateStaticChildren(elm, oldVnode.children, children);
4706
+ }
4709
4707
  }
4710
4708
 
4711
4709
  function allocateChildrenHook(vnode, vm) {
@@ -5943,6 +5941,7 @@
5943
5941
 
5944
5942
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5945
5943
  const content = [];
5944
+ let root;
5946
5945
 
5947
5946
  for (let i = 0; i < stylesheets.length; i++) {
5948
5947
  let stylesheet = stylesheets[i];
@@ -5955,23 +5954,46 @@
5955
5954
  // the component instance might be attempting to use an old version of
5956
5955
  // the stylesheet, while internally, we have a replacement for it.
5957
5956
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5958
- } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5959
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5957
+ }
5960
5958
 
5959
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5960
+
5961
+ const scopeToken = isScopedCss || vm.shadowMode === 1
5962
+ /* Synthetic */
5963
+ && vm.renderMode === 1
5964
+ /* Shadow */
5965
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5966
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5961
5967
 
5962
- const isScopedCss = stylesheet[KEY__SCOPED_CSS];
5963
5968
  const useActualHostSelector = vm.renderMode === 0
5964
5969
  /* Light */
5965
5970
  ? !isScopedCss : vm.shadowMode === 0
5966
5971
  /* Native */
5967
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5972
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5973
+ // we use an attribute selector on the host to simulate :dir().
5968
5974
 
5969
- const scopeToken = isScopedCss || vm.shadowMode === 1
5970
- /* Synthetic */
5971
- && vm.renderMode === 1
5975
+ let useNativeDirPseudoclass;
5976
+
5977
+ if (vm.renderMode === 1
5972
5978
  /* Shadow */
5973
- ? stylesheetToken : undefined;
5974
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
5979
+ ) {
5980
+ useNativeDirPseudoclass = vm.shadowMode === 0
5981
+ /* Native */
5982
+ ;
5983
+ } else {
5984
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
5985
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
5986
+ if (isUndefined$1(root)) {
5987
+ // Only calculate the root once as necessary
5988
+ root = getNearestShadowComponent(vm);
5989
+ }
5990
+
5991
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
5992
+ /* Native */
5993
+ ;
5994
+ }
5995
+
5996
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5975
5997
  }
5976
5998
  }
5977
5999
 
@@ -5995,14 +6017,12 @@
5995
6017
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
5996
6018
 
5997
6019
 
5998
- function getNearestNativeShadowComponent(vm) {
6020
+ function getNearestShadowComponent(vm) {
5999
6021
  let owner = vm;
6000
6022
 
6001
6023
  while (!isNull(owner)) {
6002
6024
  if (owner.renderMode === 1
6003
6025
  /* Shadow */
6004
- && owner.shadowMode === 0
6005
- /* Native */
6006
6026
  ) {
6007
6027
  return owner;
6008
6028
  }
@@ -6013,6 +6033,20 @@
6013
6033
  return owner;
6014
6034
  }
6015
6035
 
6036
+ function getNearestNativeShadowComponent(vm) {
6037
+ const owner = getNearestShadowComponent(vm);
6038
+
6039
+ if (!isNull(owner) && owner.shadowMode === 1
6040
+ /* Synthetic */
6041
+ ) {
6042
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
6043
+ // synthetic, we know we won't find a native component if we go any further.
6044
+ return null;
6045
+ }
6046
+
6047
+ return owner;
6048
+ }
6049
+
6016
6050
  function createStylesheet(vm, stylesheets) {
6017
6051
  const {
6018
6052
  renderer,
@@ -6130,7 +6164,7 @@
6130
6164
  if (isProfilerEnabled) {
6131
6165
  currentDispatcher(opId, 0
6132
6166
  /* Start */
6133
- , vm.tagName, vm.idx);
6167
+ , vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6134
6168
  }
6135
6169
  }
6136
6170
 
@@ -6144,7 +6178,7 @@
6144
6178
  if (isProfilerEnabled) {
6145
6179
  currentDispatcher(opId, 1
6146
6180
  /* Stop */
6147
- , vm.tagName, vm.idx);
6181
+ , vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6148
6182
  }
6149
6183
  }
6150
6184
 
@@ -6158,7 +6192,7 @@
6158
6192
  if (isProfilerEnabled) {
6159
6193
  currentDispatcher(opId, 0
6160
6194
  /* Start */
6161
- , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
6195
+ , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
6162
6196
  }
6163
6197
  }
6164
6198
 
@@ -6172,7 +6206,7 @@
6172
6206
  if (isProfilerEnabled) {
6173
6207
  currentDispatcher(opId, 1
6174
6208
  /* Stop */
6175
- , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
6209
+ , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
6176
6210
  }
6177
6211
  }
6178
6212
  /*
@@ -7753,7 +7787,7 @@
7753
7787
  hooksAreSet = true;
7754
7788
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7755
7789
  }
7756
- /* version: 2.5.10-alpha1 */
7790
+ /* version: 2.7.0 */
7757
7791
 
7758
7792
  /*
7759
7793
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8409,7 +8443,7 @@
8409
8443
  });
8410
8444
  freeze(LightningElement);
8411
8445
  seal(LightningElement.prototype);
8412
- /* version: 2.5.10-alpha1 */
8446
+ /* version: 2.7.0 */
8413
8447
 
8414
8448
  exports.LightningElement = LightningElement;
8415
8449
  exports.__unstable__ProfilerControl = profilerControl;
@@ -8440,4 +8474,4 @@
8440
8474
 
8441
8475
  Object.defineProperty(exports, '__esModule', { value: true });
8442
8476
 
8443
- })));
8477
+ }));