Skip to content

Commit

Permalink
refactor(ssr): do not pass props/attrs to tmpl (#5095)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Jan 6, 2025
1 parent abfe39f commit 0013158
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
6 changes: 2 additions & 4 deletions packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ const bGenerateMarkup = esTemplate`
yield* __renderAttrs(instance, attrs, hostScopeToken, scopeToken);
yield '>';
yield* tmplFn(
props,
attrs,
shadowSlottedContent,
lightSlottedContent,
${/*component class*/ 3},
lightSlottedContent,
${/*component class*/ 3},
instance
);
yield \`</\${tagName}>\`;
Expand Down
6 changes: 2 additions & 4 deletions packages/@lwc/ssr-compiler/src/compile-template/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ import type { CompilationMode } from '@lwc/shared';
// TODO [#4663]: Render mode mismatch between template and compiler should throw.
const bExportTemplate = esTemplate`
export default async function* tmpl(
props,
attrs,
shadowSlottedContent,
lightSlottedContent,
Cmp,
lightSlottedContent,
Cmp,
instance
) {
// Deliberately using let so we can mutate as many times as we want in the same scope.
Expand Down
4 changes: 0 additions & 4 deletions packages/@lwc/ssr-runtime/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ export function renderAttrsNoYield(
}

export function* fallbackTmpl(
_props: unknown,
_attrs: unknown,
_shadowSlottedContent: unknown,
_lightSlottedContent: unknown,
Cmp: LightningElementConstructor,
Expand All @@ -110,8 +108,6 @@ export function* fallbackTmpl(

export function fallbackTmplNoYield(
emit: (segment: string) => void,
_props: unknown,
_attrs: unknown,
_shadowSlottedContent: unknown,
_lightSlottedContent: unknown,
Cmp: LightningElementConstructor,
Expand Down

0 comments on commit 0013158

Please sign in to comment.