TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Syncing files between browser and disk using Yjs and the File System Access API

87 pointsby mfesterabout 3 years ago

16 comments

superlopuhabout 3 years ago
I think CRDTs are super cool, and likely future of offline-first experiences. My main issue with Taskpaper documents in iCloud drive has been the awful conflict resolution experience, and would love an industry standard way of doing the merges automatically, in a syntax-aware way.<p>Funny you should post this article now, as I&#x27;m just getting ready to start on this work myself, would love recommendations about how to do this automatic conflict resolution on semi-structured text files if anyone has some!
评论 #31319796 未加载
评论 #31331621 未加载
jitlabout 3 years ago
I like the approach of using differential synchronization at the edges of a CRDT system. It seems like this approach can work well for plaintext data, or data easily reduced to a fixed set of plaintext fields.<p>For more advanced formats - like a tree structure document - I’m intimidated by the problem of computing a good semantic diff from the plaintext format, and how to apply that semantic diff to the CRDT format. Adding an `id` to every node in the tree is helpful for this purpose - but that makes it harder to write such documents by hand in plaintext.<p>Have you encountered any troubles with weird diffs that put documents into invalid states? For example, plaintext updates that somehow merge in a way that breaks the MDX or JS syntax? Do you have or foresee having a “resolve merge conflicts” flow?
评论 #31318668 未加载
robmccollabout 3 years ago
This is a fantastic direction. It&#x27;s interesting to me that you would rather revision control be implemented outside of this replication topology in something like git and that the interface between tools is strictly files rather than the CRDT events themselves. Integrating other applications in the CRDT event stream and maintaining the stream as the revision history would seem more efficient, less error-prone, and more open. Is it an eventual goal to expose something like this?
评论 #31318221 未加载
ankrgylabout 3 years ago
This is mind blowing stuff. I was skeptical that you could use the browser effectively as an intermediary to the file system, and that CRDTs would work reasonably well on files, but they seem to have overcome both obstacles. I’m curious, how do you envision this approach working with version control systems? What would it mean to “explore” a branch of a git repository, for example? Would that overwrite the global version of the file system?
评论 #31319545 未加载
gklittabout 3 years ago
I&#x27;m excited about this work. Traditionally it&#x27;s been hard to bridge local files and cloud documents, meaning that cloud data tends to stay siloed in specific editing UIs. This seems like the right first step towards letting traditional file-based editors work with realtime-collaborative cloud data.<p>Ultimately, in the long term, I think the filesystem probably provides the wrong abstraction for this use case though. The API we really need is &quot;make these changes&quot;, (w&#x2F; changes represented thoughtfully in a mergeable way) not &quot;here&#x27;s the new final state.&quot; For now, diffing filesystem states is a reasonable workaround.
评论 #31319129 未加载
XavierPladevallabout 3 years ago
This looks pretty interesting! Really cool to see progress in this space!<p>Out of curiosity how do you deal with moving files in the file system?
评论 #31318258 未加载
评论 #31317694 未加载
评论 #31317855 未加载
oulipoabout 3 years ago
Great write-up! I was wondering, do you run into any issues with corrupted formatting, like what is described in Peritext?<p><a href="https:&#x2F;&#x2F;www.inkandswitch.com&#x2F;peritext&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.inkandswitch.com&#x2F;peritext&#x2F;</a>
评论 #31317932 未加载
alexarenaabout 3 years ago
I&#x27;ve been using this for a bit and it&#x27;s incredibly cool to write plain markdown files VS Code and see them reflected immediately online. Well done + exciting step forward in Bring Your Own Client.
评论 #31322027 未加载
eternityforestabout 3 years ago
File system access is going to make some amazing things possible. With that plus service workers, Web is finally catching up to native.<p>I&#x27;m glad to see that other browsers(Except FF) have it.
lharriesabout 3 years ago
The demo is incredible and really cool to see you supporting the open source contributors behind the libraries you are using. Is it possible to handle going offline?
评论 #31320005 未加载
stedmanabout 3 years ago
&gt; hybrid browser-cloud-file data architectures<p>Epic.<p>Thanks for open sourcing this!
评论 #31322134 未加载
gaileesabout 3 years ago
Wow. How long did it take yall to pull this off?
评论 #31318287 未加载
alexmasmejabout 3 years ago
Congrats! Love it
评论 #31346955 未加载
tangjeff0about 3 years ago
Amazing work!
评论 #31319918 未加载
timconnorsabout 3 years ago
super slick write up. nice job!
评论 #31322028 未加载
sigmonsaysabout 3 years ago
no firefox love?
评论 #31319422 未加载
评论 #31320116 未加载