@lwc/ssr-runtime 8.14.0 → 8.15.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.
package/dist/index.cjs.js CHANGED
@@ -609,7 +609,23 @@ function setHooks(hooks) {
609
609
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
610
610
  */
611
611
  const DEFAULT_SSR_MODE = 'sync';
612
- /** version: 8.14.0 */
612
+
613
+ /*
614
+ * Copyright (c) 2025, salesforce.com, inc.
615
+ * All rights reserved.
616
+ * SPDX-License-Identifier: MIT
617
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
618
+ */
619
+ /**
620
+ * Global HTML "tabindex" attribute is specially massaged into a stringified number
621
+ * This follows the historical behavior in api.ts:
622
+ * https://github.com/salesforce/lwc/blob/f34a347/packages/%40lwc/engine-core/src/framework/api.ts#L193-L211
623
+ */
624
+ function normalizeTabIndex(value) {
625
+ const shouldNormalize = value > 0 && typeof value !== 'boolean';
626
+ return shouldNormalize ? 0 : value;
627
+ }
628
+ /** version: 8.15.0 */
613
629
 
614
630
  /*
615
631
  * Copyright (c) 2024, Salesforce, Inc.
@@ -1334,7 +1350,7 @@ class LightningElement {
1334
1350
  _LightningElement_classList.set(this, null);
1335
1351
  assign(this, propsAvailableAtConstruction);
1336
1352
  }
1337
- [(_LightningElement_props = new WeakMap(), _LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(), SYMBOL__SET_INTERNALS)](props, attrs, publicProperties, privateProperties) {
1353
+ [(_LightningElement_props = new WeakMap(), _LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(), SYMBOL__SET_INTERNALS)](props, attrs, publicProperties) {
1338
1354
  __classPrivateFieldSet(this, _LightningElement_props, props, "f");
1339
1355
  __classPrivateFieldSet(this, _LightningElement_attrs, attrs, "f");
1340
1356
  // Class should be set explicitly to avoid it being overridden by connectedCallback classList mutation.
@@ -1344,12 +1360,11 @@ class LightningElement {
1344
1360
  // Avoid setting the following types of properties that should not be set:
1345
1361
  // - Properties that are not public.
1346
1362
  // - Properties that are not global.
1347
- // - Properties that are global but are internally overridden.
1348
1363
  for (const propName of keys(props)) {
1349
1364
  const attrName = htmlPropertyToAttribute(propName);
1350
1365
  if (publicProperties.has(propName) ||
1351
- ((REFLECTIVE_GLOBAL_PROPERTY_SET.has(propName) || isAriaAttribute(attrName)) &&
1352
- !privateProperties.has(propName))) {
1366
+ REFLECTIVE_GLOBAL_PROPERTY_SET.has(propName) ||
1367
+ isAriaAttribute(attrName)) {
1353
1368
  // For props passed from parents to children, they are intended to be read-only
1354
1369
  // to avoid a child mutating its parent's state
1355
1370
  this[propName] = getReadOnlyProxy(props[propName]);
@@ -1475,7 +1490,7 @@ class LightningElement {
1475
1490
  defineProperties(LightningElement.prototype, descriptors);
1476
1491
 
1477
1492
  /*
1478
- * Copyright (c) 2024, salesforce.com, inc.
1493
+ * Copyright (c) 2025, Salesforce, Inc.
1479
1494
  * All rights reserved.
1480
1495
  * SPDX-License-Identifier: MIT
1481
1496
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -1533,11 +1548,11 @@ function* renderAttrs(instance, attrs, hostScopeToken, scopeToken) {
1533
1548
  function renderAttrsNoYield(emit, instance, attrs, hostScopeToken, scopeToken) {
1534
1549
  emit(renderAttrsPrivate(instance, attrs, hostScopeToken, scopeToken));
1535
1550
  }
1536
- function* fallbackTmpl(shadowSlottedContent, _lightSlottedContent, _scopedSlottedContent, Cmp, instance) {
1551
+ async function* fallbackTmpl(shadowSlottedContent, _lightSlottedContent, _scopedSlottedContent, Cmp, instance) {
1537
1552
  if (Cmp.renderMode !== 'light') {
1538
1553
  yield `<template shadowrootmode="open"></template>`;
1539
1554
  if (shadowSlottedContent) {
1540
- yield shadowSlottedContent(instance);
1555
+ yield* shadowSlottedContent(instance);
1541
1556
  }
1542
1557
  }
1543
1558
  }
@@ -1561,6 +1576,8 @@ async function serverSideRenderComponent(tagName, Component, props = {}, mode =
1561
1576
  if (!generateMarkup) {
1562
1577
  // If a non-component is accidentally provided, render an empty template
1563
1578
  emit(`<${tagName}>`);
1579
+ // Using a false type assertion for the `instance` param is safe because it's only used
1580
+ // if there's slotted content, which we are not providing
1564
1581
  fallbackTmplNoYield(emit, null, null, null, Component, null);
1565
1582
  emit(`</${tagName}>`);
1566
1583
  return markup;
@@ -1817,6 +1834,7 @@ exports.htmlEscape = htmlEscape;
1817
1834
  exports.isComponentConstructor = isComponentConstructor;
1818
1835
  exports.mutationTracker = mutationTracker;
1819
1836
  exports.normalizeClass = normalizeClass;
1837
+ exports.normalizeTabIndex = normalizeTabIndex;
1820
1838
  exports.normalizeTextContent = normalizeTextContent;
1821
1839
  exports.parseFragment = parseFragment;
1822
1840
  exports.parseSVGFragment = parseSVGFragment;
@@ -1843,5 +1861,5 @@ exports.track = track;
1843
1861
  exports.unwrap = unwrap$1;
1844
1862
  exports.validateStyleTextContents = validateStyleTextContents;
1845
1863
  exports.wire = wire;
1846
- /** version: 8.14.0 */
1864
+ /** version: 8.15.0 */
1847
1865
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export * from './stubs';
2
- export { htmlEscape, setHooks, sanitizeHtmlContent, normalizeClass } from '@lwc/shared';
2
+ export { htmlEscape, setHooks, sanitizeHtmlContent, normalizeClass, normalizeTabIndex, } from '@lwc/shared';
3
3
  export { ClassList } from './class-list';
4
4
  export { LightningElement, LightningElementConstructor, SYMBOL__DEFAULT_TEMPLATE, SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS, } from './lightning-element';
5
5
  export { mutationTracker } from './mutation-tracker';
6
- export { fallbackTmpl, fallbackTmplNoYield, GenerateMarkupFn, renderAttrs, renderAttrsNoYield, serverSideRenderComponent, serverSideRenderComponent as renderComponent, } from './render';
6
+ export { fallbackTmpl, fallbackTmplNoYield, GenerateMarkupAsyncYield, renderAttrs, renderAttrsNoYield, serverSideRenderComponent, serverSideRenderComponent as renderComponent, } from './render';
7
7
  export { normalizeTextContent, renderTextContent } from './render-text-content';
8
8
  export { hasScopedStaticStylesheets, renderStylesheets } from './styles';
9
9
  export { toIteratorDirective } from './to-iterator-directive';
package/dist/index.js CHANGED
@@ -605,7 +605,23 @@ function setHooks(hooks) {
605
605
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
606
606
  */
607
607
  const DEFAULT_SSR_MODE = 'sync';
608
- /** version: 8.14.0 */
608
+
609
+ /*
610
+ * Copyright (c) 2025, salesforce.com, inc.
611
+ * All rights reserved.
612
+ * SPDX-License-Identifier: MIT
613
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
614
+ */
615
+ /**
616
+ * Global HTML "tabindex" attribute is specially massaged into a stringified number
617
+ * This follows the historical behavior in api.ts:
618
+ * https://github.com/salesforce/lwc/blob/f34a347/packages/%40lwc/engine-core/src/framework/api.ts#L193-L211
619
+ */
620
+ function normalizeTabIndex(value) {
621
+ const shouldNormalize = value > 0 && typeof value !== 'boolean';
622
+ return shouldNormalize ? 0 : value;
623
+ }
624
+ /** version: 8.15.0 */
609
625
 
610
626
  /*
611
627
  * Copyright (c) 2024, Salesforce, Inc.
@@ -1330,7 +1346,7 @@ class LightningElement {
1330
1346
  _LightningElement_classList.set(this, null);
1331
1347
  assign(this, propsAvailableAtConstruction);
1332
1348
  }
1333
- [(_LightningElement_props = new WeakMap(), _LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(), SYMBOL__SET_INTERNALS)](props, attrs, publicProperties, privateProperties) {
1349
+ [(_LightningElement_props = new WeakMap(), _LightningElement_attrs = new WeakMap(), _LightningElement_classList = new WeakMap(), SYMBOL__SET_INTERNALS)](props, attrs, publicProperties) {
1334
1350
  __classPrivateFieldSet(this, _LightningElement_props, props, "f");
1335
1351
  __classPrivateFieldSet(this, _LightningElement_attrs, attrs, "f");
1336
1352
  // Class should be set explicitly to avoid it being overridden by connectedCallback classList mutation.
@@ -1340,12 +1356,11 @@ class LightningElement {
1340
1356
  // Avoid setting the following types of properties that should not be set:
1341
1357
  // - Properties that are not public.
1342
1358
  // - Properties that are not global.
1343
- // - Properties that are global but are internally overridden.
1344
1359
  for (const propName of keys(props)) {
1345
1360
  const attrName = htmlPropertyToAttribute(propName);
1346
1361
  if (publicProperties.has(propName) ||
1347
- ((REFLECTIVE_GLOBAL_PROPERTY_SET.has(propName) || isAriaAttribute(attrName)) &&
1348
- !privateProperties.has(propName))) {
1362
+ REFLECTIVE_GLOBAL_PROPERTY_SET.has(propName) ||
1363
+ isAriaAttribute(attrName)) {
1349
1364
  // For props passed from parents to children, they are intended to be read-only
1350
1365
  // to avoid a child mutating its parent's state
1351
1366
  this[propName] = getReadOnlyProxy(props[propName]);
@@ -1471,7 +1486,7 @@ class LightningElement {
1471
1486
  defineProperties(LightningElement.prototype, descriptors);
1472
1487
 
1473
1488
  /*
1474
- * Copyright (c) 2024, salesforce.com, inc.
1489
+ * Copyright (c) 2025, Salesforce, Inc.
1475
1490
  * All rights reserved.
1476
1491
  * SPDX-License-Identifier: MIT
1477
1492
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -1529,11 +1544,11 @@ function* renderAttrs(instance, attrs, hostScopeToken, scopeToken) {
1529
1544
  function renderAttrsNoYield(emit, instance, attrs, hostScopeToken, scopeToken) {
1530
1545
  emit(renderAttrsPrivate(instance, attrs, hostScopeToken, scopeToken));
1531
1546
  }
1532
- function* fallbackTmpl(shadowSlottedContent, _lightSlottedContent, _scopedSlottedContent, Cmp, instance) {
1547
+ async function* fallbackTmpl(shadowSlottedContent, _lightSlottedContent, _scopedSlottedContent, Cmp, instance) {
1533
1548
  if (Cmp.renderMode !== 'light') {
1534
1549
  yield `<template shadowrootmode="open"></template>`;
1535
1550
  if (shadowSlottedContent) {
1536
- yield shadowSlottedContent(instance);
1551
+ yield* shadowSlottedContent(instance);
1537
1552
  }
1538
1553
  }
1539
1554
  }
@@ -1557,6 +1572,8 @@ async function serverSideRenderComponent(tagName, Component, props = {}, mode =
1557
1572
  if (!generateMarkup) {
1558
1573
  // If a non-component is accidentally provided, render an empty template
1559
1574
  emit(`<${tagName}>`);
1575
+ // Using a false type assertion for the `instance` param is safe because it's only used
1576
+ // if there's slotted content, which we are not providing
1560
1577
  fallbackTmplNoYield(emit, null, null, null, Component, null);
1561
1578
  emit(`</${tagName}>`);
1562
1579
  return markup;
@@ -1793,6 +1810,6 @@ function createContextProvider(adapter) {
1793
1810
  };
1794
1811
  }
1795
1812
 
1796
- export { ClassList, LightningElement, SYMBOL__DEFAULT_TEMPLATE, SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS, api, connectContext, createContextProvider, createElement, establishContextfulRelationship, fallbackTmpl, fallbackTmplNoYield, freezeTemplate, getComponentDef, hasScopedStaticStylesheets, hot, htmlEscape, isComponentConstructor, mutationTracker, normalizeClass, normalizeTextContent, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, renderAttrs, renderAttrsNoYield, serverSideRenderComponent as renderComponent, renderStylesheets, renderTextContent, renderer, sanitizeAttribute, sanitizeHtmlContent, serverSideRenderComponent, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, toIteratorDirective, track, unwrap$1 as unwrap, validateStyleTextContents, wire };
1797
- /** version: 8.14.0 */
1813
+ export { ClassList, LightningElement, SYMBOL__DEFAULT_TEMPLATE, SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS, api, connectContext, createContextProvider, createElement, establishContextfulRelationship, fallbackTmpl, fallbackTmplNoYield, freezeTemplate, getComponentDef, hasScopedStaticStylesheets, hot, htmlEscape, isComponentConstructor, mutationTracker, normalizeClass, normalizeTabIndex, normalizeTextContent, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, renderAttrs, renderAttrsNoYield, serverSideRenderComponent as renderComponent, renderStylesheets, renderTextContent, renderer, sanitizeAttribute, sanitizeHtmlContent, serverSideRenderComponent, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, toIteratorDirective, track, unwrap$1 as unwrap, validateStyleTextContents, wire };
1814
+ /** version: 8.15.0 */
1798
1815
  //# sourceMappingURL=index.js.map
@@ -16,6 +16,9 @@ export declare class LightningElement implements PropsAvailableAtConstruction {
16
16
  #private;
17
17
  static renderMode?: 'light' | 'shadow';
18
18
  static stylesheets?: Stylesheets;
19
+ static delegatesFocus?: boolean;
20
+ static formAssociated?: boolean;
21
+ static shadowSupportMode?: 'any' | 'reset' | 'native';
19
22
  accessKey: string;
20
23
  dir: string;
21
24
  draggable: boolean;
@@ -28,7 +31,7 @@ export declare class LightningElement implements PropsAvailableAtConstruction {
28
31
  isConnected: boolean;
29
32
  tagName: string;
30
33
  constructor(propsAvailableAtConstruction: PropsAvailableAtConstruction & Properties);
31
- [SYMBOL__SET_INTERNALS](props: Properties, attrs: Attributes, publicProperties: Set<string>, privateProperties: Set<string>): void;
34
+ [SYMBOL__SET_INTERNALS](props: Properties, attrs: Attributes, publicProperties: Set<string>): void;
32
35
  get className(): any;
33
36
  set className(newVal: any);
34
37
  get classList(): ClassList;
package/dist/render.d.ts CHANGED
@@ -1,17 +1,55 @@
1
1
  import { SYMBOL__GENERATE_MARKUP } from './lightning-element';
2
+ import type { CompilationMode } from '@lwc/shared';
2
3
  import type { LightningElement, LightningElementConstructor } from './lightning-element';
3
4
  import type { Attributes, Properties } from './types';
5
+ /** Parameters used by all `generateMarkup` variants that don't get transmogrified. */
6
+ type BaseGenerateMarkupParams = readonly [
7
+ tagName: string,
8
+ props: Properties | null,
9
+ attrs: Attributes | null,
10
+ parent: LightningElement | null,
11
+ scopeToken: string | null,
12
+ contextfulParent: LightningElement | null
13
+ ];
14
+ /** Text emitter used by transmogrified formats. */
15
+ type Emit = (str: string) => void;
16
+ /** Slotted content function used by `asyncYield` mode. */
17
+ type SlottedContentGenerator = (instance: LightningElement) => AsyncGenerator<string, void, unknown>;
18
+ /** Slotted content function used by `sync` and `async` modes. */
19
+ type SlottedContentEmitter = ($$emit: Emit, instance: LightningElement) => void;
20
+ /** Slotted content map used by `asyncYield` mode. */
21
+ type SlottedContentGeneratorMap = Record<number | string, SlottedContentGenerator[]>;
22
+ /** Slotted content map used by `sync` and `async` modes. */
23
+ type SlottedContentEmitterMap = Record<number | string, SlottedContentEmitter[]>;
24
+ /** `generateMarkup` parameters used by `asyncYield` mode. */
25
+ type GenerateMarkupGeneratorParams = readonly [
26
+ ...BaseGenerateMarkupParams,
27
+ shadowSlottedContent: SlottedContentGenerator | null,
28
+ lightSlottedContent: SlottedContentGeneratorMap | null,
29
+ scopedSlottedContent: SlottedContentGeneratorMap | null
30
+ ];
31
+ /** `generateMarkup` parameters used by `sync` and `async` modes. */
32
+ type GenerateMarkupEmitterParams = readonly [
33
+ emit: Emit,
34
+ ...BaseGenerateMarkupParams,
35
+ shadowSlottedContent: SlottedContentEmitter | null,
36
+ lightSlottedContent: SlottedContentEmitterMap | null,
37
+ scopedSlottedContent: SlottedContentEmitterMap | null
38
+ ];
39
+ /** Signature for `asyncYield` compilation mode. */
40
+ export type GenerateMarkupAsyncYield = (...args: GenerateMarkupGeneratorParams) => AsyncGenerator<string>;
41
+ /** Signature for `async` compilation mode. */
42
+ export type GenerateMarkupAsync = (...args: GenerateMarkupEmitterParams) => Promise<void>;
43
+ /** Signature for `sync` compilation mode. */
44
+ export type GenerateMarkupSync = (...args: GenerateMarkupEmitterParams) => void;
45
+ type GenerateMarkupVariants = GenerateMarkupAsyncYield | GenerateMarkupAsync | GenerateMarkupSync;
4
46
  export declare function renderAttrs(instance: LightningElement, attrs: Attributes, hostScopeToken: string | undefined, scopeToken: string | undefined): Generator<string, void, unknown>;
5
47
  export declare function renderAttrsNoYield(emit: (segment: string) => void, instance: LightningElement, attrs: Attributes, hostScopeToken: string | undefined, scopeToken: string | undefined): void;
6
- export declare function fallbackTmpl(shadowSlottedContent: AsyncGeneratorFunction, _lightSlottedContent: unknown, _scopedSlottedContent: unknown, Cmp: LightningElementConstructor, instance: LightningElement): Generator<"<template shadowrootmode=\"open\"></template>" | AsyncGenerator<unknown, any, any>, void, unknown>;
7
- export declare function fallbackTmplNoYield(emit: (segment: string) => void, shadowSlottedContent: AsyncGeneratorFunction | null, _lightSlottedContent: unknown, _scopedSlottedContent: unknown, Cmp: LightningElementConstructor, instance: LightningElement | null): void;
8
- export type GenerateMarkupFn = (tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null, scopedSlottedContent: Record<number | string, AsyncGenerator<string>> | null, parent: LightningElement | null, scopeToken: string | null, contextfulParent: LightningElement | null) => AsyncGenerator<string>;
9
- export type GenerateMarkupFnAsyncNoGen = (emit: (segment: string) => void, tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null, scopedSlottedContent: Record<number | string, AsyncGenerator<string>> | null, parent: LightningElement | null, scopeToken: string | null, contextfulParent: LightningElement | null) => Promise<void>;
10
- export type GenerateMarkupFnSyncNoGen = (emit: (segment: string) => void, tagName: string, props: Properties | null, attrs: Attributes | null, shadowSlottedContent: AsyncGenerator<string> | null, lightSlottedContent: Record<number | string, AsyncGenerator<string>> | null, scopedSlottedContent: Record<number | string, AsyncGenerator<string>> | null, parent: LightningElement | null, scopeToken: string | null, contextfulParent: LightningElement | null) => void;
11
- type GenerateMarkupFnVariants = GenerateMarkupFn | GenerateMarkupFnAsyncNoGen | GenerateMarkupFnSyncNoGen;
48
+ export declare function fallbackTmpl(shadowSlottedContent: SlottedContentGenerator | null, _lightSlottedContent: SlottedContentGeneratorMap | null, _scopedSlottedContent: SlottedContentGeneratorMap | null, Cmp: LightningElementConstructor, instance: LightningElement): AsyncGenerator<string>;
49
+ export declare function fallbackTmplNoYield(emit: Emit, shadowSlottedContent: SlottedContentEmitter | null, _lightSlottedContent: SlottedContentEmitterMap | null, _scopedSlottedContent: SlottedContentEmitterMap | null, Cmp: LightningElementConstructor, instance: LightningElement): void;
12
50
  interface ComponentWithGenerateMarkup extends LightningElementConstructor {
13
- [SYMBOL__GENERATE_MARKUP]?: GenerateMarkupFnVariants;
51
+ [SYMBOL__GENERATE_MARKUP]?: GenerateMarkupVariants;
14
52
  }
15
- export declare function serverSideRenderComponent(tagName: string, Component: ComponentWithGenerateMarkup, props?: Properties, mode?: 'asyncYield' | 'async' | 'sync'): Promise<string>;
53
+ export declare function serverSideRenderComponent(tagName: string, Component: ComponentWithGenerateMarkup, props?: Properties, mode?: CompilationMode): Promise<string>;
16
54
  export {};
17
55
  //# sourceMappingURL=render.d.ts.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/ssr-runtime",
7
- "version": "8.14.0",
7
+ "version": "8.15.0",
8
8
  "description": "Runtime complement to @lwc/ssr-compiler",
9
9
  "keywords": [
10
10
  "lwc",
@@ -48,8 +48,8 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@lwc/shared": "8.14.0",
52
- "@lwc/engine-core": "8.14.0",
51
+ "@lwc/shared": "8.15.0",
52
+ "@lwc/engine-core": "8.15.0",
53
53
  "observable-membrane": "2.0.0"
54
54
  }
55
55
  }