Giter Site home page Giter Site logo

diff-renderer's People

Contributors

kof 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

diff-renderer's Issues

SVG Support

I'm unable to update an element with an SVG and get it to actually render. Using the Inspector, the DOM shows an svg element, but it is never rendered to screen.

Example:

Go to the playground and add a basic svg element to the "New html" input and click "Render diff".

Here is the svg I added: <svg width="400" height="180"> <rect x="50" y="20" width="150" height="150" style="fill:blue;stroke:pink;stroke-width:5;fill-opacity:0.1;stroke-opacity:0.9" /> </svg>

https://s3.amazonaws.com/zwss/DiffRenderer_playground._2020-09-02_14-58-40.png

urls in style tags break

When I update element containing style urls I get weird results, for example:

<style>
  div {
    background-image: url(http://some.image.jpg)
  }
</style>

becomes:

<style>
  div {
    background-image: url(http:</style>

Am I missing something?

Usage examples

  • basic examples
  • jquery integration example
  • famo.us integration example
  • todo app of backbone example
  • some real time impressing example

Allow nested DiffRenderer instances

Ensure every dom node has always just one virtual node so that changes are always applied just once.

  • global Nodes map
  • add node id to every Node and to dom Node
  • when creating Node instance check if already exist in global map and return it
  • when remove Node, remove it from global map

Optimize inserts

When insert a node at the beginning, it causes modifications to all downstream nodes. This needs to be optimized.

  • add hash to snapshot nodes
  • save hashes in Node instance and use in toJSON
  • reorder nodes based on hashes so that untouched nodes get into the new place and docdiff doesn't thing everything has changed.

Make createNode/removeNode using a pool

  • remove node will not really remove it, it wil just cleanup node and put it into the pool
  • create node will only create a node if there is no free node of proper type in the pool

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.