AlexErrant
AlexErrant
Explore posts from servers
SSolidJS
Created by KiaClouth on 10/14/2024 in #support
How to reduce undefined judgments
IMO you're looking for trouble. Typescript has limitations. Asserting not-null is ugly, but this is why I explained to you solid's lifecyle methods. Trying to strictly follow Typescript all the time when you know better is... literally trusting the tool over your own brain >_>
19 replies
SSolidJS
Created by KiaClouth on 10/14/2024 in #support
How to reduce undefined judgments
not sure if I'm actually answering your question... but there was an attempt lol
19 replies
SSolidJS
Created by KiaClouth on 10/14/2024 in #support
How to reduce undefined judgments
then onMount/creatEffect/onCleanup will run with the not-null element-ref
19 replies
SSolidJS
Created by KiaClouth on 10/14/2024 in #support
How to reduce undefined judgments
in particular, I know that the JSX will be executed first, setting the Ref so I know it will no longer be null
19 replies
SSolidJS
Created by KiaClouth on 10/14/2024 in #support
How to reduce undefined judgments
I polish some of my code in this commit here by doing a few not null assertions. I know they're not null because I know information that Typescript doesn't know; namely I know Solid's lifecycle methods https://github.com/AlexErrant/Pentive/commit/c38aadda78da89b592ea8dfa392ada3b3da8c50a
19 replies
SSolidJS
Created by KiaClouth on 10/14/2024 in #support
How to reduce undefined judgments
...is this real code? Why aren't you calling engine on line 10?
19 replies
SSolidJS
Created by AlexErrant on 10/12/2024 in #support
How to mount a Solid component to a dom element?
Ahh, I think I have to use render; trying to use a fn component gets me the classic "computations created outside a createRoot or render will never be disposed"
11 replies
SSolidJS
Created by AlexErrant on 10/12/2024 in #support
How to mount a Solid component to a dom element?
(I love deleting code.)
11 replies
SSolidJS
Created by AlexErrant on 10/12/2024 in #support
How to mount a Solid component to a dom element?
HAH. You're so right. Thank you for deleting my entire question lol - classic X/Y problem. For any future searchers, ag-grid states "Instead of using a class component, it's possible to use a function for a Cell Component... The function should return back either a) a string of HTML or b) a DOM object." And Solid components return real dom objs!
11 replies
SSolidJS
Created by AlexErrant on 10/12/2024 in #support
How to mount a Solid component to a dom element?
thanks for the links! I'm using ag-grid's "Cell Components", so using render with it looks something like this https://stackblitz.com/edit/github-szw3fe-8nmnfy?file=src%2Fcomponents%2FAGGrid.tsx
11 replies
SSolidJS
Created by jrainearwills on 10/13/2024 in #support
`createContext`, What's the point?
honestly I think this should be more obvious in the docs...
5 replies
SSolidJS
Created by jrainearwills on 10/13/2024 in #support
`createContext`, What's the point?
It looks like I can create a store in a JS module...
Note that this is Global State, which is not recommended for SSR apps
While it is possible to use global state and computations, Context is sometimes a better solution. Additionally, it is important to note that global state should not be used in SSR (server side rendering) solutions, such as Solid Start. On the server, global state is shared across requests, and the lack of data isolation can (and will) lead to bugs, memory leaks and has security implications. It is recommended that application state should always be provided via context instead of relying on global.
https://www.solidjs.com/tutorial/stores_nocontext
5 replies
SSolidJS
Created by AlexErrant on 10/12/2024 in #support
How to mount a Solid component to a dom element?
Currently I'm working on using vanilla-js ag-grid (because the solid-js version is unmaintained) but I might be using render with DockView and/or CodeMirror too. (Though perhaps DockView should stick with Portals; I think there are drag-n-drop reasons why portals are better than render in that context; e.g. moving dom elements (summary/details) won't change their state. IDK haven't tried/tested much of anything yet.) https://github.com/lyonbot/solid-dockview
11 replies
SSolidJS
Created by AlexErrant on 10/12/2024 in #support
How to mount a Solid component to a dom element?
Yeah that detail could come into play depending on the vanilla-js lib details. Thanks for the explanation!
11 replies
SSolidJS
Created by Mango Juicy on 9/29/2024 in #support
Client side singleton for heavy resource allocation
2 replies
SSolidJS
Created by Misery on 8/26/2024 in #support
`ReferenceError: jQuery is not defined`
8 replies
SSolidJS
Created by Hussein on 8/22/2024 in #support
isDev is false in dev
honestly I just use Vite for this; import.meta.env.DEV
5 replies
SSolidJS
Created by Industrial on 8/25/2024 in #support
Using WASM in Solid(Start)
My proj (https://github.com/AlexErrant/Pentive/) has no problem with https://github.com/rhashimoto/wa-sqlite or https://github.com/open-spaced-repetition/fsrs-browser, the latter of which I built with wasm-bindgen. If you want a minimal project check out the sandbox of that project which is in Solid https://github.com/open-spaced-repetition/fsrs-browser/tree/main/sandbox . To be clear, I've not yet tried running WASM in solid start (or on the server) all my experience is with client-side wasm
10 replies
SSolidJS
Created by Hussein on 8/22/2024 in #support
Race condition
@Hussein can you retry with
throw redirect("/", { revalidate: "someWords" });
throw redirect("/", { revalidate: "someWords" });
if your action is using SingleFlightMutations I've been noticing cookies don't get used on the rendered response
9 replies
CDCloudflare Developers
Created by AlexErrant on 8/14/2024 in #pages-help
Solid's `clientOnly` only works with "Development Mode" enabled [solved]
I'm guessing SolidStart was using something that got minified away >_> probably hydration markers or something
4 replies