You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently a method called applyChange in textarea.js. This function takes the existing text and updated text, and figures out and applies the insert and/or remove operations needed to transform the existing text into the updated text. This is useful in more than just the textarea case. I would like to see this method included in both the text and json apis as something like update(old, new).
The text was updated successfully, but these errors were encountered:
Its a hack, and I don't want to rely on it in general. The creep will look like "lets add this to JSON for strings" then "Oh, if it works for strings, we should use a diff algorithm for arrays too" "oh why not do full tree-based diff" -> "Hey, all this diffing stuff doesn't preserve intent! ShareJS doesn't work right!" or "ShareJS is so slow!"
So no, I want to inspire the sense of guilt when that dodgy diffing function is invoked. Its not necessarily a bad hack (it works great for isolated changes in small strings), but I don't want to encourage general purpose use.
There is currently a method called applyChange in textarea.js. This function takes the existing text and updated text, and figures out and applies the insert and/or remove operations needed to transform the existing text into the updated text. This is useful in more than just the textarea case. I would like to see this method included in both the text and json apis as something like
update(old, new)
.The text was updated successfully, but these errors were encountered: