Coder Social home page Coder Social logo

mike96angelo / bars Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 4.0 1.25 MB

Bars is a lightweight high performance HTML aware templating engine. Bars emits DOM rather than DOM-strings, this means the DOM state is preserved even if data updates happen.

License: MIT License

HTML 0.06% JavaScript 99.94%
app dom-state dom-strings html onepage template-engine template-language view

bars's People

Contributors

dallasread avatar mike96angelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bars's Issues

Views the way of the future

Syntax:

{{?><View>}}

example

class MyView extends View {
  name: string = 'myview'
  template: 'MyView: <input value::{{value}} oninput::{{oninput}}>'
  _value: string
  
  get value() { return this._vaule }
  set value(newValue) { this._vaule = newValue; this.render(); }

  @selfBoundEventSource
  oninput(evt) {
    let input = evt.target

    this.value = input.value;
  }
}

let myView = new MyView()
{{?>myView}}

Looping over a simple object throws an err

https://jsfiddle.net/k86fsjah/

With a simple object: { a: new Date() }, I get this error locally:

Uncaught Error: Unexpected virtual child passed to h().
Expected a VNode / Vthunk / VWidget / string but:
got:
"2017-02-03T01:56:36.792Z".
The parent vnode is:
{
    "tagName": "P",
    "properties": {
        "attributes": {}
    }
}

Using { a: 'a string' }, I get:

Uncaught TypeError: Expected 'object' but instead found 'string'
    at Object.assertTypeError
    at new Context
    at Context.newContext
...

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.