colinshen
Explore posts from serversDTDrizzle Team
•Created by colinshen on 9/5/2024 in #help
Should I create a global drizzle instance?
1. a global drizzle instance with a global db client
2. a function that return drizzle database instance
1 replies
getRequestEvent not return the correct type in monorepo
I need a package that shared between apps. I add
solid-js
and @solidjs/start
as peerDependencies
in the package.json of the package. When I do import { getRequestEvent } from "solid-js/web";
, it only returns the type from solid-js/web not the declare module in the solid/start. How can I fix this? Thanks.1 replies
Authentication in both component and middleware
After did some search I'm still confused how solid start handles the authentication. In some auth libraries, they are using middleware to protect api routes and actions but not components(middlewares do not get called when route changes). I looked at the auth example, it only applies a simple action, not a layout.
I simply created an auth middleware (from lucia example) and protected component, but I think the solution is not clear.
6 replies
multiple layout
Routes folter
I found this works. The default index page is in dashboard folder.
I'm confusing now. Parenthesis are used to rename index page, but, in my case, I have both (auth).tsx and (dashboard).tsx. Why the dashboard worked?
1 replies
confused about primitives(useEffect,on,createComputed)
I‘m trying to create a primitive for synchronize the search params with signal. I tried different methods, all of them works as expected. I started to think of the apis and got confused.
createEffect
in this case run twice
createEffect with on
run once
createComputed
run twice
1. why some of them run twice?
2. when to use on with effect?
3. tracking signal and do some updates, shoud I just use computed?
11 replies