[–] [S] 1 point 3 months ago

Hypermedia APIs (i.e. HTML) are specific to the layout of your application, so there is almost never any reason you’d want to insert someone else’s HTML into your page. All you have to do is make sure you only call your own routes (htmx 2 will actually disable calling other domains by default).

Although I do control the routes, its seems like it's not common. One way is a reverse proxy so the component server is forwarded on /components path on the client. So the client can still call relative routs.

  • source
  • parent
  • context
  • [–] [S] 1 point 3 months ago (2 children)

    I think I should clarify: This isn't a public library (yet). It's a system I'm creating in our company for usage within our products.

    I thought about web components and actually created a few. But this hypermedia approach with HTMX is much simpler to develop and maintain, and since some of the components are very heavy, the server side rendering takes load off of clients and makes complex renderings possible.

    Can you elaborate why do you think HTMX doesn't fit this usage? With webcomponents, the flow will be like this:

    1. Client fetch data from source
    2. Client render the data within tge component

    With this hypermedia approach the flow looks like this

    1. The client requests component with data from source from server
    2. Server fetches the data, (possibly validates it)
    3. Server renders the component
    4. Server sends component to client
  • source
  • parent
  • context
  • [–] [S] 1 point 3 months ago (1 child)

    Thank you for your explanation.

    My work revolves mostly around large enterprise software, so I guess this fits me.

    But can you elaborate why not write a game engine with it? Game engines are also very complex.
    Do you say because of the performance hit of multiple layers of abstractions?

  • source
  • parent
  • context
  • [–] [S] 1 point 3 months ago

    I'm not talking about the "clean code" approach. I'm talking about "clean architecture" for software design.

    I have also heard things about how the multiple levels of abstraction in Clean Architecture can lead to worse performance, but we can always optimize the bottlenecks and skip the abstractions if needed. I also don't have any actual benchmark of how much is the performance hit.

  • source
  • parent
  • context
  • view more: ‹ prev next ›