0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

[ci] yarn format

This commit is contained in:
matthewp 2021-07-21 16:28:09 +00:00 committed by GitHub Actions
parent 4a601adbf2
commit 91f7c89e77

View file

@ -669,12 +669,7 @@ async function compileHtml(enterNode: TemplateNode, state: CodegenState, compile
const [componentNamespace] = componentName.split('.'); const [componentNamespace] = componentName.split('.');
componentInfo = components.get(componentNamespace); componentInfo = components.get(componentNamespace);
} }
if ( if ((isFrontmatterDefinedComponent(componentName, componentInfo, state) && !isCustomElementTag(componentName)) || isFragmentComponent(componentName)) {
(
isFrontmatterDefinedComponent(componentName, componentInfo, state) &&
!isCustomElementTag(componentName)
) || isFragmentComponent(componentName)
) {
if (hydrationAttributes.method) { if (hydrationAttributes.method) {
throw new Error( throw new Error(
`Unable to hydrate "${componentName}" because it is statically defined in the frontmatter script. Hydration directives may only be used on imported components.` `Unable to hydrate "${componentName}" because it is statically defined in the frontmatter script. Hydration directives may only be used on imported components.`
@ -697,10 +692,7 @@ async function compileHtml(enterNode: TemplateNode, state: CodegenState, compile
buffers[curr] += `h(${componentName}, ${attributes ? generateAttributes(attributes) : 'null'}`; buffers[curr] += `h(${componentName}, ${attributes ? generateAttributes(attributes) : 'null'}`;
paren++; paren++;
return; return;
} else if ( } else if (!componentInfo && !isCustomElementTag(componentName)) {
!componentInfo &&
!isCustomElementTag(componentName)
) {
throw new Error(`Unable to render "${componentName}" because it is undefined\n ${state.filename}`); throw new Error(`Unable to render "${componentName}" because it is undefined\n ${state.filename}`);
} }
if (componentName === 'Markdown') { if (componentName === 'Markdown') {