oljimenez
Explore posts from serversTTCTheo's Typesafe Cult
•Created by oljimenez on 4/5/2024 in #questions
Downsides of using AsyncLocalStorage on Server Components?
Hi guys, i just wana know if there's any downsides of using Aysnc Local Storage from Node.js in Server Components?
I've an example App that show how it will work. https://stackblitz.com/edit/stackblitz-starters-9a4rak
My use case is the following. I've an app that make many fetch call to the API to get data, the majority of those fetch calls need the page params. Currently the only way to get params in a RSC is layout.tsx or page.tsx props, and then you need to pass those values as props.
So, the question using this approach have any downsides? Is this even recommended?
2 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 3/27/2024 in #questions
React, SASS, tsup and not loading component styles
Hi guys, anyone with experience using tsup and scss?
I have a work React library codebase that use SASS for styling and tsup for bundling. But i noticed that importing a component don't load his styles, so i have to import a 'global.scss' file to make it work.
I would like that when importing a component all its styles are imported automatically.
I've been debbuging the output bundle and seems like tsup (esbuild) remove the css import from the file, so it make sense why is not working.
Anyone know how to fix this issues? Btw, i'm also migrate them to SCSS modules.
1 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 1/30/2024 in #questions
The HTML Dialog Element vs Headless Component Libraries Dialog
Hi guys, i wanna learn why Headless component libraries like Ark UI/Radix Ui/etc,etc for a Dialog component don´t use the HTML dialog element. What´s the reason? It´s not better for SEO having native and progresive enchanment dialgos/modal/drawers?
6 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 1/29/2024 in #questions
When is safe for using a CSS property?
Hi guys, i'm building a app of work with SASS and i have a use case for the new :has() CSS property. How safe is to use it? When is safe to use it? Is there any downsides of using it right now?
4 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 1/22/2024 in #questions
Simplify Next.js log error messages.
2 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 1/13/2024 in #questions
Nextjs SEO and Google Rank advice...
Hi guys, so I'm trying to learn how the Google Rank work.
I'm working on a big ecommerce site, and we're moving some pages to Nextjs because better SEO and speed with SSR and RSC.
The point it's that i hear some people saying that having good SEO it's only needed for the landing page, while i been reading others that said that all public pages, at least the most used, need to have a good SEO because that impact on your website Google Rank.
What do you guys think? Anyone work on a big projects that need SEO for organic traffic or know well this topic, that can answer me this question.
Some resources to learn about this? I'm trying to have arguments to present it to my boss.
Thanks.
35 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 12/15/2023 in #questions
Import components from outside of Nextjs app.
Hi everyone, i have a Nextjs app, but i need to import components from outside of the Nextjs folder. In the picture i show you a nextjs folder and a webpack folder where lives the components i wanna import.
Right know i configure my nextjs tsconfig and add this
in the 'paths'
"@/webpack/*": ["../webpack/assets/js/components/*"],
and this in the
'include'
"../webpack/assets/js/components/*"
Then i tried to make an import like this
import { SearchBar } from '@/webpack/search_bar';
or like this
const SearchBar = dynamic(
() => import('@/webpack/search_bar').then((component) => component.SearchBar),
{ ssr: false },
);
Nothing is working, at least with my tsconfig Typescript it stop yelling me, but it give me this error at runtime.
Module not found: Can't resolve '@/webpack/search_bar'
Anyone know how to fix this?6 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 8/17/2023 in #questions
Array<string> vs Record<key, true>?
14 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 7/21/2023 in #questions
Ecommerce dummy question: Product Cart Stock Managment?
Hi, I'm doing an ecommerce and I need to make a decision about whether add/remove a product in the cart should update the stock in the inventory of that product or not. I'm waiting some ecommerce god help me with this decision. I search in google and forums but i found both answers so i´m confused.
2 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 7/21/2023 in #questions
Ecommerce dummy question:
Hi, I'm doing an ecommerce using t3 stack and I need to make a decision about whether adding a product to the cart should reduce the stock in the inventory or not. Currently I do reduce the amount of inventory stock by adding a product and with a cron job setting a time limit for that cart. But I know that there are arguments against this so I would like to have more opinions to see.
2 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 3/31/2023 in #questions
TailwindCSS and CVA autocomplete
Hi guys, i'm using CVA with TailwindCSS for building complex state components, but a particular thing bothers me, is that there is not autocomplete of TailwindCSS clases in CVA. I'm new to Tailwind (i don't like it, but is fine to use it), so maybe some of you guys know a trick for this?
17 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 2/25/2023 in #questions
Zod File Upload Validation with Open-Api Support?
Hi guys, anyone know how to validate file upload with zod and get also open-api support?
1 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 2/25/2023 in #questions
Zod File Upload Validation with Open-Api Support?
Hi guys, anyone know how to validate file upload with zod and get also open-api support?
1 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 2/25/2023 in #questions
Zod validation and open-api support for Express.Multer.File or any File type on the server?
Hi guys, anyone know how to validate a File upload using zod? and also have open-api support?
1 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 1/28/2023 in #questions
Turborepo, Docker and multiple Nextjs Apps.
Hi guys, i need some help, i have a monorepo (turborepo) of nextjs proyects, and they have a lot of common dependencies like react, next, etc. So i'm trying to dockerize my monorepo, and trying to 1 only install common dependencies once and 2 trying to reduce the final image size of each service, i already try it nextjs standalone and fail 😦 . Anyone know how to fix this?
3 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 1/1/2023 in #questions
Chat App Input Text with emojis?
Hi guys, Happy New Year. Well, my problem is that i'm building a chat app, and i'm trying to build an input that allow the user to insert an Emoji, just like Whatsapp or any other pro chat app. Well the problem is that for doing that, you have to a div contenteditable, because i need to show the images for Apple Emoji for example, not html pure emojis. So i'm a little stuck here, because i need to have in mind the cart selection, parsing html, turing back to html, in the end is a hell. Does anyone have done anything similar? Can anyone explain me a better way to do it or give me some advice?
4 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 12/21/2022 in #questions
tRPC, Nextjs GetServerSideProps and satisfies error.
Hi guys, for some reason, when i use "satisfies" operator in a Nextjs getServerSideProps, i can't use tRPC SSGHelpers or Prisma Client. I'm getting this error, "ReferenceError: createProxySSGHelpers is not defined" and crash my app. But when i remove satisfies operator, all error are gone and my app is running again. What happen here?
Example:
export const getServerSideProps = (async (ctx) => {
const prisma = new PrismaClient();
return {
props: {},
};
}) satisfies GetServerSideProps;
this crashes in "ReferenceError: PrismaClient is not defined"
42 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 12/15/2022 in #questions
Writing Typesafe sql?
Advice for writing typesafe sql with some linter or something? I'm using supabase for a while now, and the only thing i don't like is writing sql without any type hint or autocomplete, there are some way of getting this right? vscode extensions or something?
5 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 12/13/2022 in #questions
Supabase Realtime Presence vs Pusher Presence
What do you recommend for a chat application? Supabase new realtime presence or Pusher Presence Channels?
2 replies
TTCTheo's Typesafe Cult
•Created by oljimenez on 12/7/2022 in #questions
VSCode autocomplete fix?
10 replies