Introduction

Hype.js is a tool for getting HTML APIs deployed quickly and effeciently.

Hype.js is similar to Next.js, Nuxt.js, or SvelteKit, but for htmx and hyperscript.

FAQ

Why Hype.js?

Thanks to htmx, it is now viable to develop web apps that use hypermedia as the engine of application state.

Hype's goals are to make htmx even more useful by providing:

  • A productive developer experience for creating HTML APIs
  • An easy way to interact with JSON APIs and tranform their results into HTML
  • Easier and more effecient deployment by taking advantadge of edge technologies like CDNs

What are HTML APIs?

HTML APIs are APIs that return data formatted according to the HTML5 spec. These APIs are better suited for displaying data for humans, than being used by a machine, like JSON is. With the power of htmx, the results returned by an HTML API can be swapped into the browser view without reloading the entire page.

While HTML APIs are mainly geared towards use by humans, by annotating the HTML with microformats attributes, it can be useful for machines again.

Do I need to use htmx if I'm using Hype.js?

Not necessarily, but htmx is the only client-side technology that let's you use Hype.js to its' maximum potential.

Why does Hype.js use Node.js?

For this project, we could've used any server-side programming language since htmx is language agnostic and the architecture of Hype.js doesn't necessarily require any language specific features.

I chose Node.js because:

  • JavaScript is popular. If you do web development, you know or should know JavaScript
  • Familiar APIs that web developers use on the frontend also exist in Node.js, like the Fetch API
  • JSON is native to JavaScript
  • Access to many different libraries, especially for HTML templating, which is important in Hype.js
  • Next.js, Nuxt.js, SvelteKit, etc. use Node.js

If I had it my way I would build Hype using Haskell since I use it at my day job and I like Haskell, but nobody uses Haskell, and nobody would go through the trouble of learning Haskell just to use Hype.

I also strongly considered PHP because more than 80% of the websites we use are built on PHP, but I still feel Node.js is more approachable, especially for newer web developers.