Repository navigation
Graph refactor - #57
Merged
Merged
Conversation
This commit is an internal refactor to use a graph to represent the imports inside of the application. The graph is now used as the source of truth for what is actually synced to disk. The graph is also used to determine what imports need to be pruned from the graph when the graph mutates. Prior to this commit, we could not accurately prun away the the the unreachable imports. Reachability is determined by running the [postorder algorithm](https://en.wikipedia.org/wiki/Tree_traversal#Post-order) for each of the root nodes. This effectively gives you all of the connected nodes. You then simply get all of the nodes against the connected nodes. What you are left with is the unreachable nodes. You then remove the unreachable nodes from the graph. Prior to this commit It was possible to have multiple versions of the same library in the compiled output. This was due to the fact that we would build a browserify bundle perch tree. This re-factor coaleases all of the npm: imports into a single file and but can cache bust across trees. All APIs should be documented now.
chadhietala
force-pushed
the
deleting-files
branch
from
July 11, 2015 21:52
7531016 to
9570e4e
Compare
Closed
chadhietala
force-pushed
the
deleting-files
branch
from
July 13, 2015 15:37
0281671 to
a3f819a
Compare
chadhietala
force-pushed
the
deleting-files
branch
from
July 13, 2015 15:40
a3f819a to
52bf576
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is an internal refactor to use a graph to represent the
imports inside of the application. The graph is now used as the source of
truth for what is actually synced to disk. The graph is also used to
determine what imports need to be pruned from the graph when the graph
mutates. Prior to this commit, we could not accurately prun away the the
the unreachable imports.
Reachability is determined by running the postorder
algorithm for each of the root nodes. This effectively gives you all of the connected
nodes. You then simply get all of the nodes against the connected nodes.
What you are left with is the unreachable nodes. You then remove the
unreachable nodes from the graph.
Prior to this commit It was possible to have multiple versions of the
same library in the compiled output. This was due to the fact that we
would build a browserify bundle perch tree. This re-factor coaleases all
of the npm: imports into a single file and but can cache bust across
trees.
All APIs should be documented now.
Graph Visualization
We are using graphlib for generated the graph and walking algorithms. Chris also has graphlib-dot which allows you to serialize the graph into DOT and then consume it by dagre-d3. It's also super handy in debugging as I found.