autumncicada
autumncicada
Explore posts from servers
SSolidJS
Created by autumncicada on 7/13/2023 in #support
If I'm using createResource, why would I use Suspense?
Seems like the nicest pattern for this is
function Loader() {
const [resource] = createResource(fetchResourceFn);
return <Suspense fallback={<div>Loading...</div>}>
<Show when={resource()} keyed>
{(resourceVal) => <ResourceRenderer resource={resourceVal}/>}
</Show>
</Suspense>
}
function Loader() {
const [resource] = createResource(fetchResourceFn);
return <Suspense fallback={<div>Loading...</div>}>
<Show when={resource()} keyed>
{(resourceVal) => <ResourceRenderer resource={resourceVal}/>}
</Show>
</Suspense>
}
8 replies
SSolidJS
Created by autumncicada on 7/13/2023 in #support
If I'm using createResource, why would I use Suspense?
thanks for the help all
8 replies
SSolidJS
Created by autumncicada on 7/13/2023 in #support
If I'm using createResource, why would I use Suspense?
🤦 of course the answer to my exact question is in the docs
8 replies
SSolidJS
Created by autumncicada on 7/13/2023 in #support
If I'm using createResource, why would I use Suspense?
So why would you ever use Suspense over Switch + Match?
8 replies
SSolidJS
Created by autumncicada on 7/6/2023 in #support
Difficulties using Pdfjs-dist with SolidStart
I figured it out, my vite config needed to be
import solid from "solid-start/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [solid()],
ssr: {
external: ["pdfjs-dist"],
},
});
import solid from "solid-start/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [solid()],
ssr: {
external: ["pdfjs-dist"],
},
});
4 replies
SSolidJS
Created by autumncicada on 7/6/2023 in #support
Difficulties using Pdfjs-dist with SolidStart
It seems to be related to the canvas.node dependency which I do not need and would like to exclude from the bundle
4 replies
SSolidJS
Created by autumncicada on 7/6/2023 in #support
Difficulties using Pdfjs-dist with SolidStart
For clarity, I do not want these native modules to be loaded at all since i only intend to use pdfjs in the browser
4 replies