cbdeveloper (@_cbdeveloper) header
cbdeveloper (@_cbdeveloper) profile picture
Joined January 2019
Photo by cbdeveloper (@_cbdeveloper)Photo by cbdeveloper (@_cbdeveloper)
Feels like this is what we should have been doing all along. Many treat refactoring and tech debt as secondary work. If you don’t tend the garden, codebase quality and eventually velocity go down. This was true long before AI agents. It just piles up faster now.
34
Replying to @expo
Hey, expo-audio feels limited today for background playback controls. Are there plans to improve lock-screen/notification transport support (remote next/previous)? What’s the official Expo-recommended approach right now for managing an audio queue while the app is in background?
65
Migration mode. My website is live somewhere else and while I don't connect my domain, I would like to avoid my production deployment from being indexed by robots. Once I connect my domain, finishing the migration, then robots are welcome. That's currently difficult to implement.
1
Is it a bad practice to call an API endpoint to increment a pageView counter from a useEffect? React Strict Mode calls is twice on dev mode, supposedly to expose bad practices on useEffect. This is done in a NextJS SSG app pages. Is is a bad practice? #ReactJS #Nextjs
Because if I'm not mistaken, this was not possible with the regular 'revalidate' directive. If the user had already navigated to link1 using a 'next/link', they would keep seeing the client-cached stale version, even though the server had already a new one.
Replying to @leerob @leeerob
Hi Lee, does on demand revalidation work with client side links from 'next/link'? I mean, if the user visits link1, then link2, then link1 gets revalidated. When they go back to link1 will they see the new version? Or will they get a client cached version from the 1st visit? Tks
1
"What will we miss?" by VSauce. youtu.be/7uiv6tKtoKg . Also a big fan of @fcain and his videos!
Replying to @csaba_kissi
Thanks! Adding to the list: Fireship youtube.com/c/Fireship
4
Replying to @TkDodo @DavidKPiano
Yeah, it makes total sense! Thanks for sharing the link for the talk as well. 😀
1
Replying to @TkDodo
Exactly! It's a good point in time to refetch. Not really a dependency. Doing it from the Tabs onChange handler is a great idea! I'll try that! Thanks a lot, Dominik 😀
1
1
This is the behaviour I'm looking for, but without having to use the `useEffect`. Maybe there is no other way here, though. useEffect(() => { queryClient.invalidateQueries( ['my-query'], { stale: true } ); }, [activeTab, queryClient]);
1
1
And if I add it to the queryKey, it will always refetch, even if it's still fresh. Because the query key will change, right? That's why I'm looking for a way to trigger a potential refetch (if stale) without adding it to the query key.
2
1
Replying to @TkDodo
yes, each tab has its own content (with a query for each). But there is a count label on each nav tab that is fetched separately (it retrieves the count label for all the tabs at once). That query stays one level above in the tree. I'd like to refetch it on every activeTab change
1
1
Replying to @TkDodo
@TkDodo hey, how are u? I was wondering if there's a way to add a value as a 'dependency' of a query without adding it to the queryKey. For ex, when activeTab changes, refetch the query (if stale). Is a useEffect with `queryClient.refetchQueries()` the way to go in this case? 😀
1
2
Replying to @jensimmons
Something like height: 100avh and avw. "available viewport height/width". Meaning "expand until reach the edge of the viewport". So I don't have to keep track of header height using: calc(100vh - 120px) for example. Any other ways of doing it with what we have today?
1
Replying to @TkDodo
That does sounds like the best approach! Thanks a lot, Dominik! 😃
1
Replying to @TkDodo
I can fire it safely from the `DrawerBody` children, which is only mounted when the Drawer is open. But I also need the data on the DrawerFooter, which is mounted when the Drawer is closed as well. That's why I need the data, but can't fire the query from there.
1
Replying to @TkDodo
Thanks! My use case is a ChakraUI drawer to display async data for some id, which is only defined when the drawer is open, but the Drawer is always mounted, even when it's closed. So if I fire useQuery it from the top level Drawer component, it will fire with id as null.
1
1