What is Markup?

Markup is a Reactive HTML templating System that can run in any JavaScript environment, client or server, and simplify how web views can be created. Additionally:

  • Reactive: The template reacts to data changes by performing calculations and changing only the DOM part associated with the data changed.
  • Independent: This templating system requires nothing else in order for you to build anything. It has all you need to start building and UI view quickly.
  • Fast: This library uses one of the fastest HTML parsers out there and combined with targeted reactiveness, it responds to changes only when and where needed.
  • Small: So powerful and yet so tiny. Great things come in small packages.
  • Simple: It is just JavaScript and HTML. Markup reuses the things already existing in the environment it run and with just two core APIs, learning Markup is straight forward.
  • Client + Server: You can use the same templating system on the client and server and take advantage of all the features to either render things at runtime or on the server.

Motivation

It is hard to find a templating system with all these traits. Most templating systems are reliant on the environment they are used, which limits them significantly. Also, none of them take care of DOM changes and are too simple to build full system just with them alone. Let's look at few examples:

  • Pug, EJS, and similar: These run in different environments but only server side. They are just meant to create static content while everything else is handled by the surrounding environment. They solve for the limitations of using HTML alone like conditional rendering, repetitions, and template values/variables.
  • JSX, Lit/html and similar: These templating languages are powerful, but they are not independent. They require the environment to handle the result like compiling to DOM elements and tracking changes. They just smartly convert some syntax to some API that can be then used to render DOM nodes.

But, this templating system challenges the concept that templating is just about compiling to HTML or that you need complex libraries and framework to create web applications.

All you need is a good templating system - is the motto that drives this system and one that will allow you to quickly start and be in total control of the interface.

FAQ
What can you build with it?
The short answer is - anything. We have examples that range from small "components" to complex web applications.
Should I be concerned about the bundle size?
No. This package is tiny despite its capabilities. You can use the CDN only or bundle with your application with no worries as its footprint is too small to impact your application loading time.
Has it been tested in production?
This entire documentation website uses it, and it is statically rendered. It is also been used by all @beforesemicolon websites now in production. We can help you with anything if you decide to make that move.
Is it stable
This package went through an extensive beta and alpha periods of testing by different developers both in performance and reliability. It is now in its stable stage and we would appreciate any feedback and issue reports.
Can I use it with Node, BunJs, and Deno?
Yes, it can be used in any JavaScript environment, both client and server. Tests have not been completed in all environments yet but the goal is to make it available anywhere.