Hacker Newsnew | past | comments | ask | show | jobs | submit | superjose's commentslogin

Same thoughts exactly.

Datastar has been garnering my attention https://data-star.dev/


My company makes a few products - one of them is just forms, lists, and links. When the codebase was really small we tried using htmx, then alpine ajax, then datastar. We stuck with datastar and I really enjoy it for projects that don't have a highly complex client state. Overall it's a really simple build and deploy process. I find it easier to secure and to reason about. Additional bonus: I'm able to lint the whole thing with biome since it's just typescript and jsx templates.


My read is htmx is now evolving towards datastar. It tells me datastar will become irrelevant soon as htmx eats its babies.


I can see this.

I learned from a friend to use Zod to check for process.env. I refined it a bit and got:

```

const EnvSchema = z.object({

  NODE_ENV: z.enum(['development', 'production', 'staging']),

  DATABASE_URL: z.string(),

  POSTHOG_KEY: z.string(),
});

export type AlertDownEnv = z.infer<typeof EnvSchema>;

export function getEnvironments(env: Record<string, string>): AlertDownEnv { return EnvSchema.parse(env); }

```

Then you can:

```

const env = getEnvironments(process.env);

```

`env` will be fully typed!

Definitely, I need to do some improvements in my frontend logic!


I'm not familiar with Zod, but one thing that is quite important on the user end is to produce multiple (but, per policy, not infinite) error messages before giving up. That is, list all environment variables that need to be set, not just whichever one the code happens to be first.

This could be implemented with `??`, something like: `process.env.NODE_ENV ?? deferred_error(/temporary fallback/'', 'NODE_ENV not set')`, but is probably best done via a dedicated wrapper.


Yes use zod or equivalent.

I am quite surprised people here doesn't know how to validate data in runtime. The author completely mixing Typescript with runtime behavior.

a?.b?.c?.() or var ?? something have well documented use cases and it's not what the author is thinking.


Just went and bought it!

I'm in a process where application-level programming isn't cutting it anymore (I still have a lot to learn, but it's in the diminishing returns).

I've been looking to understand the entire stack at a deeper level (from how requests are made to how they're parsed), and this seems like the next natural step!

Thanks a bunch!


Awesome! You're exactly the kind of person we were thinking of when we wrote the book…experienced programmers who are interested in understanding things at a lower level.

Let us know how it goes! You can find us in the book Discord, or email us at hello@wasmgroundup.com.


You might also want to look at this thread - https://news.ycombinator.com/item?id=45862591


Love Vivaldi! It has improved significantly over the years! I use it in tandem with Firefox.

I love to have thumbnail tabs!


I think they need to respond to all the funds they've raised and need to generate money somehow beyond subscriptions.



I don't think I could survive on MacOS without AltTab.


It has some weird behavior when it comes to reverse order, when you cmd+tab+shift then the shift key is suddenly the deciding button, not tab.

End up with the focus just speeding off to the left without really intending to, since it ignores tab and now focuses on shift.



Those talk about a mechanism to detect prompt injection. If that had been true, we should have seen the chatbot refuse, not lie.


I've been dabbling a bit with configuring Nginx, and there's a lot of configuration scattered across the web without proper explanations.

Here, Derek DeJonghe, provides production-ready Nginx configurations with explanations for the most common cases.


Wow, kudos to the Author. Very easy to digest, beautifully crafted, and took the time to explain the concepts when most places take them for granted.


Well, kudos to your one-line comment too because now I am encouraged to actually read this.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: