News for hackers. Stuff that matters.
Re:Show HN: Replay your typing in a few lines of JavaScript by Einenlum on Friday March 01, 2024 @06:53PM (#39568291)
Thanks, this is an interesting point. Storing the full message indeed has a downside in terms of storage (but for a short text it should be unnoticeable). I guess it also brings something positive: you can select the whole text, delete it, and start again, and the whole action should be stored. Making a diff to represent this is way more complicated.

I'll still think about this though. I think I could find a way to reduce the data size for most use cases.

Re:Show HN: Replay your typing in a few lines of JavaScript by a-r-t on Friday March 01, 2024 @07:50PM (#39568739)
You can introduce multiple types of changes, for example: addition at the end, removal of N characters from the end, and complete string replacement, etc. Then for each change you can calculate which type is more efficient to store.
Re:Show HN: Replay your typing in a few lines of JavaScript by Einenlum on Friday March 01, 2024 @08:06PM (#39568832)
Yes, already working on it! Thanks!