Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

[t3-turbo]: Redirect does not work in app

I am using t3-turbo stack and not able to automate close the signIn window after succesfull sign in, when I close it by hand the sign in session did not get passed.

anyone else want to learn?

I am a 23-year-old male looking to enter the tech industry. Currently, I work in a factory sanding steel doors all day. Where I work right now is more of a job than a career. I’m looking at getting into the tech industry. Ideally, I would find a group of individuals who would like to learn about tech as well. Starting from zero is going to be a challenge, but I am ambitious enough to make it happen. If anyone would like to join me on my journey, feel free. For those who already have careers in t...

Using hardcoded data for comparison in unit tests with toEqual?

Hi there, I have a React app and I want to create a unit test for a function that removes scattered zeros inside of an array. Basically my idea is to have a src\mocks\data\IndexadorDataMock.ts file with hardcoded dirty data, and then the (also hardcoded) clean data - aka the expected output. For example: ```js // src__mocks__\data\IndexadorDataMock.ts export const itemsMockData = [ 0,...

What is a tool that can help me update packages to latest?

No, not npm-check-updates. Something that starts with "r" I think. I overheard it and couldn't ask for clarification and now it doesn't let me rest. I tried to google, tried to search on npm, github, but couldn't find it.

shadcn dialog and form

guys has anyone here tried to build a dialog with a form inside it ? if so what are the thoughts on it and how did it work. im having issues with the submit button and clicking it. im getting this error Error: React.Children.only expected to receive a single React element child....

How would you make a package that serves a web page across multiple frameworks AND nodejs?

Just starting a project and was wondering the best way to do this sort of thing, would I export jsx components and the main thing separately or?

Good react time picker

Do you have any recommendations for a GOOD react time picker - Works well on mobile and desktop - Fast to use (the UX is fast and without unnecessary modals, popups...) - Customizable enough to do things like "only in 5 minute intervals... ...

How to handle Nextjs with external REST API

How do you guys handle using Next.js with external REST APIs? Is it okay to wrap all fetch calls within actions (in order to use revalidateTag)? How to handle jwt auth in that scenario?

How do you achieve this with T3 stack SEO

I already create sitemap, title, description & OG stuff. but my site have not yet shown this way. Its just showing the site in one line.
No description

is it wrong to call myself a software engineer if i didn't go to college

I saw some hot takes on how bad it was to call yourself a "software engineer" when you're just a "developer" (it was a long time ago, so I don't remember the entire argument, but now I have that idea in my head). are there differences between a developer and an engineer?...

Expo with Native Modules

For my expo application, I need to use a react native package to connect to a printer. The printer only has serial port or usb options so I can’t use expo print. I do not want to eject from expo. Every time I use native modules I run into build issues with gradle. Does anybody have any advice on how I can best approach this? Should I try expo dev client?

What's the best way to pass up to the frontend that my database in currently inaccessible?

t3 + trpc + primsa + Next14 + server components combo. I'm just trying to make my backend a little more robust. Assuming I've turned off my database in order to simulate issues. Currently I get a standard error. I'd like to pass this back you to the frontend as a more friendly "There was a problem with the Database. Please try again later" type message. src\trpc\server.ts catches the error just fine at.......
Solution:
if(!healthy){ // do something }...

Best Frontend Testing System?

For my NextJS app what is the BEST software out there for a small freelance team to create tests for our clients projects so as we develop we ensure each input, form, page, drawer, etc have the info and function as they need. Bonus if it connects to github to pass / fail pull requests based on those tests. Also we will be using Vercel for hosting on most if not all platforms if that info is helpful....

NPM library best practices?

I was creating my own NPM library, @menglinmaker/soundfont3 but there are so many technical decisions: - So many bundlers to choose from: esbuild, webpack, rollup, snowpack, tsup... - Do I bundle to 1 file? Tree-shake? - So many testing frameworks too: jest, vitest......

Where's the best place to get the hash of a file?

When users upload files to my app, I want to generate the md5 hash - where's the best place to hook into the uploadthing flow to do this?
Solution:
```ts .onUploadComplete(async ({ metadata, file }) => { console.log("file url", file.url); const buffer = await fetch(file.url).then((f) => f.arrayBuffer());...

How to implement a "local first" Mobile app storage

I'm trying to learn more about React Native and wanted to create a small habit tracking app. While the details are not that important for this question, one thing that I want to ensure is a local experience even when internet is not available, however all data should be saved in a DB as well. Also, you can have Habits for multiple people, meaning 2 people can edit the same habit while being on/offline. Basically, I would need a way to sync the phone's local storage with my DB. However, while thinking about it I found some gotchas that I don't have a happy solution for. 1. First of all, how does it work. E.g. when the user adds a habit, is it firstly saved locally then synced. Is it saved to the DB and locally at the same time if there is a internet connection? Or something else entirely?...

Drizzle where query problems

I am using drizzle. In my below aPI I cant get my where request to correctly get me my restricted products. When i call the API, it says no restrictions found for product id 63905 which is wrong as I have the below row that DOES have that ID???? db obj example sent in next msg ```ts...

Where can I find the full stream videos?

I used to see a playlist on the YouTube channel for the full steam, but I cannot find them anymore. Is the full video still available anywhere (want to download on YouTube for a long trip I'm going to be taking soon)?

UploadThing + CDN

Hi all, I've tried searching but haven't been able to find a clear cut answer - Has anybody used other CDNs with UploadThing? I've seen some discussions about UT using cloudflare, so does that mean I don't need to set up my own CDN if I'm using UT?...

SSR + Personalization?

Hey folks, has anyone had experience using something like Adobe Target for personalizing SSR components? If i'm understanding correctly, in SSR, all the HTML elements have to be rendered on the server before it reaches the client. What if the personalized server-side component has a dependency on a client-side rendered component? how would that usually work out?...