-
Notifications
You must be signed in to change notification settings - Fork 360
Conversation
This will break a lot of things, and depends on atom/atom#9213
|
Hm, I only have 2 (seemingly unrelated) failures on my machine, but there are a bunch of 🔴 on travis. In any case this is starting to come together nicely. |
- resolved a few conflicts - tests fail in new and exciting ways
This changes Directory::getEntries from sync to async as it consumes git status information from an async repo now.
I use Array::reduce here to chain the promises sequentially and stay close to the original for x in y sync implementation, because I felt like changing the current tree-view design / implementation too much is out of scope, even if it would be beneficial
|
This is green on my machine 🎉 with this change to atom - atom/atom#10352 though it seems that PR needs a little more attention before it can merge. The specs are deeply littered with waitsfor/runs grossness, but it seemed to be the most direct route to getting them green with this big refactor. In the future we should consider breaking up the spec sections into separate files and porting them to ES6 one by one. Also there are a few opportunities to asyncify this further but given the original intention was to just start using the async git stuff, i figured more refactoring should be done in a separate PR rather than mixing it in here. cc @atom/feedback - this isn't quite ready to merge but let's have a review anyway 😸 |
lib/tree-view.coffee
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitRepositoryAsync has .refreshStatusForPath which is the same as .getPathStatus, just with a clearer name.
|
🤘 Just 1️⃣ 📝 |
|
cc: @atom/feedback @atom/core Items for review / notable changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬 This is why it would be really fantastic to have a view model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we could figure out a way to rewrite tree-view incrementally without making it a giant project...
|
Okay, I looked at everything. It seems as reasonable as it can be for the fact that this code is woefully in need of a view model layer to separate the async complexity from DOM concerns. Asked a couple questions and suggested a couple things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naively, I would think we could have updateRoots return a promise that resolves after all of the directories are expanded, and do something like
@updateRoots(state.directoryExpansionStates).then =>
if state.selectedPath
@selectEntryForPath(state.selectedPath)
else
@selectEntry(@roots[0])I assume I'm missing something; how does the Directory::onDidAddEntries code path relate to this?
|
Almost 2 months without any work/news on this. Is this dead? |
|
@alexandernst not dead, just got set aside while we did some other work. The async repo support only just landed in stable a week ago so we'll need to pick this back up again soon. |
|
I don't believe we're going with the route that this PR is taking, considering nodegit is no more in Atom core. |

tree-view is the best candidate for exercising the new async repo class we’re working on in atom/atom#9213
This depends on that branch of atom/atom. The plan is to merge the async repo after it proves sufficient for tree-view’s consumption, then merge this.