Skip to content

Commit 0ad0874

Browse files
author
DominusVilicus
committed
Add renderedComponents Feature
1 parent 2548877 commit 0ad0874

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/compiler/compile/render_ssr/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export default function ssr(
147147
instance_javascript,
148148
...parent_bindings,
149149
css.code && b`$$result.css.add(#css);`,
150+
options.filename && b`$$result.renderedComponents.add('${options.filename}');`,
150151
main
151152
].filter(Boolean);
152153

src/runtime/internal/ssr.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export function create_ssr_component(fn) {
107107
map: null;
108108
code: string;
109109
}>;
110-
} = { title: '', head: '', css: new Set() };
110+
renderedComponents: Set<string>;
111+
} = { title: '', head: '', css: new Set(), renderedComponents: new Set() };
111112

112113
const html = $$render(result, props, {}, options);
113114

@@ -119,7 +120,8 @@ export function create_ssr_component(fn) {
119120
code: Array.from(result.css).map(css => css.code).join('\n'),
120121
map: null // TODO
121122
},
122-
head: result.title + result.head
123+
head: result.title + result.head,
124+
renderedComponents: Array.from(result.renderedComponents)
123125
};
124126
},
125127

0 commit comments

Comments
 (0)