Recent submissions

Comment · 28 days ago
I saw it as being "read" and rated as 3 out of 5 on my goodreads. But I didn't leave a comment there unfortunately so it took a while to work out why I rated it in such a way. Your vampire comment instantly clicked. I wanted to like it but vampires were too much.
Comment · 7 months ago
Does the author dislike react? How about preact? Or maybe simply jsx? Or nextjs?

There's nothing wrong with either of these if used correctly. Thus "hate" is a rather shallow argument.

Comment · 8 months ago
Same. MacOS. Tried it. Was okay-ish for several days. But eventually I realised it's worse than WebStorm in basically every aspect, subjectively speaking.

It is slow, it's missing features and it is buggy.

Comment · 10 months ago
Switched to Zed from Webstorm. Only issue is Zed has no vertical tab support. Did create a PR but it got rejected as it does not align with their milestones. Well, using it by monkeypatching the dev build after every upstream sync.
Comment · 1 year ago
I have tried it. And would like to reiterate – everyone should use what they like.

But for me Lit is too OOP. It feels like Angular. And that all in turn feels like Java. It's just so heavy and constrained (not saying it's a bad thing though). Too much boilerplate for me.

The whole paradigm is different and does not match my preferences. And while subjective, I do believe React with TS, Tailwind, zod, react-query and zustand is the best stack delivering the best balance of boilerplate and code-delivery and easy of use and entry level and dx.

Comment · 1 year ago
It depends on the target product.

I'm working with JS for already 25 years. Tried all of the frameworks, and continue on doing it. And every time I try something new, the refactoring flow turns most of them into NextJS (if it's very UI rich or customer facing or something very web-oriented), or Vite+React+Tailwind (client) and Hono (backend) if it's more of a tinker toy needing more custom solutions.

The boilerplate with NextJS is cleanest (compared to all the other frameworks) and API is the most straightforward one, and you can safely ignore the vendor lock in. Its just a pretext to hate on NextJS. They all have some kind of a "vendor" lock in. Be it a vendor-or-a-specific-approach-or-whatever-lock-in.

And Vite+React+Hono — simplest to set up for quick experiments, and very powerful with minimal boilerplate. Will probably create a starter for this one, as I have been using this stack quite a lot lately.

EDIT:

You can pretend vanilla JS is all you need, but then your app grows, then you suddenly need types, and state, and more events and their handlers, and SSR or something else. Thus React has been the most stable bet for quite a while for me now.

Comment · 1 year ago
Well this crashed my Safari like nothing else in quite a while!
Comment · 1 year ago
Found out you can use WASD to navigate and Space to shoot.
Comment · 1 year ago
I would've probably switched from JetBrains to Zed already. But Zed has no vertical tabs support.

I can't believe people are ok with horizontally layed out tabs.

Comment · 1 year ago

  middleware = fn(req) → next(req).
express/koa give you the use() chain. next.js gives you one root, but nothing stops you from chaining yourself. same semantics, just manual wiring.

  type mw = (req: Request, next: () => Response) => Response;
  
  const logger: mw = (req, next) => {
  console.log(req.url);
  return next();
};

  const auth: mw = (req, next) => {
    if (!req.headers.get("x-auth")) return new   Response("forbidden", { status: 403 });
    return next();
  };
  
  function chain(mws: mw[]) {
    return (req: Request) =>
      mws.reduceRight((next, mw) => () => mw(req, next), () => new Response("ok"))();
  }
  
  export function middleware(req: Request) {
    return chain([logger, auth])(req);
  }
root is given, chain is trivial. that’s middleware.
Comment · 1 year ago
Since you're here — I'll just pipe in.

Here in this article, the author, failing to comprehend the domain differences, is applying the same approach to call a function everywhere. Of course it won't work.

The fallacy of nextjs is attempting to blend function domains that are inherently different. Stop doing that and you will be fine. Documentation won't work, it will be just more confusing. Blending edge and ssr and node and client-side into one is a mess, and the attempt to achieve that only results in layers upon layers of redundant framework complexity.

Comment · 1 year ago
Consider middleware.ts as a root middleware. Nothing is stopping you from creating your own chain (which is trivial) in there. I mean, that would eventually work the same if nextjs implemented that feature — there would be a root somewhere.
Comment · 1 year ago
This is terrible and not worthy of HN front.

Terrible from the front-end side of implementation: - performs worse than your average arbitrary-amount-of-rows-that-won't-fit-on-the-screen library (it should perform the same no matter if its 1k, 1m or 1mm rows) - is seemingly buggy - is pointless on its own, because THIS demo is a client-side demo, and no one loads that much data on the client-side.

Revisit this when this demo is performant AND data is loaded from the backend.

Ignoring that, every front-end JS developer should explore these kinds of libs and also try to implement them themselves, because they're basically front-end 101.

Comment · 1 year ago
That is fine as long as your forms are simple text inputs and buttons. Now plug in drag-and-drop and multiple file uploads and selects and checkboxes and radios and more of these various inputs you're in the world of pain.

I've recently, once again, gave native inputs a chance in a new project. It lasted as long as I've described in the first sentence. And I've been in the frontend world for 20 years. Trust me, you don't want complicated native forms.

And react-hook-form is just what you need (albeit it also is boilerplate-ish, so I always end up wrapping it up in a simpler and smarter hook and component).

edit: Same, in a sense, for HTMX. It's ok for simple things. But eventually you may end up trying to build a house with a fork. The fork in itself is not a bad tool, sure. But you also don't need a concrete mixer with your morning toast.

Comment · 1 year ago
Enter this in the console:

document.body.onwheel = (e) => e.stopPropagation();

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton