Werdox
Werdox
Explore posts from servers
HHono
Created by Werdox on 1/26/2025 in #help
HonoX change entry file
In the new HonoX, how can I change the entry file from app/server.ts to src/server.ts? there is an entry option in the honox vite plugin but that doesn't work
3 replies
PPrisma
Created by Werdox on 1/5/2025 in #help-and-questions
Prisma Optimize - small feedback
I've been using the Prisma Optimize on a paid starter. Currently I have no idea how many recommendations I have left + I don't even know the limit because the website states $5 for 100 but the payment page says 5$ for 6+ recommendation There are also many repeated recommendations that I basically got scammed on. Why should I eat a recommendation cost for the exact same recommendation just on a separate recording? (I don't mean the type of recommendation, I mean the actual table and column it is referencing) Also, recommendations seems to just not show sometimes after hitting "Stop recording". Seems a bit random for when they show up. I really like the idea of Prisma Optimize. It's the only thing I was willing to pay for to boost my hobby projects. That's why I wanted to give my very honest feedback on it
5 replies
PPrisma
Created by Werdox on 12/18/2024 in #help-and-questions
How to query for is:{null} OR {something: true}
When I want to update a record in a table, for the where I need to query for a related object and I need to say if the related object does not exist (is null) or a property on the related object is something psudo code
prisma.channel.update({where: {lastMessage: { OR: [ {is: null}, {someproperty: true} ] } }, data: {...}})
prisma.channel.update({where: {lastMessage: { OR: [ {is: null}, {someproperty: true} ] } }, data: {...}})
but the OR does not allow me to put is in it...
6 replies
DDeno
Created by Werdox on 10/16/2024 in #help
deno and @types/react
In the docs it states that in order to use node packages that don't ship with type but have a @types/... declaration, I have to use the // @deno-types="@types/..." directive. this is fine except when react doesn't ship with types and I have to now include this directive in many many files and it also does not auto complete the import so I manually have to type the import in new files. I guess I could use esm.sh for this case but I don't know if it's a good idea to have npm:package, https://esm.sh/..., jsr:package mixed in the deno.json imports. TLDR: - react does not have types so @deno-types="..." is tedious in every file - Should I use esm.sh for this package instead or it's a bad idea?
2 replies
PPrisma
Created by Werdox on 6/19/2024 in #help-and-questions
omit with condition
I want to only omit certain fields if a condition in the same thing I'm querying is true example:
const channels = await prisma.channel.findMany({
where: { ownerId: userId },
omit: { name: /* Only omit 'name' if the channel type is 1 */ },
});
const channels = await prisma.channel.findMany({
where: { ownerId: userId },
omit: { name: /* Only omit 'name' if the channel type is 1 */ },
});
11 replies
NNuxt
Created by Werdox on 4/18/2024 in #❓・help
Image Prerendering with Static build.
I'm using ipx and resizing my images but using nuxt generate does not prerender ipx images in the output folder and just copies the original images. I remember fixing this once but I don't remember how
1 replies
NNuxt
Created by Werdox on 3/30/2024 in #❓・help
load images from directory
How can I load all images from a directory in /public? I have a collage kind of page and want to load a ton of images but I don't want to manually type their name
1 replies
NNuxt
Created by Werdox on 3/30/2024 in #❓・help
Nuxt Image with ssr false
Im creating a portfolio website and it has a lot of small images inside. Im using NuxtImg component to set a size and quality for each image. Now local works perfectly fine but when I generate a static version, it uses does not optimize my images and just uses the original ones. I do have ssr: false in my config and image optimization does work when it's enabled.
4 replies
NNuxt
Created by Werdox on 3/17/2024 in #❓・help
page layout remounts when changing to a route using the same layout
I know this may be the intended behaviour but I'm creating a chat app and the layout has a list of user channels and it's not practical to fetch the whole list on every route change
2 replies
NNuxt
Created by Werdox on 2/17/2024 in #❓・help
Layout transition with javascript hook not working
I wanted to animate between layouts using anime.js. But it seems that the layout transition javascript hook doesn't even care about when the done() function is called and just immediately changes the layout. here is my code:
definePageMeta({
layout: "main",
layoutTransition: {
mode: "in-out",
onEnter(el, done) {
new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, 5000);
}).then(() => done());
},
},
});
definePageMeta({
layout: "main",
layoutTransition: {
mode: "in-out",
onEnter(el, done) {
new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, 5000);
}).then(() => done());
},
},
});
here I'm just creating a promise that when done, with call the done function. i tried to await it; tried using just setTimeout; nothing worked!
1 replies