lxsmnsyc
lxsmnsyc
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
no, it only reloads the changed module (or those modules that actually wanted to be reloaded) by default, it doesn't reload unchanged modules
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
once a module is unchanged it will always remain unchanged
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
I don't see how this would not work except if you have cyclic imports, as you mentioned
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
honestly it always worked for me
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
what does your file with createContext look like
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
I might have to re-imagine things here, probably needs discussion with Ryan
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
so that createContext doesn't have to re-run on a TSX file, which causes different calls. TBF HMR for createContext is supported (useContext actually looks up by context ID so the HMR just carries over the already created one) but I guess the file extension is limited.
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
this is too unsafe for a fix
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
which is why I always recommend isolating createContext into a separate file
27 replies
SSolidJS
Created by Tom on 10/15/2024 in #support
Context lost on HMR
if you have the context creation in the same file as the useContext call, the bug can occur
27 replies
SSolidJS
Created by Luka on 9/21/2024 in #support
Sevoral Error while using AbortController
if I understood correctly he's passing an object that contains an AbortSignal (a value unsupported by seroval) to a server function, expecting control on request cancellation
9 replies
SSolidJS
Created by Luka on 9/21/2024 in #support
Sevoral Error while using AbortController
if preview_image is a server function, AbortSignal isn't a serializable value. See https://github.com/lxsmnsyc/seroval/blob/main/docs/compatibility.md#supported-types
9 replies
SSolidJS
Created by Misery on 8/26/2024 in #support
`ReferenceError: jQuery is not defined`
there's two reasons: - this runs on SSR - jQuery is definitely missing
8 replies
SSolidJS
Created by flippyflops on 8/23/2024 in #support
Is there a way to enforce children of a particular component type?
Maybe
export type CodeGroupProps = {
children: string[];
};

export function CodeGroup(props: CodeGroupProps) {
return (
<div class={css.codeGroup}>
<For each={props.codes}>{(code) => <Code label={code} />}</For>
</div>
);
}

<CodeGroup>
{['Ctrl', 'M']}
</CodeGroup>
export type CodeGroupProps = {
children: string[];
};

export function CodeGroup(props: CodeGroupProps) {
return (
<div class={css.codeGroup}>
<For each={props.codes}>{(code) => <Code label={code} />}</For>
</div>
);
}

<CodeGroup>
{['Ctrl', 'M']}
</CodeGroup>
10 replies
SSolidJS
Created by flippyflops on 8/23/2024 in #support
Is there a way to enforce children of a particular component type?
What you could do is, instead of JSX children, you could just accept an array of objects
10 replies
SSolidJS
Created by flippyflops on 8/23/2024 in #support
Is there a way to enforce children of a particular component type?
There isn't really. TypeScript's JSX inference is very limited, and if you plan for runtime checks, it's impossible.
10 replies
SSolidJS
Created by Katja (katywings) on 8/7/2024 in #support
Caching server-side render results
fun fact: renderToStringAsync is actually renderToStream under the hood.
25 replies
SSolidJS
Created by mizark on 8/3/2024 in #support
<For> throws Cannot access 'product2' before initialization
ideally that initialProduct wouldn't work given the nature of createAsync (createResource)'s non-blocking behavior
7 replies
SSolidJS
Created by mizark on 8/3/2024 in #support
<For> throws Cannot access 'product2' before initialization
The workaround is as simple as: product()?.imgs
7 replies
SSolidJS
Created by mizark on 8/3/2024 in #support
<For> throws Cannot access 'product2' before initialization
I would assume product() is a resource and so the error comes from the fact that it is initially undefined (becomes undefined.imgs which is the error). Resources being initially undefined is natural.
7 replies