The hypermedia approach simplifies API versioning by including all actions and state transitions in the server response, reducing the need for API versioning and allowing for more back-end work in languages like Java.
The hypermedia approach offers a self-describing and flexible model that aligns with the original vision of the web, eliminating the need for excessive JavaScript in the front-end and enabling more work to be done in the preferred back-end language.
Combining hypermedia with custom elements enhances the advantages of the hypermedia approach, providing better authorization control and integration with modern development techniques such as web components, while reducing the need for custom front-end code.
Deep dives
HMX as a Hypermedia Approach
HMX aims to improve HTML as a hypermedia by exchanging hypermedia with a server instead of data. This approach allows for flexibility, as the response includes all the links and actions needed, reducing the need for API versioning. HMX simplifies client code and allows for more work in the back-end stack, such as using Java for templating.
Advantages of the Hypermedia Approach
The hypermedia approach offers several advantages, including simplified API versioning, as all actions and state transitions are encoded in the response. It allows for more work to be done in the preferred back-end language, such as Java, eliminating the need for a significant amount of JavaScript in the front-end. Additionally, it provides a flexible and self-describing model which aligns with the original vision of the web.
Comparing Hypermedia and Data API Approaches
The hypermedia approach focuses on exchanging hypermedia with a server, while the data API approach involves exchanging data with a server and updating a client-side model. The hypermedia approach is more closely aligned with the original web hypermedia model and reduces the need for custom front-end code. On the other hand, the data API approach offers more interactivity and is often utilized in more complex applications.
Combining Hypermedia and Custom Elements
By combining hypermedia with custom elements, developers can enhance the advantages of the hypermedia approach. The use of custom elements allows for better authorization control by rendering or hiding specific links based on user roles. Additionally, the approach aligns with the current trend of service-side rendering and offers the flexibility to integrate with other modern development techniques such as JS PC and web components.
Benefits of HTMX for Hypermedia Applications
HTMX is a framework that aims to improve the functionality of hypermedia applications. It allows for faster and simpler development by serving JSON and rendering it on the client side. The use of HTMX can result in significant performance improvements, as it consumes less memory and starts up faster compared to traditional application servers like Spring. HTMX is gaining popularity among major companies, as it provides a cost-effective solution for building hypermedia applications. Its simplicity and compatibility with web components make it an attractive option for developers seeking to enhance the web experience.
HTMX and Security in Hypermedia Applications
One of the advantages of using HTMX in hypermedia applications is simplified security. Unlike other approaches like GraphQL, HTMX allows developers to have full access to the server-side logic and generate hypermedia markup in a trusted computing environment. This eliminates the security concerns of exposing too much expressive power to front-end developers and potential unauthorized users. By leveraging HTMX attributes and server-side generation, developers can create dynamic and secure user interfaces without the need for extensive client-side JavaScript. However, the lack of tight integration with specific back-end frameworks requires some additional effort in adapting HTMX to different tech stacks.
Apple IIgs and HyperTalk,
_hyperscript,
starting with VBA then using Java,
EJB 1.0 and J2EE,
gosu, gscript,
implementing Ruby on Rails,
teaching at The Montana State University,
Java got lots os stuff right,
javalin and jobrunr,
Java and Ruby on Rails,
NodeJS became more appealing to Ruby on Rails developers,
Yukihiro Matsumoto created Ruby,
performance challenge with sorting rows in a table,
JQuery get function,
the intercooler.js library,
intercooler is the competitor of turbolinks,
WebComponents and CustomElements,
BCE and the bce.design template,
BCE follows the data API approach,
htmx works with data attributes,
the popularity of Angular,
GWT was popular,
htmx renders HTML directly,
htmx follows HATEOAS,
HATEAOS is stateless - the response already contains all possible actions,
Roy Fielding coined the term REST,
web was designed for coarse grained interactions,
with hypermedia approach messages are self-descriptive - API versioning is easier to maintain,
htmx encourages use of Java,
JSPs with WebComponents (link to youtube ),
the Quarkus Renarde web framework,
implementation of authorization and authentication with htmx,
GraphQL gives developers and users a lot of power - which can be a security issue,
GraphQL requires the implementation of resolves,
how to version a data API,
Stefan Tilkov and resource oriented architectures ROAs,
endless scrolling with htmx is easy to implement,
htmx on discord