@lwc/ssr-runtime 8.12.7 → 8.13.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/class-list.d.ts +1 -1
- package/dist/index.cjs.js +17 -31
- package/dist/index.js +17 -31
- package/dist/render.d.ts +3 -3
- package/package.json +4 -4
package/dist/class-list.d.ts
CHANGED
@@ -23,11 +23,11 @@ export declare class ClassList implements DOMTokenList {
|
|
23
23
|
toggle(classNameToToggle: string, force?: boolean): boolean;
|
24
24
|
get value(): string;
|
25
25
|
toString(): string;
|
26
|
+
get length(): number;
|
26
27
|
[index: number]: never;
|
27
28
|
item(_index: number): string | null;
|
28
29
|
supports(_token: string): boolean;
|
29
30
|
forEach(_callbackfn: (value: string, key: number, parent: DOMTokenList) => void, _thisArg?: any): void;
|
30
|
-
get length(): number;
|
31
31
|
}
|
32
32
|
export {};
|
33
33
|
//# sourceMappingURL=class-list.d.ts.map
|
package/dist/index.cjs.js
CHANGED
@@ -258,48 +258,26 @@ assign,
|
|
258
258
|
create,
|
259
259
|
/** Detached {@linkcode Object.defineProperties}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties MDN Reference}. */
|
260
260
|
defineProperties,
|
261
|
-
/** Detached {@linkcode Object.defineProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty MDN Reference}. */
|
262
|
-
defineProperty,
|
263
261
|
/** Detached {@linkcode Object.entries}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries MDN Reference}. */
|
264
262
|
entries,
|
265
|
-
/** Detached {@linkcode Object.freeze}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze MDN Reference}. */
|
266
|
-
freeze,
|
267
|
-
/** Detached {@linkcode Object.fromEntries}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries MDN Reference}. */
|
268
|
-
fromEntries,
|
269
|
-
/** Detached {@linkcode Object.getOwnPropertyDescriptor}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor MDN Reference}. */
|
270
|
-
getOwnPropertyDescriptor: getOwnPropertyDescriptor$1,
|
271
|
-
/** Detached {@linkcode Object.getOwnPropertyDescriptors}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors MDN Reference}. */
|
272
|
-
getOwnPropertyDescriptors,
|
273
263
|
/** Detached {@linkcode Object.getOwnPropertyNames}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames MDN Reference}. */
|
274
264
|
getOwnPropertyNames: getOwnPropertyNames$1,
|
275
|
-
/** Detached {@linkcode Object.getOwnPropertySymbols}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols MDN Reference}. */
|
276
|
-
getOwnPropertySymbols: getOwnPropertySymbols$1,
|
277
|
-
/** Detached {@linkcode Object.getPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf MDN Reference}. */
|
278
|
-
getPrototypeOf: getPrototypeOf$1,
|
279
265
|
/** Detached {@linkcode Object.hasOwnProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty MDN Reference}. */
|
280
266
|
hasOwnProperty: hasOwnProperty$1,
|
281
|
-
/** Detached {@linkcode Object.isFrozen}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen MDN Reference}. */
|
282
|
-
isFrozen,
|
283
267
|
/** Detached {@linkcode Object.keys}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys MDN Reference}. */
|
284
|
-
keys
|
285
|
-
/** Detached {@linkcode Object.seal}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal MDN Reference}. */
|
286
|
-
seal,
|
287
|
-
/** Detached {@linkcode Object.setPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf MDN Reference}. */
|
288
|
-
setPrototypeOf, } = Object;
|
268
|
+
keys} = Object;
|
289
269
|
const {
|
290
270
|
/** Detached {@linkcode Array.isArray}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray MDN Reference}. */
|
291
|
-
isArray: isArray$1
|
292
|
-
/** Detached {@linkcode Array.from}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from MDN Reference}. */
|
293
|
-
from: ArrayFrom, } = Array;
|
271
|
+
isArray: isArray$1} = Array;
|
294
272
|
// For some reason, JSDoc don't get picked up for multiple renamed destructured constants (even
|
295
273
|
// though it works fine for one, e.g. isArray), so comments for these are added to the export
|
296
274
|
// statement, rather than this declaration.
|
297
|
-
const {
|
275
|
+
const { join: ArrayJoin, map: ArrayMap, forEach, // Weird anomaly!
|
298
276
|
} = Array.prototype;
|
299
277
|
/** Detached {@linkcode String.fromCharCode}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode MDN Reference}. */
|
300
278
|
const { fromCharCode: StringFromCharCode } = String;
|
301
279
|
// No JSDocs here - see comment for Array.prototype
|
302
|
-
const {
|
280
|
+
const { charCodeAt: StringCharCodeAt, replace: StringReplace, toLowerCase: StringToLowerCase, trim: StringTrim, } = String.prototype;
|
303
281
|
/**
|
304
282
|
* Determines whether the argument is `undefined`.
|
305
283
|
* @param obj Value to test
|
@@ -631,7 +609,7 @@ function setHooks(hooks) {
|
|
631
609
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
632
610
|
*/
|
633
611
|
const DEFAULT_SSR_MODE = 'sync';
|
634
|
-
/** version: 8.
|
612
|
+
/** version: 8.13.0 */
|
635
613
|
|
636
614
|
/*
|
637
615
|
* Copyright (c) 2024, Salesforce, Inc.
|
@@ -695,6 +673,10 @@ class ClassList {
|
|
695
673
|
toString() {
|
696
674
|
return this.el.className;
|
697
675
|
}
|
676
|
+
get length() {
|
677
|
+
const currentClassNameStr = this.el.className ?? '';
|
678
|
+
return currentClassNameStr.split(MULTI_SPACE).length;
|
679
|
+
}
|
698
680
|
item(_index) {
|
699
681
|
throw new Error('Method "item" not implemented.');
|
700
682
|
}
|
@@ -704,9 +686,6 @@ class ClassList {
|
|
704
686
|
forEach(_callbackfn, _thisArg) {
|
705
687
|
throw new Error('Method "forEach" not implemented.');
|
706
688
|
}
|
707
|
-
get length() {
|
708
|
-
throw new Error('Property "length" not implemented.');
|
709
|
-
}
|
710
689
|
}
|
711
690
|
|
712
691
|
/******************************************************************************
|
@@ -1568,6 +1547,13 @@ async function serverSideRenderComponent(tagName, Component, props = {}, mode =
|
|
1568
1547
|
const emit = (segment) => {
|
1569
1548
|
markup += segment;
|
1570
1549
|
};
|
1550
|
+
if (!generateMarkup) {
|
1551
|
+
// If a non-component is accidentally provided, render an empty template
|
1552
|
+
emit(`<${tagName}>`);
|
1553
|
+
fallbackTmplNoYield(emit, null, null, null, Component, null);
|
1554
|
+
emit(`</${tagName}>`);
|
1555
|
+
return markup;
|
1556
|
+
}
|
1571
1557
|
if (mode === 'asyncYield') {
|
1572
1558
|
for await (const segment of generateMarkup(tagName, props, null, null, null, null, null, null, null)) {
|
1573
1559
|
markup += segment;
|
@@ -1846,5 +1832,5 @@ exports.track = track;
|
|
1846
1832
|
exports.unwrap = unwrap$1;
|
1847
1833
|
exports.validateStyleTextContents = validateStyleTextContents;
|
1848
1834
|
exports.wire = wire;
|
1849
|
-
/** version: 8.
|
1835
|
+
/** version: 8.13.0 */
|
1850
1836
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.js
CHANGED
@@ -254,48 +254,26 @@ assign,
|
|
254
254
|
create,
|
255
255
|
/** Detached {@linkcode Object.defineProperties}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties MDN Reference}. */
|
256
256
|
defineProperties,
|
257
|
-
/** Detached {@linkcode Object.defineProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty MDN Reference}. */
|
258
|
-
defineProperty,
|
259
257
|
/** Detached {@linkcode Object.entries}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries MDN Reference}. */
|
260
258
|
entries,
|
261
|
-
/** Detached {@linkcode Object.freeze}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze MDN Reference}. */
|
262
|
-
freeze,
|
263
|
-
/** Detached {@linkcode Object.fromEntries}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries MDN Reference}. */
|
264
|
-
fromEntries,
|
265
|
-
/** Detached {@linkcode Object.getOwnPropertyDescriptor}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor MDN Reference}. */
|
266
|
-
getOwnPropertyDescriptor: getOwnPropertyDescriptor$1,
|
267
|
-
/** Detached {@linkcode Object.getOwnPropertyDescriptors}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors MDN Reference}. */
|
268
|
-
getOwnPropertyDescriptors,
|
269
259
|
/** Detached {@linkcode Object.getOwnPropertyNames}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames MDN Reference}. */
|
270
260
|
getOwnPropertyNames: getOwnPropertyNames$1,
|
271
|
-
/** Detached {@linkcode Object.getOwnPropertySymbols}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols MDN Reference}. */
|
272
|
-
getOwnPropertySymbols: getOwnPropertySymbols$1,
|
273
|
-
/** Detached {@linkcode Object.getPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf MDN Reference}. */
|
274
|
-
getPrototypeOf: getPrototypeOf$1,
|
275
261
|
/** Detached {@linkcode Object.hasOwnProperty}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty MDN Reference}. */
|
276
262
|
hasOwnProperty: hasOwnProperty$1,
|
277
|
-
/** Detached {@linkcode Object.isFrozen}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen MDN Reference}. */
|
278
|
-
isFrozen,
|
279
263
|
/** Detached {@linkcode Object.keys}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys MDN Reference}. */
|
280
|
-
keys
|
281
|
-
/** Detached {@linkcode Object.seal}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal MDN Reference}. */
|
282
|
-
seal,
|
283
|
-
/** Detached {@linkcode Object.setPrototypeOf}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf MDN Reference}. */
|
284
|
-
setPrototypeOf, } = Object;
|
264
|
+
keys} = Object;
|
285
265
|
const {
|
286
266
|
/** Detached {@linkcode Array.isArray}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray MDN Reference}. */
|
287
|
-
isArray: isArray$1
|
288
|
-
/** Detached {@linkcode Array.from}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from MDN Reference}. */
|
289
|
-
from: ArrayFrom, } = Array;
|
267
|
+
isArray: isArray$1} = Array;
|
290
268
|
// For some reason, JSDoc don't get picked up for multiple renamed destructured constants (even
|
291
269
|
// though it works fine for one, e.g. isArray), so comments for these are added to the export
|
292
270
|
// statement, rather than this declaration.
|
293
|
-
const {
|
271
|
+
const { join: ArrayJoin, map: ArrayMap, forEach, // Weird anomaly!
|
294
272
|
} = Array.prototype;
|
295
273
|
/** Detached {@linkcode String.fromCharCode}; see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode MDN Reference}. */
|
296
274
|
const { fromCharCode: StringFromCharCode } = String;
|
297
275
|
// No JSDocs here - see comment for Array.prototype
|
298
|
-
const {
|
276
|
+
const { charCodeAt: StringCharCodeAt, replace: StringReplace, toLowerCase: StringToLowerCase, trim: StringTrim, } = String.prototype;
|
299
277
|
/**
|
300
278
|
* Determines whether the argument is `undefined`.
|
301
279
|
* @param obj Value to test
|
@@ -627,7 +605,7 @@ function setHooks(hooks) {
|
|
627
605
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
628
606
|
*/
|
629
607
|
const DEFAULT_SSR_MODE = 'sync';
|
630
|
-
/** version: 8.
|
608
|
+
/** version: 8.13.0 */
|
631
609
|
|
632
610
|
/*
|
633
611
|
* Copyright (c) 2024, Salesforce, Inc.
|
@@ -691,6 +669,10 @@ class ClassList {
|
|
691
669
|
toString() {
|
692
670
|
return this.el.className;
|
693
671
|
}
|
672
|
+
get length() {
|
673
|
+
const currentClassNameStr = this.el.className ?? '';
|
674
|
+
return currentClassNameStr.split(MULTI_SPACE).length;
|
675
|
+
}
|
694
676
|
item(_index) {
|
695
677
|
throw new Error('Method "item" not implemented.');
|
696
678
|
}
|
@@ -700,9 +682,6 @@ class ClassList {
|
|
700
682
|
forEach(_callbackfn, _thisArg) {
|
701
683
|
throw new Error('Method "forEach" not implemented.');
|
702
684
|
}
|
703
|
-
get length() {
|
704
|
-
throw new Error('Property "length" not implemented.');
|
705
|
-
}
|
706
685
|
}
|
707
686
|
|
708
687
|
/******************************************************************************
|
@@ -1564,6 +1543,13 @@ async function serverSideRenderComponent(tagName, Component, props = {}, mode =
|
|
1564
1543
|
const emit = (segment) => {
|
1565
1544
|
markup += segment;
|
1566
1545
|
};
|
1546
|
+
if (!generateMarkup) {
|
1547
|
+
// If a non-component is accidentally provided, render an empty template
|
1548
|
+
emit(`<${tagName}>`);
|
1549
|
+
fallbackTmplNoYield(emit, null, null, null, Component, null);
|
1550
|
+
emit(`</${tagName}>`);
|
1551
|
+
return markup;
|
1552
|
+
}
|
1567
1553
|
if (mode === 'asyncYield') {
|
1568
1554
|
for await (const segment of generateMarkup(tagName, props, null, null, null, null, null, null, null)) {
|
1569
1555
|
markup += segment;
|
@@ -1797,5 +1783,5 @@ function createContextProvider(adapter) {
|
|
1797
1783
|
}
|
1798
1784
|
|
1799
1785
|
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 };
|
1800
|
-
/** version: 8.
|
1786
|
+
/** version: 8.13.0 */
|
1801
1787
|
//# sourceMappingURL=index.js.map
|
package/dist/render.d.ts
CHANGED
@@ -3,13 +3,13 @@ import type { LightningElement, LightningElementConstructor } from './lightning-
|
|
3
3
|
import type { Attributes, Properties } from './types';
|
4
4
|
export declare function renderAttrs(instance: LightningElement, attrs: Attributes, hostScopeToken: string | undefined, scopeToken: string | undefined): Generator<string, void, unknown>;
|
5
5
|
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:
|
7
|
-
export declare function fallbackTmplNoYield(emit: (segment: string) => void, shadowSlottedContent: AsyncGeneratorFunction, _lightSlottedContent: unknown, _scopedSlottedContent: unknown, Cmp: LightningElementConstructor, instance:
|
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
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
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
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
11
|
type GenerateMarkupFnVariants = GenerateMarkupFn | GenerateMarkupFnAsyncNoGen | GenerateMarkupFnSyncNoGen;
|
12
|
-
interface ComponentWithGenerateMarkup {
|
12
|
+
interface ComponentWithGenerateMarkup extends LightningElementConstructor {
|
13
13
|
[SYMBOL__GENERATE_MARKUP]: GenerateMarkupFnVariants;
|
14
14
|
}
|
15
15
|
export declare function serverSideRenderComponent(tagName: string, Component: ComponentWithGenerateMarkup, props?: Properties, mode?: 'asyncYield' | 'async' | 'sync'): Promise<string>;
|
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.
|
7
|
+
"version": "8.13.0-alpha.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.
|
52
|
-
"@lwc/engine-core": "8.
|
51
|
+
"@lwc/shared": "8.13.0-alpha.0",
|
52
|
+
"@lwc/engine-core": "8.13.0-alpha.0",
|
53
53
|
"observable-membrane": "2.0.0"
|
54
54
|
}
|
55
|
-
}
|
55
|
+
}
|