@lwc/engine-core 2.11.3 → 2.11.6

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.
@@ -2307,6 +2307,12 @@ function checkVersionMismatch(func, type) {
2307
2307
  }
2308
2308
  }
2309
2309
 
2310
+ /*
2311
+ * Copyright (c) 2018, salesforce.com, inc.
2312
+ * All rights reserved.
2313
+ * SPDX-License-Identifier: MIT
2314
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2315
+ */
2310
2316
  const signedTemplateSet = new Set();
2311
2317
  function defaultEmptyTemplate() {
2312
2318
  return [];
@@ -2324,6 +2330,30 @@ function registerTemplate(tpl) {
2324
2330
  checkVersionMismatch(tpl, 'template');
2325
2331
  }
2326
2332
  signedTemplateSet.add(tpl);
2333
+ // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2334
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2335
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
2336
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2337
+ shared.defineProperty(tpl, 'stylesheetTokens', {
2338
+ get() {
2339
+ const { stylesheetToken } = this;
2340
+ if (shared.isUndefined(stylesheetToken)) {
2341
+ return stylesheetToken;
2342
+ }
2343
+ // Shim for the old `stylesheetTokens` property
2344
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
2345
+ return {
2346
+ hostAttribute: `${stylesheetToken}-host`,
2347
+ shadowAttribute: stylesheetToken,
2348
+ };
2349
+ },
2350
+ set(value) {
2351
+ // If the value is null or some other exotic object, you would be broken anyway in the past
2352
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
2353
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
2354
+ this.stylesheetToken = shared.isUndefined(value) ? undefined : value.shadowAttribute;
2355
+ },
2356
+ });
2327
2357
  // chaining this method as a way to wrap existing
2328
2358
  // assignment of templates easily, without too much transformation
2329
2359
  return tpl;
@@ -6192,4 +6222,4 @@ exports.swapTemplate = swapTemplate;
6192
6222
  exports.track = track;
6193
6223
  exports.unwrap = unwrap;
6194
6224
  exports.wire = wire;
6195
- /* version: 2.11.3 */
6225
+ /* version: 2.11.6 */
@@ -2304,6 +2304,12 @@ function checkVersionMismatch(func, type) {
2304
2304
  }
2305
2305
  }
2306
2306
 
2307
+ /*
2308
+ * Copyright (c) 2018, salesforce.com, inc.
2309
+ * All rights reserved.
2310
+ * SPDX-License-Identifier: MIT
2311
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2312
+ */
2307
2313
  const signedTemplateSet = new Set();
2308
2314
  function defaultEmptyTemplate() {
2309
2315
  return [];
@@ -2321,6 +2327,30 @@ function registerTemplate(tpl) {
2321
2327
  checkVersionMismatch(tpl, 'template');
2322
2328
  }
2323
2329
  signedTemplateSet.add(tpl);
2330
+ // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2331
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2332
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
2333
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2334
+ defineProperty(tpl, 'stylesheetTokens', {
2335
+ get() {
2336
+ const { stylesheetToken } = this;
2337
+ if (isUndefined$1(stylesheetToken)) {
2338
+ return stylesheetToken;
2339
+ }
2340
+ // Shim for the old `stylesheetTokens` property
2341
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
2342
+ return {
2343
+ hostAttribute: `${stylesheetToken}-host`,
2344
+ shadowAttribute: stylesheetToken,
2345
+ };
2346
+ },
2347
+ set(value) {
2348
+ // If the value is null or some other exotic object, you would be broken anyway in the past
2349
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
2350
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
2351
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
2352
+ },
2353
+ });
2324
2354
  // chaining this method as a way to wrap existing
2325
2355
  // assignment of templates easily, without too much transformation
2326
2356
  return tpl;
@@ -6116,4 +6146,4 @@ function setHooks(hooks) {
6116
6146
  }
6117
6147
 
6118
6148
  export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, connectRootElement, createContextProvider, createVM, disconnectRootElement, getAssociatedVMIfPresent, getComponentDef, getComponentHtmlPrototype, getUpgradableConstructor, hydrateRoot, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setAddEventListener, setAssertInstanceOfHTMLElement, setAttachShadow, setCreateComment, setCreateElement, setCreateText, setDefineCustomElement, setDispatchEvent, setGetAttribute, setGetBoundingClientRect, setGetChildNodes, setGetChildren, setGetClassList, setGetCustomElement, setGetElementsByClassName, setGetElementsByTagName, setGetFirstChild, setGetFirstElementChild, setGetLastChild, setGetLastElementChild, setGetProperty, setHTMLElement, setHooks, setInsert, setInsertGlobalStylesheet, setInsertStylesheet, setIsConnected, setIsHydrating, setIsNativeShadowDefined, setIsSyntheticShadowDefined, setNextSibling, setQuerySelector, setQuerySelectorAll, setRemove, setRemoveAttribute, setRemoveEventListener, setSetAttribute, setSetCSSStyleProperty, setSetProperty, setSetText, setSsr, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
6119
- /* version: 2.11.3 */
6149
+ /* version: 2.11.6 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/engine-core",
3
- "version": "2.11.3",
3
+ "version": "2.11.6",
4
4
  "description": "Core LWC engine APIs.",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -24,8 +24,8 @@
24
24
  "types/"
25
25
  ],
26
26
  "dependencies": {
27
- "@lwc/features": "2.11.3",
28
- "@lwc/shared": "2.11.3"
27
+ "@lwc/features": "2.11.6",
28
+ "@lwc/shared": "2.11.6"
29
29
  },
30
30
  "devDependencies": {
31
31
  "observable-membrane": "2.0.0"