gxp91
gxp91
TTCTheo's Typesafe Cult
Created by rasib on 6/29/2023 in #questions
Why does the official Twitter website look so different on mobile?
The easiest way to serve different apps to different devices is to actually configure it at the load balancer based on incoming device. Doing this in code can make your code base look super messy.
4 replies
TTCTheo's Typesafe Cult
Created by Debaucus on 6/16/2023 in #questions
With Planetscale (or others), what's the correct way to retroactively edit a prod database?
you could make the field optional then you wont have that poroblem
5 replies
TTCTheo's Typesafe Cult
Created by sofakingsic on 6/17/2023 in #questions
Bet you can't fix this CSS
if you can use javascript you can calculate the inline-size requirement by counting the characters and then assigning a pixle value, but not to exceed the total width
4 replies
TTCTheo's Typesafe Cult
Created by sofakingsic on 6/17/2023 in #questions
Bet you can't fix this CSS
change your class: .longText{ flex-grow: 2; inline-size: 100%; overflow-wrap: break-word; }
4 replies
TTCTheo's Typesafe Cult
Created by yeracode on 6/17/2023 in #questions
NEXTJS COOKIES AND CUSTOM APIS
it depends on if your server is behaving just as a proxy for the call or not but for most scenarios it should be on your server.
2 replies
TTCTheo's Typesafe Cult
Created by test_1 on 6/18/2023 in #questions
when i deploy frontend trpc fails to compile
why would you need the node modules in the server folder that makes no sense. Did you hard code your import statements with the server route?
6 replies
TTCTheo's Typesafe Cult
Created by web3moloh on 6/16/2023 in #questions
Is it possible dynamically create serverless function on vercel from code?
Be careful not to publish your api keys on github :3
13 replies
TTCTheo's Typesafe Cult
Created by web3moloh on 6/16/2023 in #questions
Is it possible dynamically create serverless function on vercel from code?
at this point your basically creating a SaaS. I would recommend looking at some other open source saas solutions to see how they do it.
13 replies
TTCTheo's Typesafe Cult
Created by web3moloh on 6/16/2023 in #questions
Is it possible dynamically create serverless function on vercel from code?
if you wanted all of that to work instead of writing the code into a file you could integrate with github and auto commit the "new code" into some sort of file structure in your app and then get another webhook to "auto deploy" your vercel app but thats ALOT more work 🙂
13 replies
TTCTheo's Typesafe Cult
Created by web3moloh on 6/16/2023 in #questions
Is it possible dynamically create serverless function on vercel from code?
here is an over simplified example of what i mean. Lets say on aa database/repo you have some code you want to remotely execute i.e GitHub Repo: testRepo File: helloWorld.js Content:
function print(msg, usr) {
return `${usr} says: ${msg}`;
}

console.log(print('testing 1234', 'gxp91');
function print(msg, usr) {
return `${usr} says: ${msg}`;
}

console.log(print('testing 1234', 'gxp91');
in your code you would have some logic that retrieves that code then to execute it you would execute it using eval i.e
const code = asyn getCode();
eval(code);
const code = asyn getCode();
eval(code);
This can get tricky because if the code is asyncronous then you will have promise race conditions ect. you could get a little fancier and wrap the external async in a promise to handle that and potentially chain it but that is one potential way of doing it (may not be the best)
13 replies
TTCTheo's Typesafe Cult
Created by web3moloh on 6/16/2023 in #questions
Is it possible dynamically create serverless function on vercel from code?
yeah so instead of writing the code to a file you cul just use the eval function to run the code
13 replies
TTCTheo's Typesafe Cult
Created by kukri_ on 6/17/2023 in #questions
Cannot deploy to Vercel with Next13.4
thanks for the insightful support @thatbarryguy i also learned some new things today
57 replies
TTCTheo's Typesafe Cult
Created by kukri_ on 6/17/2023 in #questions
Cannot deploy to Vercel with Next13.4
😄
57 replies
TTCTheo's Typesafe Cult
Created by kukri_ on 6/17/2023 in #questions
Cannot deploy to Vercel with Next13.4
yeah vercel is not liking it hmm 🙂
57 replies