thetarnav
thetarnav
SSolidJS
Created by thetarnav on 3/25/2024 in #support
Resource with async cache
Whats the pattern for using resources with caching that may be async? What I mean by that is that my cache_get function returns a promise so I cannot set it to the initialValue option of resources. I want to display the cached value while I fetch the actual, (the cached value is considered stale) so I cannot simply add it to the fetcher. I thought that using mutate with res.latest would give the desired behaviour, where Suspense is only triggered when initially, and not-triggered when cached value is set. Here are my two attempts: one with transitions: https://playground.solidjs.com/anonymous/6b0c7b0f-d2ec-458a-8536-883da3ae55a6 and one with additional signals: https://playground.solidjs.com/anonymous/ef897a99-c8da-4a17-84a4-68772a0cb934 Although they do kinda work, they feel incorrect. They both have the same problem that the "user" cannot easily control whether he wants to show the cached value or not. (As they could with res.latest and initialValue) It seems that maybe calling mutate should set resuorce into "refreshing" state.
6 replies
SSolidJS
Created by thetarnav on 1/1/2024 in #support
dev or build when using new solid start
since defineConfig doesn't allow passing a callback anymore, how does else can I check whether I'm doing a production build or running a dev server? previously I did this:
import {defineConfig} from "vite"

export default defineConfig((props) => {
const is_dev = props.command === "serve"
return {
optimizeDeps: {
exclude: is_dev ? ["some_dep_i_don't want_cached_in_dev"] : [],
},
}
})
import {defineConfig} from "vite"

export default defineConfig((props) => {
const is_dev = props.command === "serve"
return {
optimizeDeps: {
exclude: is_dev ? ["some_dep_i_don't want_cached_in_dev"] : [],
},
}
})
6 replies
SSolidJS
Created by thetarnav on 6/27/2023 in #support
Is there a way to see links for indexed threads?
I need answers @Answer Overflow
3 replies
SSolidJS
Created by thetarnav on 2/9/2023 in #support
Check if the code runs in CSR or CSR + hydration
Is there a way to check if the code runs during hydration or just normal CSR, the same way you are able to check if you are on the server or clinet using isServer or export conditions? This is mostly about authoring libraries, where you want to run different logic depending on if the env is SSR / CRS / CRS + hydration. it's related to the issue here: https://github.com/solidjs-community/solid-primitives/issues/310
47 replies
SSolidJS
Created by thetarnav on 11/29/2022 in #support
pog (this is cool)
pog pog pog
16 replies