📗
declarativas
  • What is Declarativas?
  • Why Declarativas?
  • Getting Started
    • Installing Declarativas in Your Application
    • Declarativas API
  • Boilerplates
    • Vanilla HTML/JS
    • With Ferp
Powered by GitBook
On this page
  • tl;dr
  • Project Goals
  • What declarativas is not

Was this helpful?

What is Declarativas?

NextWhy Declarativas?

Last updated 3 years ago

Was this helpful?

tl;dr

is a zero-dependency javascript library for declarative HTML 5 canvas context2d drawing. If you are familiar with how React renders to the DOM, aims to be that for HTML canvas applications.

Project Goals

Provide all context2d properties and draw operations from the canvas API

The has a thorough set of properties and draw functions to make it easy to just draw something on a web page. Wrapping these properties and operations in components gives users familiar with declarative web applications, like , , and .

Components should be easy to build

With a basic set of property and draw operation components, declarativas provides a set of building blocks that can be constructed together to build fantastic looking and functioning components. Components are just functions that return other components, just like in your favourite declarative front-end framework.

Make a higher-level API to avoid common pitfalls

One thing that can be hard to track down when using the canvas is the canvas state. It's easy to apply a transform, but forget to reset it for your next render, providing hours or days of canvas debugging. Using some higher level, built-in components, you can easily ensure that the state of the canvas does not bleed into your next render (unless you want it to!).

What declarativas is not

While declarativas is functional and declarative, it is not reactive. All this means is that batteries are not included for state management. While this can seem like an important feature, what this does is make it incredibly easy to integrate into your favourite front-end framework, which probably already includes state management. If you want state management without a separate framework, you could check out , a state management library that works similar to and 's state management.

Declarativas
declarativas
context2d API
Hyperapp
React
Vue
ferp
Hyperapp
Elm