Skip to content

Commit

Permalink
Self review stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Dec 5, 2022
1 parent d839c59 commit d93a668
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/core/render/dev/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export async function getPropagationMap(
function addInjection(map: SSRResult['propagation'], modInfo: ModuleInfo | null) {
if(modInfo) {
const astro = getAstroMetadata(modInfo);
if(astro && astro.headInjection) {
map.set(modInfo.id, astro.headInjection)
if(astro && astro.propagation) {
map.set(modInfo.id, astro.propagation)
}
}
}
2 changes: 1 addition & 1 deletion packages/astro/src/jsx/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default function astroJSX(): PluginObj {
clientOnlyComponents: [],
hydratedComponents: [],
scripts: [],
headInjection: 'none',
propagation: 'none',
};
}
path.node.body.splice(
Expand Down
5 changes: 0 additions & 5 deletions packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,3 @@ export function defineStyleVars(defs: Record<any, any> | Record<any, any>[]) {
}
return markHTMLString(output);
}




//////////////////////// new stuff
3 changes: 2 additions & 1 deletion packages/astro/src/runtime/server/render/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ async function iterableToHTMLBytes(
return parts.toArrayBuffer();
}

// Recursively calls component instances that might have head content
// to be propagated up.
async function bufferHeadContent(result: SSRResult) {
debugger;
const iterator = result.propagators.values();
while(true) {
const { value, done } = iterator.next();
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-astro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default function astro({ settings, logging }: AstroPluginOptions): vite.P
clientOnlyComponents: transformResult.clientOnlyComponents,
hydratedComponents: transformResult.hydratedComponents,
scripts: transformResult.scripts,
headInjection: 'none',
propagation: 'none',
};

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-astro/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export interface PluginMetadata {
hydratedComponents: TransformResult['hydratedComponents'];
clientOnlyComponents: TransformResult['clientOnlyComponents'];
scripts: TransformResult['scripts'];
headInjection: PropagationHint;
propagation: PropagationHint;
};
}
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-head-propagation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function configAliasVitePlugin({
const info = getInfo(parent.id);
if(info?.meta.astro) {
const astroMetadata = info.meta.astro as AstroPluginMetadata['astro'];
astroMetadata.headInjection = 'in-tree';
astroMetadata.propagation = 'in-tree';
}
addHeadInjectionInTree(graph, parent.id, getInfo, seen);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-markdown-legacy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ ${tsResult}`;
clientOnlyComponents: transformResult.clientOnlyComponents,
hydratedComponents: transformResult.hydratedComponents,
scripts: transformResult.scripts,
headInjection: 'none'
propagation: 'none'
};

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function markdown({ settings, logging }: AstroPluginOptions): Plu
hydratedComponents: [],
clientOnlyComponents: [],
scripts: [],
headInjection: 'none',
propagation: 'none',
} as PluginMetadata['astro'],
vite: {
lang: 'ts',
Expand Down

0 comments on commit d93a668

Please sign in to comment.