Live data from Hacker News

Show HN: Nash, I made a standalone note with single HTML file

keepworking.github.io

121–130 of 153 posts

Re: Show HN: Nash, I made a standalone note with single HTML file

#123
post #59

Much of the heavy lifting is done by this simple but powerful attribute, something surprisingly few developers seem to know about. It's been around for quite a while.

This one line was like 90% of the original implementation of Writely (the startup that became Google Docs; source: I was one of the founders). The other 90% was all the backend code we had to write to properly synchronize edits across different browsers, each with their own bizarre suite of bugs in their contenteditable implementations :-)

This is a truly a great insight from how simple things can create industry giants like google docs.

I believe that a lot of problems can be converted into synchronization problems in browsers.

Are there any general synchronization libraries / applications that you suggest within browser / outside browser?

Thanks in advance.

Re: Show HN: Nash, I made a standalone note with single HTML file

#124
post #51

I like it a lot, and I see from the source you're coding in vanilla js, which is awesome. It's underrated how much of an interactive web app you can build without using any libraries or frameworks nowadays. I actually also really like the idea of building simple/local web apps in a single HTML page. A while ago my child and I visited a science museum and played with a simple stop motion animator. I decided to make a…

I like this about quarto. You can create a standalone html file and share with people.

Re: Show HN: Nash, I made a standalone note with single HTML file

#125

Earlier quoted context omitted.

really, just like we had a "you don't need jquery for that" we need a "you don't need react (or vue, or svelte, or whatever else you are thinking) for that." plain, vanilla js and some decent skills will do nearly almost everything in a cleaner and more maintainable way. after decades of maintaining other people's stuff, dumb design by smart people beats all the other combinations.

The downside, of course, is needing to code in JavaScript.

As opposed to? You can use typescript and compile too. And/or still bundle with esbuild

Re: Show HN: Nash, I made a standalone note with single HTML file

#127
Ahh, good old contenteditable.

This is probably the simplest method, put straight in the address bar:

data:text/html,

You'll need a bit longer URI in order to support unicode.

Related Hacker News discussions:

https://news.ycombinator.com/item?id=6005295

https://news.ycombinator.com/item?id=5135194

Re: Show HN: Nash, I made a standalone note with single HTML file

#128

Suggestion: It should warn when you have edited it and are about to close the page without saving. Consider adding an `onbeforeunload` handler.

This webpage has a warning on close right now but that's a generally good suggestion.

Re: Show HN: Nash, I made a standalone note with single HTML file

#129
post #79

Earlier quoted context omitted.

Sorry I didn't mean to offend anyone. That said, I'm genuinely interested in understanding why you felt that way, is using VSCode considered something to be ashamed of or something, is it because it's a Microsoft product? PS: I have a strong positive bias towards VSCode due to personal history, so just trying to understand the developer perspective :)

> Sorry I didn't mean to offend anyone. I know, and it's nothing that needs an apology from you. Sometimes people (like me) feel offended over nothing, and it's more interesting for them to question why that is, instead of blamig the other party. That's not to say the reverse can't be true, just that it's tempting and too easy to project one's own offendedness if one isn't careful. But back to the interesting questio…

> even if they have taken on a more benign appearance.

The 'nasty' MS hasn't gone away. However their negative actions tend to be swept under the rug as somewhat confined to big biz and govt. Look at their headlines from the last five years for details.

Re: Show HN: Nash, I made a standalone note with single HTML file

#130

Earlier quoted context omitted.

This one line was like 90% of the original implementation of Writely (the startup that became Google Docs; source: I was one of the founders). The other 90% was all the backend code we had to write to properly synchronize edits across different browsers, each with their own bizarre suite of bugs in their contenteditable implementations :-)

This is a truly a great insight from how simple things can create industry giants like google docs. I believe that a lot of problems can be converted into synchronization problems in browsers. Are there any general synchronization libraries / applications that you suggest within browser / outside browser? Thanks in advance.

Not OP, but common solutions in this space represent the state as conflict-free replicated data types (CRDTs). Some popular browser-based libraries for that are Y.js[0] and Automerge[1].

[0]: https://yjs.dev/ [1]: https://automerge.org/

Post reply on HN