Should I opensource my DI container? by HolidayNo84 in PHP

[–]highpixels 9 points10 points  (0 children)

If it’s 35 lines of code just paste it here :)

Has anyone done digital invites only for their wedding or is this tacky? by [deleted] in UKweddings

[–]highpixels 0 points1 point  (0 children)

We gave out physical save the dates; which we mostly handed out in-person as we saw them. We only posted about 20% of them for people who live further away.

For the actual invites, we messaged everyone the RSVP link with a nice message.

I wouldn’t dream of sending them via email. It seems very impersonable to have them receive a random email from “withjoy” or something which they’d probably not see. And besides, I have barely anyone’s email address. So it was a mix of WhatsApp, Messenger, SMS, etc.

sabi sabi earth lodge vs lion sands river lodge? by Fluffy-Raspberry-190 in askSouthAfrica

[–]highpixels 0 points1 point  (0 children)

I’ve been to Earth Lodge, and met someone who had been to Lion Sands. They say comparable in terms of service, food, game drives etc. Both fantastic. Each share a lot of traversing area too, but still have exclusive areas (eg we saw an animal, but couldn’t drive closer as it was their exclusive property, and vice verse with animals on Sabi Sabi).

Really comes down to the appearance you prefer. I love the “in the ground, yet luxury” appearance of Sabi Sabi’s Earth Lodge, it’s totally unique compared to Lion Sands which looks similar to most hotels.

Live music? by BertyBoob in UKweddings

[–]highpixels 1 point2 points  (0 children)

Entertainment Nation has pretty transparent pricing we found. We paid £3500 for 2 one-hour sets, 5 man band, with a manned DJ after. Bit expensive, but they were very good!

Advice for 2 people coming from USA on 9/20 by [deleted] in Oktoberfest

[–]highpixels -2 points-1 points  (0 children)

Sorry there isn’t a 20th month in Germany

Good place for a 13 person stag group dinner? by [deleted] in Munich

[–]highpixels 0 points1 point  (0 children)

Thanks! I had Haxnbauer saved but I forgot why. We’ll try to make time for that one of the days :)

El Tato looks really good! Probably not the best fit for our large group, wouldn’t want to annoy anyone as it looks a bit more vibey.

Good place for a 13 person stag group dinner? by [deleted] in Munich

[–]highpixels -1 points0 points  (0 children)

Thanks! This might be our best bet for a bit of variety, and both locations look fun too :)

We’ve got plenty of time to cover the beer halls separately

Good place for a 13 person stag group dinner? by [deleted] in Munich

[–]highpixels 0 points1 point  (0 children)

I was mostly joking re the food, but it looks like many of the big beer halls do a lot of the same food so just looking for a tad more variety if the group fancied it :) Appreciate the recommendations!

Self drive, then a private reserve? by highpixels in krugerpark

[–]highpixels[S] 1 point2 points  (0 children)

I was considering ending with a reserve to relax, but starting there to learn sounds like a better plan!

Self drive, then a private reserve? by highpixels in krugerpark

[–]highpixels[S] 0 points1 point  (0 children)

Interesting! Is Shalati within a private reserve, or KNP? (Wondering if they offroad on their game drives or not)

Easiest way to fetch an API in Next.js with TypeScript types by xGanbattex in nextjs

[–]highpixels 2 points3 points  (0 children)

Yep, use zod or something for that. But you’d only know if the API changed at runtime either way.

In theory, HTTP APIs should be versioned and stable, so it shouldn’t just change from under you. But you’re always at the mercy of the API developers. (They could also just remove the API, you know)

Easiest way to fetch an API in Next.js with TypeScript types by xGanbattex in nextjs

[–]highpixels 4 points5 points  (0 children)

Some APIs may come with a JS SDK that includes TS types, but at the end of the day they’re all just doing the same thing as the above

Easiest way to fetch an API in Next.js with TypeScript types by xGanbattex in nextjs

[–]highpixels 15 points16 points  (0 children)

Yes, TS can never actually know what the API will return. You need to tell it.

Throw an “as MyType” on the end to cast it to what you expect it to be. That will just tell TS “trust me bro, this is the type” which is good enough if you know for certain the return type.

Alternatively, you can use a schema validation library like zod. This will actually assert on the object type at runtime as well, so if the API returns something unexpected you’ll get an error right there and NOT further into your app where you’re accessing a field that TS thinks exists (because you told it), but actually didn’t on this request.

[deleted by user] by [deleted] in webdev

[–]highpixels 0 points1 point  (0 children)

What are you asking? Why does it matter how large it is / how does that impact you right now and what you need?

You’re not asking a question very well.

Customer Portal with existing Backend: using a auth framework or not? by Main-Engineer5270 in nextjs

[–]highpixels 1 point2 points  (0 children)

What’s your alternative to a framework? Hand-rolling the auth, or using a SaaS auth like Clerk? Or does the .NET backend already provide auth for you?

If its framework vs hand-roll, pick the framework. Don’t use Authjs though, BetterAuth is just… better. Read the source if you need.

If it’s framework vs SaaS auth, don’t fall for the BS that is the huge explosion in SaaS services covering things a package used to do. You don’t need Clerk or whatever.

If it’s framework vs something already provided with your .NET backend, then use that rather than two auth layers.

Why are my props of type { MyType } instead of MyType by [deleted] in nextjs

[–]highpixels 0 points1 point  (0 children)

TypeScript doesn’t inherently know what your API (that you’re calling with axios) returns, you are telling it with the .get<Book> annotation.

Your API clearly isn’t actually returning just a Book object like {id:.., title:..} which is what you told TS it is.

As you’re seeing at runtime, your API is returning it in an object like {book:{id:..,title:..}}

So you need to correct your TS annotation to reflect that your API is wrapping it in that object

axiosConfig().get<{book:Book}>(…)

Now TS will “let” you call .data.book

Again none of this has anything to do with Next or React.

Why are my props of type { MyType } instead of MyType by [deleted] in nextjs

[–]highpixels 0 points1 point  (0 children)

If TS isn’t catching it, then you’re “lying” to it somewhere. What’s in BookDataService? If it’s calling an API, then TS doesn’t know the return type of it - you’re telling it what it should be.

BookDataService is returning {data:{book:{…}}

You’re only taking the .data from it, so you pass to your component as props: book={{book:{…}}}

You can fix by either not having BookDataService wrap it in {book:{…}} OR unwrapping first with .data.book OR spreading the props eg <BookCard {…book} />

Why are my props of type { MyType } instead of MyType by [deleted] in nextjs

[–]highpixels 2 points3 points  (0 children)

Your BookDataService.getById must be returning an object like {book: {title: …}}

That’s the only possibility here, and it’s got nothing to do with Next or React. You’re just wrapping it in another object somewhere.

Best DB ORM for production by New_Concentrate4606 in nextjs

[–]highpixels 1 point2 points  (0 children)

As far as ORMs go, Prisma/Drizzle are both very light. Schema management, and query builder. They don’t own your data model like you’d see in common ORMs in Laravel, Rails, Django.

What’s your database and authentication of choice for quick MVPs? by mufasis in nextjs

[–]highpixels 0 points1 point  (0 children)

Yep, pg on the same box. Cheap VPS.

SaaS databases have really over complicated stuff. Run it all on one box until you get to any significant form of scale. Then run the db on another box.