[ci] format
This commit is contained in:
parent
c9d8b10a85
commit
e02c72f445
8 changed files with 61 additions and 59 deletions
|
@ -94,4 +94,3 @@ test.describe('Nested Frameworks in Solid', () => {
|
|||
await expect(count, 'count incremented by 1').toHaveText('1');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ export const notify = debounce(() => {
|
|||
}
|
||||
});
|
||||
|
||||
export const listen = (cb: (...args: any[]) => any) => window.addEventListener(HYDRATE_KEY, cb, { once: true });
|
||||
export const listen = (cb: (...args: any[]) => any) =>
|
||||
window.addEventListener(HYDRATE_KEY, cb, { once: true });
|
||||
|
||||
if (!(window as any)[HYDRATE_KEY]) {
|
||||
if ('MutationObserver' in window) {
|
||||
|
|
|
@ -14,7 +14,7 @@ export default async function onIdle(
|
|||
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
||||
|
||||
async function idle() {
|
||||
listen(idle)
|
||||
listen(idle);
|
||||
const cb = async () => {
|
||||
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
||||
if (roots.length === 0) return;
|
||||
|
|
|
@ -13,7 +13,7 @@ export default async function onMedia(
|
|||
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
||||
|
||||
async function media() {
|
||||
listen(media)
|
||||
listen(media);
|
||||
const cb = async () => {
|
||||
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
||||
if (roots.length === 0) return;
|
||||
|
|
|
@ -16,7 +16,7 @@ export default async function onVisible(
|
|||
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
||||
|
||||
async function visible() {
|
||||
listen(visible)
|
||||
listen(visible);
|
||||
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
||||
const cb = async () => {
|
||||
if (roots.length === 0) return;
|
||||
|
|
|
@ -7,4 +7,4 @@ export default (element) => (Component, props, children) => {
|
|||
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children),
|
||||
element
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { sharedConfig } from 'solid-js';
|
||||
import { hydrate, render, createComponent } from 'solid-js/web';
|
||||
|
||||
export default (element) => (Component, props, childHTML, { client }) => {
|
||||
export default (element) =>
|
||||
(Component, props, childHTML, { client }) => {
|
||||
// Prepare global object expected by Solid's hydration logic
|
||||
if (!window._$HY) {
|
||||
window._$HY = { events: [], completed: new WeakSet(), r: {} };
|
||||
|
@ -33,4 +34,4 @@ export default (element) => (Component, props, childHTML, { client }) => {
|
|||
}),
|
||||
element
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { h, createSSRApp, createApp } from 'vue';
|
||||
import StaticHtml from './static-html.js';
|
||||
|
||||
export default (element) => (Component, props, children, { client }) => {
|
||||
export default (element) =>
|
||||
(Component, props, children, { client }) => {
|
||||
delete props['class'];
|
||||
if (!element.hasAttribute('ssr')) return;
|
||||
|
||||
|
@ -18,4 +19,4 @@ export default (element) => (Component, props, children, { client }) => {
|
|||
const app = createSSRApp({ name, render: () => h(Component, props, slots) });
|
||||
app.mount(element, true);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue