[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');
|
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 (!(window as any)[HYDRATE_KEY]) {
|
||||||
if ('MutationObserver' in window) {
|
if ('MutationObserver' in window) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default async function onIdle(
|
||||||
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
||||||
|
|
||||||
async function idle() {
|
async function idle() {
|
||||||
listen(idle)
|
listen(idle);
|
||||||
const cb = async () => {
|
const cb = async () => {
|
||||||
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
||||||
if (roots.length === 0) return;
|
if (roots.length === 0) return;
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default async function onMedia(
|
||||||
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
||||||
|
|
||||||
async function media() {
|
async function media() {
|
||||||
listen(media)
|
listen(media);
|
||||||
const cb = async () => {
|
const cb = async () => {
|
||||||
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
||||||
if (roots.length === 0) return;
|
if (roots.length === 0) return;
|
||||||
|
|
|
@ -16,7 +16,7 @@ export default async function onVisible(
|
||||||
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
|
||||||
|
|
||||||
async function visible() {
|
async function visible() {
|
||||||
listen(visible)
|
listen(visible);
|
||||||
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
|
||||||
const cb = async () => {
|
const cb = async () => {
|
||||||
if (roots.length === 0) return;
|
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),
|
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children),
|
||||||
element
|
element
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { sharedConfig } from 'solid-js';
|
import { sharedConfig } from 'solid-js';
|
||||||
import { hydrate, render, createComponent } from 'solid-js/web';
|
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
|
// Prepare global object expected by Solid's hydration logic
|
||||||
if (!window._$HY) {
|
if (!window._$HY) {
|
||||||
window._$HY = { events: [], completed: new WeakSet(), r: {} };
|
window._$HY = { events: [], completed: new WeakSet(), r: {} };
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { h, createSSRApp, createApp } from 'vue';
|
import { h, createSSRApp, createApp } from 'vue';
|
||||||
import StaticHtml from './static-html.js';
|
import StaticHtml from './static-html.js';
|
||||||
|
|
||||||
export default (element) => (Component, props, children, { client }) => {
|
export default (element) =>
|
||||||
|
(Component, props, children, { client }) => {
|
||||||
delete props['class'];
|
delete props['class'];
|
||||||
if (!element.hasAttribute('ssr')) return;
|
if (!element.hasAttribute('ssr')) return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue