-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live updates? #3
Comments
Yes, this project is similar. Though the goal here was to produce deltas with context. I.e. using node-delta it is possible to apply patches to a slightly modified version of the original DOM-tree. This is much like the GNU command line diff and patch tools work. You find some demos and the whole project documentation on http://znerol.github.io/node-delta/ |
So, you can do a three-way merge, i guess? Is there some real world example available? |
It would be possible to build a three-way-merge tool atop the algorithm. However node-delta only helps with conflict detection but more elaborate merging strategies are not implemented.
Regrettably no. I did not advance the project after I delivered my thesis. |
Hey,
|
One of the project goals was to write cross-platform code, node-delta runs on nodejs as well as in the browser (through browserify). For example you can build/start the test suite with
Parsing and serialization is offloaded through xmlshim to either the browsers native XML parser/serializer or to libxmljs and jsdom when running under nodejs. The browser should be capable of parsing malformed HTML, I don't know whether libxmljs will digest that though. |
Ok, thanks! I know this isn't perfect HTML handeling, but given that I work with quite controlled HTML-code, I believe I have figured out how to handle it. I copy this file into the lib directory of node-delta, and create a delta.js by runnign browserify over it. The only thing I cannot quite figure out is how to do the unpatch function. Of course, I could when creating the diff just mke sure to also make a reverse diff that could then be used to do a reverse diff, but it would mean using double the space for a diff object. I have looked through the classes and couldn't find anything to turn a diff into an undiff. So my question is: is there some built-in way of doing this?
|
I believe that What happens if you try to reverse the delta by simply constructing a new list of operations with all
|
ah, thanks! This seems to work. I have attached the entire little script I use here. Feel free to adjust and oncorporate in your program. Providing a simple file that one cna just add to a web browser may mean that it attracts more people as well.
|
Hey, I came across this library while searching for a solution for diffing and patching a DOM tree live in the browser. (something like this: http://pomax.github.io/DOM-diff/)
Since there's no description in your README i am not sure what's the intended use case for your lib, though. Could you explain?
The text was updated successfully, but these errors were encountered: