lanc3
lanc3
Explore posts from servers
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob πŸ—• πŸ—— πŸ—™ on 1/6/2025 in #questions
Nuqs slower than useStste
Next.js should have no issues with this use-case, I have even used search params just using replace for search bars and such with no visible delays
13 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob πŸ—• πŸ—— πŸ—™ on 1/6/2025 in #questions
Nuqs slower than useStste
^^ search params are essentially free, but how frameworks interact with it may not be
13 replies
TTCTheo's Typesafe Cult
Created by JustSomeDev on 12/2/2024 in #questions
Is there a way to use varadic arguments to recurse a type?
the return type may not be possible, at least I wasn't able to figure it out
6 replies
TTCTheo's Typesafe Cult
Created by JustSomeDev on 12/2/2024 in #questions
Is there a way to use varadic arguments to recurse a type?
I was able to write this and this works for the arguments
6 replies
TTCTheo's Typesafe Cult
Created by JustSomeDev on 12/2/2024 in #questions
Is there a way to use varadic arguments to recurse a type?
type RecurseKeys<O extends object, K extends keyof O> = [
K,
...(O[K] extends object ? RecurseKeys<O[K], keyof O[K]> : [])
];

const pluck = <O extends object, K extends keyof O>(
o: O,
arg_0: K,
...args: O[K] extends object ? RecurseKeys<O[K], keyof O[K]> : never
) => {
let r = o[arg_0];
for (let k in args) {
r = r[k];
}

return r;
};

const a = pluck({ a: { b: 2 }, c: { d: 3 } }, "c", "d");
type RecurseKeys<O extends object, K extends keyof O> = [
K,
...(O[K] extends object ? RecurseKeys<O[K], keyof O[K]> : [])
];

const pluck = <O extends object, K extends keyof O>(
o: O,
arg_0: K,
...args: O[K] extends object ? RecurseKeys<O[K], keyof O[K]> : never
) => {
let r = o[arg_0];
for (let k in args) {
r = r[k];
}

return r;
};

const a = pluck({ a: { b: 2 }, c: { d: 3 } }, "c", "d");
6 replies
TTCTheo's Typesafe Cult
Created by Mohit on 10/25/2024 in #questions
Facing issue when adding graphql to nextjs
You must create a custom component that wraps the apollo provider with "use client" at the top
3 replies
TTCTheo's Typesafe Cult
Created by Peter on 9/13/2024 in #questions
PlanetScale vs. AWS
Might prefer neon for postgres otherwise dynamodb is a bit cheaper than both AFAIK though not as nice to use as either
8 replies
TTCTheo's Typesafe Cult
Created by Y7YA on 8/11/2024 in #questions
Server actions in server components
No description
6 replies
TTCTheo's Typesafe Cult
Created by BackurdiπŸ™Œ on 8/21/2024 in #questions
What’s the best way to host my Next.js project if I need to have a static IP address?
I'd also check out https://www.flightcontrol.dev/, it's basically an abstraction on top of AWS that provides an experince like Railway
7 replies
TTCTheo's Typesafe Cult
Created by Jeremy on 8/7/2024 in #questions
Session not complete on expo but it is on NextJS
Would probably need the nextjs logs, signing out on t3 turbo does it in a unique way compared to the web with a specific tRPC procedure signOut https://github.com/t3-oss/create-t3-turbo/blob/main/packages/api/src/router/auth.ts
5 replies
TTCTheo's Typesafe Cult
Created by antoni on 7/14/2024 in #questions
[t3-turbo]: Redirect does not work in app
You need to redirect to your app after successful login, it does not know when to close the browser. If you're using expo https://docs.expo.dev/guides/linking/#linking-to-your-app
3 replies
TTCTheo's Typesafe Cult
Created by rdickert on 6/27/2024 in #questions
Using nextauth discord with vercel deployments
You create a proxy auth service like t3-turbo does. It basically just serves a static URI for your preview environments. I don't remember the exact logic, but you can just reference t3 turbo
8 replies
TTCTheo's Typesafe Cult
Created by bythewayitsjosh on 6/23/2024 in #questions
trpc with Server Actions
If you're going to use server actions, that is what I would do. Server actions are not great for querying, unless you want to do a lot of route invalidation which might not be performant, but they do make certain data mutations a lot easier. Boiler plate of tRPC and generic API handlers to change a field or two is very annoying, but server actions handle that easily no issues Tanstack query is also just great tooling for queries and you can't use that with server components / server actions
6 replies
TTCTheo's Typesafe Cult
Created by Ibnu Rasikh - creatypestudio.co on 6/4/2024 in #questions
Have you experienced your Next.js getting hacked?
Getting "hacked" in the traditional sense is basically non-existent in non-self hosted sites. Often WordPress users are non-technical and malware can easily be disguised in plugins and themes. This is also an issue for npm libraries but much less prevalent. You can definetly get hacked though for self-hosted solutions of wordpress and next.js, but that's regardless of the framework
4 replies
DTDrizzle Team
Created by ethan! on 5/27/2024 in #help
Enums
otherwise drizzle will not pick it up
9 replies
DTDrizzle Team
Created by ethan! on 5/27/2024 in #help
Enums
You probably need to export that enum
9 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/24/2023 in #questions
How can I use a localStorage persister?
really depends though on how your application works
9 replies