Hacker News new | ask | show | jobs
by sandreas 718 days ago
Try hono.js ;)

https://hono.dev/

2 comments

Cool, let’s bet on another framework which nobody knows where it will be next year, or if it will still exist at all.

At some point people will realize there’s some value on full stack batteries included frameworks that have been around for a long time.

What do you recommend?
inertia.js is his choice (see his comments). Not bad actually.

As I already said: My comment was not meant totally serious, I also hate this framework hopping... although hono.js is promising.

Yet another JS framework, and it looks great. I've only skimmed the doc, but I already like its simplicity.

But I have a mixed opinion on the big Context object. It may help to write less verbose code, but it can also cause OOP's antipattern God Object[1], even though the context is more of a namespace rather than a big object.

  // Not
  app.get('/hello', (c) => { return c.json({ greet: `Hello ${c.req.params('id')}`)
  // But
  import { jsonResponse } from 'library'
  app.get('/hello', (req) => { return jsonResponse({ greet: `Hello ${req.params('id')}`)
[1] https://www.wikiwand.com/en/God_object

Fix: format

Hono is great, the context object is really just a collection of helper methods for returning responses, a way to store values through the lifetime of the request, and the Req and Res objects. I understand the concern but I wouldn't let that stop you from trying it out.
I was not totally serious about it. My hunt for the next best framework is over... I tend to use vanilla JS for my pet projects and for more serious stuff I use whatever I find interesting or what the project uses :-)
So instead of using battle proven frameworks (such as Laravel, rails, Django, etc) you just invent your own?

Doesn’t sound like a great idea to me.

It depends. If its something like my personal todo list pure-todo [1], I tend to write it down in less than a week without using any frameworks and hardly ever touch it again.

If it's something like m4b-tool[2] or tone [3], that has to be maintained for a while, I tend to use battle proven libraries or frameworks (in this case Symfony, because it is an older project and Spectre.Console and atldotnet for tone). I prefer libraries over frameworks though, less background magic.

However, I have the feeling that you also find something in this comment that you don't like - maybe the shameless advertisement of my FOSS projects ;-)

1: https://github.com/sandreas/pure-todo

2: https://github.com/sandreas/m4b-tool

3: https://github.com/sandreas/tone