hotshoe
Explore posts from serversBeta2: How do I render html attribute server-side
@gh680 , yes, saw that too. question is how to [dynamically] render attributes into root (html) element. SvelteKit provides transformPageChunk to handle this, and Remix give access full tree in root so it's a no-brainer.
4 replies
createServerData$ question
I stand corrected, I need to call
data()
at the start of my component every time, else I get flaky behavior. If I run npm start
on refreshed build in stead of npm dev
then the data renders only sometimes (e.g., if I refresh page multiple times, renders around 10% of the time).6 replies
createServerData$ question
I find it depends. If, instead, I return an array and iterate over it in For loop, then works as as I'd expect (i.e., without needing to call
data())
. Or, if I change the above example o return an int, then also works as expected. The docs are pretty light on showing how to apply data route data (presumably because it requires little/no explanation)
When searching for createServerData
examples, I came across this post where author states An important thing to note here is that we had to call user() at the beginning of the component. We need to do that because the route data doesn't get fetched until we call it explicitly.
https://tahazsh.com/blog/building-a-solidjs-app-from-scratch/
This seems like an odd pattern to me, if true, and, again, I'm not finding it to be universally true.6 replies
Can a Solid store contain class objects?
@._rb , Your suggestion works (in a store). Thank you!! The docs discourage usage so I didn't try, but leaves me in no worse shape (from caveat perspective than with Svelte, where everything is 2-way binding) and my use case is special case. Sorry to keep mentioning Svelte, btw, I'm developing my next project using both SK And SS to decide on my metafw of choice going fwd and heavily leaning towards SS -- just wish it was 1.0 then would be easy choice for me, which says a lot about how awesome SS is. Thanks again!
12 replies
Can a Solid store contain class objects?
Thx for the ptr @romanobro , the video certainly makes it clear that classes are not supported, and I re-checked the docs and found
Classes are not wrapped, so objects like Date, HTMLElement, RegExp, Map, Set won't be granularly reactive as properties on a store.
so, it seems I glossed over this. Too bad not supported 😦 as this is something Svelte handles by default (although, I much prefer Solid's reactivity model overall).12 replies
Any workarounds or guidance for circular dependency warnings?
I forgot to mention, I did try to externalize the modules in question like so (but has no effect):
Again, realize vite issue but I've had zero luck, but since was I was able to resolve issue for same modules in SvelteKit (as mentioned above), wondering if there's a clean SS workaround.
2 replies
Breaking out proxied Stores object as a signal (while retaining reactivity)
Hi @ofabram , I'm able to get the behavior I'm seeking by calling back with with the proxied state object and using it to mutate using produce. It works well (so nice to have such fine grained control versus C = {...C} on collections!, and it's THE reason I'm hanging in there w/porting my SvelteKit project over to SS, and the transparency). It's not the design I had in mind, which is to call back with a string identifier -- and ignorance shouldn't drive design so that erks me -- but I'm ok for now and should be a much better place to revisit in a couple weeks time - once get more experience w/ Solid.
The only selection API I see from docs is createSelector, which has different purpose that my use case (afaict). Is there another selection API to which you're referring?
Thanks again!
9 replies
Breaking out proxied Stores object as a signal (while retaining reactivity)
Hi @ofabram , thanks for getting back! I'll take a closer look and see what I can learn/apply. Appreciate the response and suggestion -- I'll let u know how goes. TY :0)
9 replies