Grimbo
Grimbo
TTCTheo's Typesafe Cult
Created by Grimbo on 11/9/2023 in #questions
React Strict Mode - Second render, different initial state ?
The component takes in a bunch of data, parses it, and returns JSX. No state required.
11 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 11/9/2023 in #questions
React Strict Mode - Second render, different initial state ?
Just defining a variable at the top of the function body that's empty.
11 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 11/9/2023 in #questions
React Strict Mode - Second render, different initial state ?
export default function WikiContent({ blocks, pagesList, pageTitle }: WikiContentProps): React.JSX {
const matchedInternalLinks = new Set<string>()
export default function WikiContent({ blocks, pagesList, pageTitle }: WikiContentProps): React.JSX {
const matchedInternalLinks = new Set<string>()
11 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 11/9/2023 in #questions
React Strict Mode - Second render, different initial state ?
No state, no useEffect, no hooks in the component itself.
11 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 11/2/2023 in #questions
Vercel postgres + Prisma migrate
my URL had -pooler in the connection url. After removing it from the URL to use Neon's non pooled url it worked.
3 replies
TTCTheo's Typesafe Cult
Created by Giuliopime on 10/20/2023 in #questions
Guide on how to make such a css effect
I have no clue how to do it with pure CSS. But if you're into using a library https://www.framer.com/motion/motionvalue should make it possible.
7 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 10/13/2023 in #questions
Headless CMS for Notion like knowledge base ?
They already have a lot of the content in Notion, so I guess they must have run into some issues.
10 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 10/13/2023 in #questions
Headless CMS for Notion like knowledge base ?
But they seem to want it… sooo…
10 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 10/13/2023 in #questions
Headless CMS for Notion like knowledge base ?
Kind of yeah 😅
10 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 10/13/2023 in #questions
Headless CMS for Notion like knowledge base ?
I’m asking myself the same question. 😅 They seem pretty determined to hire me though to get this done. They want cool dashboards with read progress, and better search, and changelogs.
10 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 10/13/2023 in #questions
Headless CMS for Notion like knowledge base ?
Appreciate the feedback! Yeah it seems like the best option right now.
A little annoyed that you need to do so many requests to endpoints in Notion. E.g to get an indented bullet list item is a new request to get the children. Some pages have a block rather than a page as parent, which is an extra separate request. But, as long as I cache/store it should still all be good. Just a litle slow to refresh all content. 😅
10 replies
TTCTheo's Typesafe Cult
Created by SharpieMaster on 9/25/2023 in #questions
t3 app router when?
App router beta
24 replies
TTCTheo's Typesafe Cult
Created by SharpieMaster on 9/25/2023 in #questions
t3 app router when?
pnpm create t3-app@7.20.3-beta.61030b4
24 replies
TTCTheo's Typesafe Cult
Created by sommeeer on 9/21/2023 in #questions
T3-stack SSG
I ended up using the createServerSideHelper for generating static pages with the pages folder. Trying to get static and tRPC to work with 13 and the appDir right now and it's messy, not recommended. : <
import { createServerSideHelpers } from '@trpc/react-query/server'

export default function Home(props: InferGetStaticPropsType<typeof getStaticProps>) {
const { data: jobs } = api.job.getAll.useQuery(undefined, { refetchOnMount: false, refetchOnWindowFocus: false })

return (<></>)
}
import { createServerSideHelpers } from '@trpc/react-query/server'

export default function Home(props: InferGetStaticPropsType<typeof getStaticProps>) {
const { data: jobs } = api.job.getAll.useQuery(undefined, { refetchOnMount: false, refetchOnWindowFocus: false })

return (<></>)
}
My getStaticProps: Might wanna make the helper resuable ofc
export const getStaticProps = async (context: GetStaticPropsContext) => {
const helpers = createServerSideHelpers({
router: appRouter,
ctx: createInnerTRPCContext({ session: null }),
transformer: superjson
})

await helpers.job.getAll.prefetch()

return {
props: {
trpcState: helpers.dehydrate(),
},
revalidate: 60 * 60 * 24 // 24 hours
}
}
export const getStaticProps = async (context: GetStaticPropsContext) => {
const helpers = createServerSideHelpers({
router: appRouter,
ctx: createInnerTRPCContext({ session: null }),
transformer: superjson
})

await helpers.job.getAll.prefetch()

return {
props: {
trpcState: helpers.dehydrate(),
},
revalidate: 60 * 60 * 24 // 24 hours
}
}
6 replies
TTCTheo's Typesafe Cult
Created by Aguilar on 7/17/2023 in #questions
Cheapest Hosting Service
Vercel uses aws under the hood. So essentially same answer as above, solves most of the setup for you.
17 replies
TTCTheo's Typesafe Cult
Created by Pranoy on 6/23/2023 in #questions
Earning tips
So, I had a clear problem, I ended up building it, and it turned out lots of other had the same issue and it got popular quite fast within my niche.
4 replies
TTCTheo's Typesafe Cult
Created by Pranoy on 6/23/2023 in #questions
Earning tips
So, many things out there to build! To get consistent traffic is tricky, and I don't think there's a "best" topic. Usually the framework I would use is to try to think about problems, not solutions. Either in your own life, or for someone you know. For, instance, I have a somewhat popular website that lists all the video game developer jobs in Sweden. And I started it because I myself had been working in the industry, was looking for a new job, and all other solutions to find game jobs in Sweden sucked.
4 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 6/22/2023 in #questions
getStaticProps & SSG helper data still being fetched on client.
Hmm...yeah it's a bit confusing. Still trying to wrap my head around the dehydation and pre-fetching flow. But, at least now when I added revalidate to GetStaticProps, I don't see any request being made to the DB in the network tab at all, and it doesn't refetch any any new data. So... seems to be working ?
10 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 6/22/2023 in #questions
getStaticProps & SSG helper data still being fetched on client.
Seems like adding Revalidate did the trick... I don't understand fully why though, as usually, if I did a good ol' normal fetch directly from the server it would be completely stale until I make a new deployment. Oh well, I was planning to add a revalidate either way ! :3
10 replies
TTCTheo's Typesafe Cult
Created by Grimbo on 6/22/2023 in #questions
getStaticProps & SSG helper data still being fetched on client.
disabling the following did not do the trick either 🤔 const { data: jobs } = api.job.getAll.useQuery(undefined, { refetchOnMount: false, refetchOnWindowFocus: false })
10 replies