fix(ssr): avoid reserved keyword collision #3300
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
3 errors
|
src/__tests__/compilation.spec.ts > component compilation > implicit templates imports do not use full file paths:
packages/@lwc/ssr-compiler/src/__tests__/compilation.spec.ts#L13
AssertionError: expected 'import {fallbackTmplNoYield as __fall…' to contain 'import tmpl from "./component.html"'
- Expected
+ Received
- import tmpl from "./component.html"
+ import {fallbackTmplNoYield as __fallbackTmpl, hasScopedStaticStylesheets, mutationTracker as __mutationTracker, renderAttrsNoYield as __renderAttrs, SYMBOL__GENERATE_MARKUP as __SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS as __SYMBOL__SET_INTERNALS, establishContextfulRelationship as __establishContextfulRelationship} from "@lwc/ssr-runtime";
+ import {SYMBOL__DEFAULT_TEMPLATE as __SYMBOL__DEFAULT_TEMPLATE} from "@lwc/ssr-runtime";
+ import __lwcTmpl from "./component.html";
+ import {LightningElement} from "@lwc/ssr-runtime";
+ export default class DefaultComponentName extends LightningElement {}
+ const __lwcPublicFields__ = new Set([]);
+ const __lwcPrivateFields__ = new Set([]);
+ function generateMarkup($$emit, tagName, props, attrs, shadowSlottedContent, lightSlottedContent, parent, scopeToken, contextfulParent) {
+ tagName = tagName ?? "-";
+ attrs = attrs ?? Object.create(null);
+ props = props ?? Object.create(null);
+ const instance = new DefaultComponentName({
+ tagName: tagName.toUpperCase()
+ });
+ __establishContextfulRelationship(contextfulParent, instance);
+ instance[__SYMBOL__SET_INTERNALS](props, attrs, __lwcPublicFields__, __lwcPrivateFields__);
+ instance.isConnected = true;
+ if (instance.connectedCallback) {
+ __mutationTracker.enable(instance);
+ instance.connectedCallback();
+ __mutationTracker.disable(instance);
+ }
+ const tmplFn = (instance.render?.() ?? DefaultComponentName[__SYMBOL__DEFAULT_TEMPLATE]) ?? __fallbackTmpl;
+ $$emit(`<${tagName}`);
+ const hostHasScopedStylesheets = tmplFn.hasScopedStylesheets || hasScopedStaticStylesheets(DefaultComponentName);
+ const hostScopeToken = hostHasScopedStylesheets ? tmplFn.stylesheetScopeToken + "-host" : undefined;
+ __renderAttrs($$emit, instance, attrs, hostScopeToken, scopeToken);
+ $$emit('>');
+ tmplFn($$emit, shadowSlottedContent, lightSlottedContent, DefaultComponentName, instance);
+ $$emit(`</${tagName}>`);
+ }
+ DefaultComponentName[__SYMBOL__GENERATE_MARKUP] = generateMarkup;
+ if (__lwcTmpl) {
+ DefaultComponentName[__SYMBOL__DEFAULT_TEMPLATE] = __lwcTmpl;
+ }
+
❯ src/__tests__/compilation.spec.ts:13:22
|
|
src/__tests__/compilation.spec.ts > component compilation > supports .ts file imports:
packages/@lwc/ssr-compiler/src/__tests__/compilation.spec.ts#L32
AssertionError: expected 'import {fallbackTmplNoYield as __fall…' to contain 'import tmpl from "./component.html"'
- Expected
+ Received
- import tmpl from "./component.html"
+ import {fallbackTmplNoYield as __fallbackTmpl, hasScopedStaticStylesheets, mutationTracker as __mutationTracker, renderAttrsNoYield as __renderAttrs, SYMBOL__GENERATE_MARKUP as __SYMBOL__GENERATE_MARKUP, SYMBOL__SET_INTERNALS as __SYMBOL__SET_INTERNALS, establishContextfulRelationship as __establishContextfulRelationship} from "@lwc/ssr-runtime";
+ import {SYMBOL__DEFAULT_TEMPLATE as __SYMBOL__DEFAULT_TEMPLATE} from "@lwc/ssr-runtime";
+ import __lwcTmpl from "./component.html";
+ import {LightningElement} from "@lwc/ssr-runtime";
+ export default class DefaultComponentName extends LightningElement {}
+ const __lwcPublicFields__ = new Set([]);
+ const __lwcPrivateFields__ = new Set([]);
+ function generateMarkup($$emit, tagName, props, attrs, shadowSlottedContent, lightSlottedContent, parent, scopeToken, contextfulParent) {
+ tagName = tagName ?? "-";
+ attrs = attrs ?? Object.create(null);
+ props = props ?? Object.create(null);
+ const instance = new DefaultComponentName({
+ tagName: tagName.toUpperCase()
+ });
+ __establishContextfulRelationship(contextfulParent, instance);
+ instance[__SYMBOL__SET_INTERNALS](props, attrs, __lwcPublicFields__, __lwcPrivateFields__);
+ instance.isConnected = true;
+ if (instance.connectedCallback) {
+ __mutationTracker.enable(instance);
+ instance.connectedCallback();
+ __mutationTracker.disable(instance);
+ }
+ const tmplFn = (instance.render?.() ?? DefaultComponentName[__SYMBOL__DEFAULT_TEMPLATE]) ?? __fallbackTmpl;
+ $$emit(`<${tagName}`);
+ const hostHasScopedStylesheets = tmplFn.hasScopedStylesheets || hasScopedStaticStylesheets(DefaultComponentName);
+ const hostScopeToken = hostHasScopedStylesheets ? tmplFn.stylesheetScopeToken + "-host" : undefined;
+ __renderAttrs($$emit, instance, attrs, hostScopeToken, scopeToken);
+ $$emit('>');
+ tmplFn($$emit, shadowSlottedContent, lightSlottedContent, DefaultComponentName, instance);
+ $$emit(`</${tagName}>`);
+ }
+ DefaultComponentName[__SYMBOL__GENERATE_MARKUP] = generateMarkup;
+ if (__lwcTmpl) {
+ DefaultComponentName[__SYMBOL__DEFAULT_TEMPLATE] = __lwcTmpl;
+ }
+
❯ src/__tests__/compilation.spec.ts:32:22
|
|
run-unit-tests
Process completed with exit code 1.
|