Sturlen
Sturlen
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Timmo on 10/17/2024 in #questions
Keep page state on navigating back from a product to the product list
if you want to keep state between navigation or refreshes, then storing it in the URL is a good choice. e.g. /produts?filter=shoes&sort=asc. you can do this manually, but there are libraries like tanstack-router that make this easier. tRPC/react-query also caches your results, so as long as you call it with the same sorting and filtering options. this means the user will see the previous results immediately when navigating back
4 replies
TTCTheo's Typesafe Cult
Created by Bored Student on 10/7/2024 in #questions
From Post to API
No description
6 replies
TTCTheo's Typesafe Cult
Created by Bored Student on 10/7/2024 in #questions
From Post to API
htmx might be up your alley then: https://htmx.org it can help you switch out elements on a page after form submit with the server respone, without having to write lots of js. (though it still needs js to function)
6 replies
TTCTheo's Typesafe Cult
Created by Ruben Silva on 9/30/2024 in #questions
Deployng Nextjs app on Windows Server 2019
yeah, actions would be a problem then. though server components would work in a static app, they just run once on build
24 replies
TTCTheo's Typesafe Cult
Created by Ruben Silva on 9/30/2024 in #questions
Deployng Nextjs app on Windows Server 2019
next.js app router can built as a static website, which you should be able to host anywhere. does mean you can't use server actions or Next's API endpoints, but it sounds like you're either not using them or prepared to rip them out anyway
24 replies
TTCTheo's Typesafe Cult
Created by Aguilar on 9/30/2024 in #questions
Introducing new library to the deps
main website getting few millions traffics which is also the main income source
why would the business want the mess with something that makes money? what benefit would an update bring? e.g. patching security vulnerabilities that could take down the server
38 replies
TTCTheo's Typesafe Cult
Created by Sid on 9/12/2024 in #questions
Single react query doesn't seem to hit then endpoint in production (Vercel)
have you checked the Network tab of the browser dev tools? should tell you if the request is actually hitting your backend
9 replies
TTCTheo's Typesafe Cult
Created by harshcut on 5/24/2024 in #questions
Scaling page with respect to viewport width
afaik there is no way to make your entire website scale according viewport size, otherthan using viewport units on each element: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Sizing_items_in_CSS#viewport_units aspect ratio might also be useful there https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio
4 replies
TTCTheo's Typesafe Cult
Created by wei on 5/23/2024 in #questions
Uploadthing multiple upload files
this is just a guess, but setting maxFileCount to Infinity might work. though I'd imagine 99999 would be more than enough
4 replies
TTCTheo's Typesafe Cult
Created by sridharK on 5/23/2024 in #questions
T3 trpc depdent query is failing ?
also renaming your hooks like event and poll to useEvent and usePoll would make it clear that they are hooks and need to be treated as such
4 replies
TTCTheo's Typesafe Cult
Created by sridharK on 5/23/2024 in #questions
T3 trpc depdent query is failing ?
without the full error message it's difficult to tell what's going on. you might be running into problems with dependent queries so the docs might be helpful: https://tanstack.com/query/latest/docs/framework/react/guides/dependent-queries
4 replies
TTCTheo's Typesafe Cult
Created by Beardeddragon on 5/21/2024 in #questions
IndexedDB sharding library feedback
also +1 for Brum image
10 replies
TTCTheo's Typesafe Cult
Created by Beardeddragon on 5/21/2024 in #questions
IndexedDB sharding library feedback
from a glance at index.ts the only part that sticks out to me is in updateItemById https://github.com/BramPostema/indexeddb-sharding/blob/1631e7dc016cb360c5f0579c2dc3edf10cba61b1/src/index.ts#L101 where you don't seem to handle case where the item is not found. is this an expected outcome? if not you could consider throwing an error or returning false to let the caller know. otherwise you should probably document it
10 replies
TTCTheo's Typesafe Cult
Created by Ali Limem on 5/19/2024 in #questions
T3 architecture
the reasoning for each part of the stack is explained on the website https://create.t3.gg
5 replies
TTCTheo's Typesafe Cult
Created by gave_one on 5/20/2024 in #questions
I'm having problems refreshing my component
I recommend using an existing library like React Query, since fetching directly has a lot of footguns that can trip you up. For adding to the cart you'd then a use a mutation, and trigger the cart to revalidate if that was successful
3 replies
TTCTheo's Typesafe Cult
Created by rob on 5/16/2024 in #questions
Running into Error: @clerk/nextjs: Missing publishableKey. when following the The Modern React Tutor
I'm out of ideas then. you might want to ask this in Clerk's own Discord server if you haven't already
14 replies
TTCTheo's Typesafe Cult
Created by rob on 5/16/2024 in #questions
Running into Error: @clerk/nextjs: Missing publishableKey. when following the The Modern React Tutor
No description
14 replies
TTCTheo's Typesafe Cult
Created by rob on 5/16/2024 in #questions
Running into Error: @clerk/nextjs: Missing publishableKey. when following the The Modern React Tutor
oops, I meant to write server component. this would only work for a server component, not a client component
14 replies
TTCTheo's Typesafe Cult
Created by rob on 5/16/2024 in #questions
Running into Error: @clerk/nextjs: Missing publishableKey. when following the The Modern React Tutor
you might need to pass it yourself to the ClerkProvider component:
...
<ClerkProvider publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}>
<body>{children}</body>
</ClerkProvider>
...
<ClerkProvider publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}>
<body>{children}</body>
</ClerkProvider>
this is assuming it's inside a client component
14 replies
TTCTheo's Typesafe Cult
Created by Mocha on 5/13/2024 in #questions
Next.js API Type Safety without tRPC?
You might want to explain the problems you're having with tRPC and what your needs are, otherwise it's difficult to recommend anything
10 replies