Code Monkey home page Code Monkey logo

domjs's People

Contributors

medikoo 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

domjs's Issues

Add arbitrary HTML elements?

Hi, is there a way for me to add arbitrary custom elements? I like to use semantic tagging and I'd like to be able to do something like:

myCustomElement("content") --> <my-custom-element>content</my-custom-element>

Rethink idea of automatic template resolution

/cc @kamsi @mtuchowski

At this point DOM generated within templates is auto-magically gathered by domjs internals via collect method.

It was made that way to allow to write templates without need of return [...] wraps. Still this methods introduces side-effects when we work with non typical domjs element generators e.g. as _if or etc. (ones introduced by domjs-ext). They require wrapping their result with insert function, and that can be confusing to unwary developers, and leads to hard to debug issues if omitted.

We should either resign from that magic or find a solution so it works without need of using insert in any cases.

Optional opt-out of global namespace decorator

After requiring domjs like this:

const domjs = require('domjs/lib/html5')(document);

the global namespace was decorated with constructs such as div etc. I know this is the intended usage, but I'd still like to be able to use some_namespace.div, and have domjs not insert div into the global namespace. This serves two goals:

  1. The user can no longer accidentally override something with local variables.
  2. The user can quickly see what they can do by inspecting console.log(some_namespace).
  3. Feels more pure :-)

Right now I use const elem = domjs.map; for this, but it'd be cool if we had a documented / official method for such a use case.

ReferenceError: document is not defined

Hi @medikoo ,

I'm trying to run this in Node and getting:

  var domjs = require('domjs/lib/html5')(document);
                                         ^
ReferenceError: document is not defined

You say in your README that this will work on the server...how?

Thanks!

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.