Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 2.33 KB

0. index.md

File metadata and controls

50 lines (36 loc) · 2.33 KB

Introduction

This documentation is about crs-binding.
crs-binding is a binding engine developed as a zero dependency standalone library in a world of custom web components. Vanilla web components is a big part of the web today but the one thing that holds it back is the lack of binding.

Binding engines

There may be a lot of frameworks out there and each has it's own interpretation of binding. There are also some older well established binding engines out there that use handlebar syntax. crs-binding does not try and compete with these but instead provide features as required by it's developer.

Q: What is a binding engine?
A: There are two parts to web development.

  1. View - HTML / CSS representation of the interface.
  2. Model / data - JavaScript behind the view managing data and features.

One of the biggest problems you have with web development is getting your data on the screen at the required place and then getting changes back. Binding engines serve to reduce this effort. This is a very simplistic view on what binding engines do.

Documentation

The documentation found here will include subjects like:

  1. Working with observed models, events and expressions.
  2. Binding expressions
  3. Utility functions
  4. Bindable element for custom web components
  5. View base acting as the view part of MVVM

Getting started

The first thing you need to do is to install crs-binding using nodejs.

npm install crs-binding

Once installed you need to link it in your index.html page.

<script src="./node_modules/crs-binding/crs-binding.js" type="module"></script>

Once you have done these two steps, crs binding is ready to use as a global object. Examples of this will be more apparent in the rest of the documentation.

Aims

crs-binding tries to be a very lightweight and performant yet flexible and powerful for rapid development of vanilla web and web components. On compressed servers the payload size is around 5.5k making it very fast to download and it takes up a neglectable amount of memory.

Currently crs-binding is used on my own small website and also a enterprise scale web application.

Starter Kit

If you want to get a quick start on your application you may consider using my spa application template.
https://github.com/caperaven/crs-spa-starter
This template is already set up with a router and the binding engine.