Giter VIP home page Giter VIP logo

domo's People

Contributors

clog avatar jed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

domo's Issues

use createDocumentFragment

Creating the DOM tree with createDocumentFragment() and later add it to the actual DOM will bypass expensive Layout operations for each DOM method (Layouting is done only once during inserting the fragment into the actual DOM). This will speed up things a lot.

Plus, sometimes I want to prepare a DOM fragment and only add it later to the DOM tree. This is only possible with the aforementioned method.

IE appendChild

Errors in IE 8, appendChild not supported for IE element DispHTMLStyleElement.
Occurs when building style elements.

add html implementation

i'd like to have HTML generation and DOM generation in the same library, to enable use on both server and client, and to allow client rendering to take place using innerHTML where faster.

but.

i am unsure how to implement it. seems to me there are two choices:

  1. have two parallel DOM builders DSLs, one that generates HTML and one that generates a DOM, like this:
domo.dom.<nodeName>
domo.html.<nodeName>
  1. have one DOM builder DSL that creates lightweight mock DOM objects, with the following methods:
Node.prototype.toDOM = function(document) {}
Node.prototype.toHTML = function() {}

the first is probably more efficient because there is no intermediate object generation, and easier to use because there is less API surface area and DOM objects are returned directly.

the second is probably cleaner, since no code needs to be duplicated for each approach, and creation of intermediate objects would allow more methods to be introduced if/when needed.

Add support for events

/*
  Event bindings are defined as mappings of event names to simple
  objects which consist of the event callback, the context to bind
  'this' to for the event and perhaps additional arguments relative to
  the event that should be passed to the handler.

  The callback signature would be function (eventName, element, eventArgs)

  Maybe a mixin could be created that utilizes one of the many event
  micro libraries on microjs.com could be used to make this an
  optional extension, modular and also relieve the library of having
  to worry about cross browser event support.

  My reasoning is that since dom-o is creating the elements, it could
  easily attach events as it is creating the elements as opposed to
  doing some kind of CSS selector based lookup after the fact in order
  to find the element again to attach the event that way. It also
  helps keep the beauty of the DSL in tact by not requiring elements
  that need events attached to them to be instantiated separately and
  then composed into a broader dom-o statement.
*/

FORM({action: "post_here.py", method: "POST"},
  LABEL({for: "name"}, "E-mail:"),
  INPUT({id: "name", name: "name", type: "text"}, 
    EVENTS({"keyup", {context: this, validateName}})),
  INPUT({type: "button"},
    EVENTS({"click": {context: this, function() { if (validateForm()) submitForm();}}}))
);

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.