Vincent Udén
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Vincent Udén on 9/27/2023 in #questions
SSR with tRPC (9.x) works for one query but not the other even though they're practically identical
I've got a component where I have two querys, one is usually faster than the other but I want to run both for side effects on the server. I use them like this:
"gallery.getAllS3Thumbnails" is properly SSRed with the correct headers beting set, but the "gallery.getAllS3ThumbnailsFast" is not. They're pretty much the same on the server except that the faster query skips some fetches to other services. Does anyone have a clue what could be going on?
4 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 9/18/2023 in #questions
Implementing an anonymous "like"-function for my webpage
I'd like for my users to be able to "like" my blog posts as an extra point of feedback for me to consider while writing. This should be done without creating an account as I'd expect no one to invest that much effort into my website.
For now I've settled on using some hardware + software characteristics to create an anonymous fingerprint of a users browser in order to make a small attempt at weeding out duplicate likes.
Is there any obvious negatives to storing these fingerprints as plain text in my DB? They're not specific enough to identify a user (nowhere near) and I can't store them hashed since I have no username or the likes to search the tables with. This approach eliminates the need for cookies (which I would like to stay away from if possible) and would give me "good enough" protection against refreshing and liking again.
Something does still feel a little bad about having the fingerprints just laying around in plain text though. Am I too paranoid?
7 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 8/4/2023 in #questions
"Size" of API routes in NextJS
2 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 8/1/2023 in #questions
Vs Code highlighting newlines
5 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 7/27/2023 in #questions
VS Code Plugin showing gzipped size of imports
I've seen some people on streams (Ryan Carniato among others I'm pretty sure?) use a plugin for VS Code which shows a "commented" gzipped size of imports next to each import in VS Code.
Anyone know what it's called?
5 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 5/6/2023 in #questions
Supabase broken DNS
Hi!
I just restored an inactive project on Supabase and now I can't connect to the DB anymore. I know what the problem is. The DNS lookup from url to ip address is not working, since I can connect to the database using
psql
if I use an external ip lookup service and feed it the actual ip of the database. But if I use the url for the DB, it can't resolve the host name.
Has anyone had similar problems? Do I just need to wait for the DNS records to propagate? Or are there any better solutions?2 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 4/10/2023 in #questions
React-Transition-Group
5 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 2/1/2023 in #questions
Neat background pattern images
Has anyone got any good resources for background patterns such as the grid used on tailwinds docs?
Im mostly looking for subtle, simple, geometric patterns to use at low opacity on flat/subtle gradient background.
3 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 12/21/2022 in #questions
HookWebpackError during `next build`
2 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 12/19/2022 in #questions
SyntaxError Cannot use import statement outside a module
6 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 11/26/2022 in #questions
UnoCss
I feel like a complete idiot. Im looking to add UnoCss to a fresh ct3a repo. Should I just go fro the CLI version and add it to my build and dev scripts?
20 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 11/24/2022 in #questions
Link to page with tabs
Hi!
I've got a page in my ct3a project which has three "tabs" one can open (only one at a time).
By default when opening the page, the first tab is open. However I want to redirect a user to the page with a specific tab open. What'd be the best/standard way to do this?
Something with dynamic routing? Cookies?
15 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 10/4/2022 in #questions
Standalone CLI in t3 project
Hi! So I wrote a question a while ago about making a little script for interacting with my db through prisma (https://discordapp.com/channels/966627436387266600/1024739607553786011)
I was recommended ts-node to run the file, but that doesn't work at all. I think it has something to do with es6 imports/exports but it's really cryptic and I can't find much information about it. The error message looks like this:
And the file is simply
Has anyone else ran in to problems like this? Any help, pointers or other recommendations for how I could run a .ts file in my t3 project without running the whole web app would be greatly appreciated
20 replies
TTCTheo's Typesafe Cult
•Created by Vincent Udén on 9/28/2022 in #questions
Creating CLI for interacting with prisma database
Hi! I'm looking to write a little script in my create-t3-app which would allow me to easily add an entry to the database. I don't want this exposed in the web app, and I think it's inconvenient to just add a function call which runs once that I then, later delete.
Is there any way for me to just create a .ts file which I can run in isolation in the project? Maybe parse some command line arguments and such?
9 replies