Home

Awesome

The Merlin JS framework

A functional JS framework that values elegance, simplicity and minimalism.

Raj + Superfine + Tint + SPA Router = ❤️

bundlejs License: MIT

Demo

❤️ Features

💡 Showcase

Demo

<!DOCTYPE html>
<html>
  <head>
    <title>Todo - The Merlin JS framework</title>
  </head>
  <body>
    <main>
      <h1>To do list</h1>
      <input type="text" value:="value" oninput:="NewValue">
      <ul>
        <li each:="todos" text:></li>
      </ul>
      <button onclick:="AddTodo">New!</button>
    </main>
    <script type="module">
      import {app} from "https://cdn.jsdelivr.net/gh/marcodpt/merlin/index.min.js"

      app({
        node: document.body.querySelector('main'),
        init: [{
          value: "",
          todos: []
        }],
        update: (todo, state) => {
          if (todo != null) {
            state.value = todo
          } else if (state.value) {
            state.todos.push(state.value)
            state.value = ""
          }
        
          return [state]
        },
        view: (state, dispatch) => ({
          ...state,
          AddTodo: () => dispatch(),
          NewValue: ev => dispatch(ev.target.value)
        })
      })
    </script>
  </body>
</html>

💯 Examples

📖 API

Merlin uses Raj as its state management library, you should read the docs for a complete reference.

Merlin uses Tint as its template engine, you should read the docs for a complete reference.

app({node, template?, view?, init, update, done?}) => stop

spa({node, routes, plugins?}) => stop

routeData {url, route, path, Params, query, Query, old, ...newData}

🤝 Contributing

It's a very simple project. Any contribution, any feedback is greatly appreciated.

⭐ Support

If this project was useful to you, consider giving it a star on github, it's a way to increase evidence and attract more contributors.

🙏 Acknowledgment

This work is hugely influenced by these amazing projects:

A huge thank you to all the people who contributed to these projects.