vitor markis π
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 2/26/2024 in #questions
Remix loaders are middlewares?
I'm learning Remix and I had this question about how it works... is the remix loaders like "middlewares"?
The browser hits the server with GET request, the server process the JSX Page and instead of returning this directly, it runs the page loader before, and "injects" the result in the HTML page.
Is that correct?
Also, are actions just a server procedure that I write in the page level and Remix binds it to the page POST submit?
2 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 10/26/2023 in #questions
How to decrease user plan usage based on service usage?
I'm dealing with a Steam farming hour system, I can start the farm via a method from client instance, like
At this point, the client starts the farming. How can I count the user service usage? Like a setInterval? Pub/sub? Observers?
If this service is in a different server than the application one? How should I do this communication?
2 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 9/8/2023 in #questions
How to create custom upload component to use with UploadThing?
UploadThing custom component is designed to be an entire section of a form. However, I'm working in a project, that involves multiple images inputs (field array), so I need a different design, something like a regular input size type of a button. Is there a way to achieve this?
If there isn't, should I consider using the existing UploadThing component hidden (absolute and opacity-0) as an intermediary between my displayed component I've created, and the server?
Or am I tripping?
5 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 6/7/2023 in #questions
How to type return of hook based on string passed as argument?
I wanna have different types based on string passed as the argument of a custom hook, but i don't know how to infer types of zod schema dynamically based on a received string. I reckon typescript helpers function might help but i don't know any.
5 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 5/17/2023 in #questions
persist user vertical scroll during navigation between pages NEXT 13 App Dir
i wanna learn how to keep the user where he was during navigation between pages like, open blog post, then go back to feed, but keeping the feed vertical scroll history
i'm using server components, the issue is the page is rendered then the javascript loads and moves the user to desired position, garbage ux
5 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 4/26/2023 in #questions
How to use Next 13/Font inside client component (App Directory)?
I'm struggling to use Jetbrains Mono by Google inside a client component in specific element only, in Next 13 App Directory, how is the right way to do it?
I'm getting this error, seems like the font class is RE-generated when it goes to client
1 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 4/10/2023 in #questions
how to absolute URLs using fetch in next 13?
This is how i wanna use the fetch:
But this way he is doing the fetch request to this weird endpoint:
http://localhost:3000/post/undefined/api/posts/bids
---
Using "relative" url solves the problem:
I assume this is a Next 13 doing, but this isn't how i'm supposed to do once i have a different baseUrl based on app environment, in case i need to use an external backend api this won't be ideal.
How can i switch back to default fetch URL behavior?
i'm using app directory, and this issue only happens on CLIENT COMPONENTS2 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 4/8/2023 in #questions
await Prisma create never resolves using PlanetScale
I'm using Next API routes as my backend, and there is the logic inside:
issue: the prisma promise never resolves
and there is no successful response in my front-end
- this issue started when i started using planetscale database in development mode
- all my get requests are being fetch successfully
- i'm using the pscale connection proxy, on port 3309
- the issue is occurring both in chrome and insomnia
here is the front-end fetch in case it comes handy
4 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 4/3/2023 in #questions
Watchpack error: EACCES: Permission denied
2 replies
TTCTheo's Typesafe Cult
β’Created by vitor markis π on 4/1/2023 in #questions
Next 13 API responses just froze after build
7 replies