rojo icon indicating copy to clipboard operation
rojo copied to clipboard

Two-Way Sync

Open LPGhatguy opened this issue 6 years ago • 0 comments

This is the giant killer feature Rojo needs!

Enabling Two-Way Sync

Turn on the "Two-Way Sync" toggle in the plugin, available on master:

Rojo settings panel

Work Items

Remaining work for two-way sync involves every issue with the "two-way-sync" label.

Patch-to-VFS-Patch Resolver

One promising approach is to eagerly apply the client's patch (which is of type PatchSet), which will give us an AppliedPatchSet. Using the applied patch as well as information from the DOM, we should be able to produce a VfsPatch of some sort.

If generating a VfsPatch fails, like we couldn't figure out how to modify the files on-disk, we can snapshot instances from the filesystem again to undo the patch and let the client know that their change was rejected.

VfsPatch should be pretty simple, probably similar to the shape of AppliedPatchSet. Something like:

struct VfsPatch {
    pub removed: Vec<PathBuf>,
    pub updated: Vec<(PathBuf, Vec<u8>)>, // with its own struct instead of a tuple
    pub added: Vec<VfsPatchAdd>,
}

How you can help

Rojo's codebase has historically been kind of a rat's nest of complexity. We're slowly trying to make it better, and any improvements to readability (comments, better names, small refactors) are welcome!

There are more ways to help than with code, though. Come to the Roblox Open Source Discord (run by Quenty) to get involved in design discussions, hard technical problems, documentation, and evangelism!

LPGhatguy avatar Apr 24 '19 08:04 LPGhatguy