Giter Club home page Giter Club logo

html-to-vdom's People

Contributors

delapouite avatar jesseditson avatar jsyang avatar khirayama avatar mattferrin avatar themindfuldev avatar timbeyer 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

html-to-vdom's Issues

Sync method

This is great but I could really use a sync version. Any plans to do so or should I create a separate project?

html strings with multiple tags

Hey @TimBeyer. Thanks for your work on this awesome library - excited to give it a shot while experimenting converting our Backbone/Marionette app to use vdom / FRP under the hood. My goal is to still use our current templates (jade->html) that we import into our views using a text module importer, and then parse them into vtrees using your library, before turning them into a vtree stream (see https://github.com/staltz/cycle)

My first roadblock has come here: return htmlparserToVdom.convertTag(tags[0]); as our templates all contain more then one tag. I'm hoping to avoid adding boiler plate to all our views to wrap template code in an extra div to ensure only one root tag is returned from the parser, and I'm curious if you given any thought to that problem?

Thanks again!

Inconsistent attribute handling

virtual-dom attribute names differ from basic HTML in two cases:

  • for -> htmlFor
  • class -> className

html-to-vdom does not behave consistent about the subj.
It automatically renames for to htmlFor but does not rename class to className.

import VNode from "virtual-dom/vnode/vnode";
import VText from "virtual-dom/vnode/vtext";
import HtmlToVdom from "html-to-vdom";

let convertHTML = HtmlToVdom({
  VNode: VNode,
  VText: VText
});

let html = `<p for="email" class="xxx">test</p>`;

convertHTML(html);

// actual result
VirtualNode {
  properties: { attributes: { class: 'xxx' }, htmlFor: 'email' },
  ...
}

// expected result
VirtualNode {
  properties: { attributes: { className: 'xxx' }, htmlFor: 'email' },
  ...
}

Question about attribute support

Hi @TimBeyer ,

Does this support attributes well? I was using dom-virtualize and looking for comments on attribute support when I saw your comment: Matt-Esch/virtual-dom#88

when I was using dom-virtualize in combination of virtual-dom, all of my attributes were stripped out and it was a disaster.

Using the library in browser?

I was wondering if this library can be/meant to be used in browser? I was looking for something like dist/mercury.js file that comes in mercury distribution that can be included in an HTML as script tag. But I couldn't find anything in the release distribution. I tried to create a bundle using browserify and index.js at the root of the project but it creates a huge 537KB file. How can I use it in an HTML?

problem with camelCase tag transform - input autocomplete="off"

html: <input type="text" autocomplete="off">;
vtree property after html-to-vdom:

{
  "attributes": {},
  "type": "text",
  "autoComplete": "off"
}

node after <input type="text">
vtree property after virtual-dom.h:

{
  "autocomplete": true,
  "type": "text",
}

node after <input type="text" autocomplete="off">

create virtual dom on elements already in the DOM and update them dynamicly

Hi I´ve been playing around with turbo-react that is a plain old static HTML page that uses turbolinks and react.js to update its DOM through reacts virtual dom. It converts the html to jsx and then renders the new data to the current body tag.

Is it possible to do something similar with virtual-dom and html-to-vdom? As I find it the element has to be added to the DOM first after they has been created with createElement and later append / replaced. I can´t just initialize a current element in the DOM with a virtual-dom? Or am I wrong?

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.