Circus
Explore posts from serversTTCTheo's Typesafe Cult
•Created by yadaraf on 4/24/2024 in #questions
Should I switch jobs?
I also work from California and 110 is very low for a company that is based in thr state. Your results may vary, but that sounds objectively low if your efficiency can be shown to exceed 5 years SWE
Edit: The market is hot garbage right now, so that's to be considered. 110 still seems low though
9 replies
TTCTheo's Typesafe Cult
•Created by Circus on 4/22/2024 in #questions
Appropriate Use of Modals - Attach to mapped components or pass modal logic down?
Perhaps I steered the conversation incorrectly by trying to go with a simple ToDo list, apologies.
As of right now, I have the parent server component that fetches the data. Each child component has access to the database and can manipulate its data correctly in the database. Each child component has the modal component that is hidden, and the modal component is all that uses state.
I think what you're saying is move the modal logic up, but that would make a server component into a client component?
8 replies
TTCTheo's Typesafe Cult
•Created by Circus on 4/22/2024 in #questions
Appropriate Use of Modals - Attach to mapped components or pass modal logic down?
@michaeldrotar Correct me if I'm wrong, but it sounds like if there's any kind of complexity, then to keep the modal on the component? So if the modal handled deleting that specific ToDo from a ToDo list or something more, just keep the modal on each respective component?
8 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
I think you can also export in the server function, so in actions.ts (or wherever), I found this works too:
And then bring in this function. This would possibly be a cleaner method than passing down
revalidatePath
?32 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
32 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
@james162861 You just scratched an itch I've had for so long. Dude, thank you so much! This is exactly what I've been looking for 🙏 🙏 🙏
32 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
@james162861 Just a gentle reminder - did you have a chance to take a look?
32 replies
TTCTheo's Typesafe Cult
•Created by Bartholomeas on 11/25/2023 in #questions
Revalidating tRPC server request/page after email change
Did you ever find a solution for TRPC? I'm having similar difficulties
4 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
@james162861
Edited for clarification:
I have attached a minimum repo link showing what I mean with a simple readme using T3's set up post router to show the issue. No packages added, using T3 stack @latest and minimal changes
https://github.com/spenserschwartz/t3-trpc-revalidate-issue
32 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
I can confirm #2, but #1 does not work in TRPC, which is the issue I've encountered. The queries in server components seem to be cached in a way that navigating back to a page that has already been rendered will hold onto the old data until you refresh the page.
32 replies
TTCTheo's Typesafe Cult
•Created by aditya on 4/2/2024 in #questions
Query Invalidation with trpc not working with React Server Components and App Router
@james162861 this process would only work for a child component existing on the same url path, right? Is there a way to handle this revalidation for non-child components and/or different paths?
32 replies
TTCTheo's Typesafe Cult
•Created by om3r on 4/17/2024 in #questions
how to pass trpc typescript between parent and children ?
I don't really know what you're saying here, but what Liltripple was referring to was RouterOutputs, which would something like this
export type RouterOutputs = inferRouterOutputs<AppRouter>;
and then define your type, which for you would be something like
export type Submission = RouterOutputs["users"]["submission"]
https://trpc.io/docs/client/vanilla/infer-types7 replies
TTCTheo's Typesafe Cult
•Created by 5knnbdwm on 4/16/2024 in #questions
Is Theo's new tutorial any good for a Vue Dev?
@5knnbdwm Going in the inverse, I've only ever worked in React but will be soon working in Vue professionally. Would you have a tutorial to recommend into your world?
7 replies
TTCTheo's Typesafe Cult
•Created by v-for-v on 4/15/2024 in #questions
Will server components be refeteched on mutation?
From experience...no. There are other posts like this one positing the same thing hoping to hear of some solution. Having to turn those dependent components into client components because of TRPC is a task I'm hoping not to do as well
https://discord.com/channels/966627436387266600/1226108661710196807
4 replies
TTCTheo's Typesafe Cult
•Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
I'm sure you've seen
revalidatePath
, which would be helpful if TRPC ever implemented something like this.
https://nextjs.org/docs/app/api-reference/functions/revalidatePath
I haven't been able to make it work with TRPC though :/12 replies
TTCTheo's Typesafe Cult
•Created by Bartholomeas on 4/6/2024 in #questions
Refetching/revalidating server query with TRPC
I'm working on this issue as well. @Bartholomeas did you ever find a solution other than
router.refresh
?12 replies
TTCTheo's Typesafe Cult
•Created by ElonMask on 4/3/2024 in #questions
ai prompting doubt
https://platform.openai.com/docs/guides/prompt-engineering
This is well worth going through (even if your AI is not openai). It'll guide you to return types and all the jazz and is what got me completing a pretty complex AI request with very minimal error
4 replies
TTCTheo's Typesafe Cult
•Created by Kuldeep Saini on 3/29/2024 in #questions
State Management
With that kind of question, it's best if you go through the official docs for React first. Then when you have a better grasp, go through Next's official docs. They're pretty thorough to get started
3 replies
TTCTheo's Typesafe Cult
•Created by Teodorant, Tech-Priest on 3/29/2024 in #questions
How do I migrate from Next-Auth to Clerk Auth?
This is a very good question that doesn't have a good answer (I just went down this rabbit hole recently). Here's the official thread on the Clerk discord https://discord.com/channels/856971667393609759/1176214255645773895
I don't know much about NextAuth, but I did get a simple version of Clerk working with TRPC on app router with public & protected routes, so if that's within the scope, I may be able to help out more
5 replies