AlexErrant
Explore posts from serversHow 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
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
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
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.tsx11 replies
`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
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-dockview11 replies
Client side singleton for heavy resource allocation
https://docs.solidjs.com/solid-start/reference/config/define-config#parameters
see the ssr property
Also maybe consider using
https://docs.solidjs.com/solid-start/reference/client/client-only
2 replies
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
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