Skip to content

Commit

Permalink
Document @rules_prerender architecture.
Browse files Browse the repository at this point in the history
Refs #40.

For now this gives a rough timeline of how builds work "Life of a build" and a deep dive into `prerender_component` and the how/why of its constraints.

In the future, we should document how publishing/linking components works, since that's a particularly tricky area of complexity.
  • Loading branch information
dgp1130 committed Jul 23, 2023
1 parent 4471425 commit d7d1770
Show file tree
Hide file tree
Showing 8 changed files with 642 additions and 0 deletions.
58 changes: 58 additions & 0 deletions docs/architecture/component.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
digraph mygraph {
node [shape=box];

subgraph cluster_slice_aliases {
label = "Slice Aliases";

":component_prerender"
":component_scripts"
":component_styles"
":component_resources"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":component_prerender" -> ":component_scripts" -> ":component_styles" -> ":component_resources" [ style=invis ];
rankdir = LR;
}
}

":component_resources" -> ":component_metadata"
":component_resources" -> ":resources"
":component_styles" -> ":component_metadata"
":component_styles" -> ":styles"
":component_prerender" -> ":component_metadata"
":component_prerender" -> ":prerender"
":component_scripts" -> ":component_metadata"
":component_scripts" -> ":scripts"
":component_metadata"
":component_metadata" -> ":component"
":component_metadata" -> ":prerender"
":component_metadata" -> ":scripts"
":component_metadata" -> ":styles"
":component_metadata" -> ":resources"
":component"
":component" -> ":prerender"
":component" -> ":resources"
":component" -> ":scripts"
":component" -> ":styles"

subgraph cluster_component_inputs {
label = "Component Inputs";
labelloc = b;

":styles"
":scripts"
":resources"
":prerender"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":prerender" -> ":scripts" -> ":styles" -> ":resources" [ style=invis ];
rankdir = LR;
}
}
}
43 changes: 43 additions & 0 deletions docs/architecture/component_aliases.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
digraph mygraph {
node [shape=box];

subgraph cluster_slice_aliases {
label = "Slice Aliases";

":component_prerender"
":component_scripts"
":component_styles"
":component_resources"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":component_prerender" -> ":component_scripts" -> ":component_styles" -> ":component_resources" [ style=invis ];
rankdir = LR;
}
}

":component_resources" -> ":resources"
":component_styles" -> ":styles"
":component_prerender" -> ":prerender"
":component_scripts" -> ":scripts"

subgraph cluster_component_inputs {
label = "Component Inputs";
labelloc = b;

":styles"
":scripts"
":resources"
":prerender"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":prerender" -> ":scripts" -> ":styles" -> ":resources" [ style=invis ];
rankdir = LR;
}
}
}
27 changes: 27 additions & 0 deletions docs/architecture/component_check.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
digraph mygraph {
node [shape=box];

":component"
":component" -> ":prerender"
":component" -> ":resources"
":component" -> ":scripts"
":component" -> ":styles"

subgraph cluster_component_inputs {
label = "Component Inputs";
labelloc = b;

":styles"
":scripts"
":resources"
":prerender"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":prerender" -> ":scripts" -> ":styles" -> ":resources" [ style=invis ];
rankdir = LR;
}
}
}
21 changes: 21 additions & 0 deletions docs/architecture/component_composition.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
digraph mygraph {
node [shape=box];

":foo_prerender";
":foo_prerender_lib";
":foo_metadata";
":bar_prerender";
":bar_prerender_lib";
":bar_scripts_lib";
":bar_metadata";

":foo_prerender" -> ":foo_prerender_lib";
":foo_prerender" -> ":foo_metadata";
":foo_metadata" -> ":foo_prerender_lib";
":foo_prerender_lib" -> ":bar_prerender";

":bar_prerender" -> ":bar_prerender_lib";
":bar_prerender" -> ":bar_metadata";
":bar_metadata" -> ":bar_prerender_lib";
":bar_metadata" -> ":bar_scripts_lib";
}
48 changes: 48 additions & 0 deletions docs/architecture/component_metadata.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
digraph mygraph {
node [shape=box];

subgraph cluster_slice_aliases {
label = "Slice Aliases";

":component_prerender"
":component_scripts"
":component_styles"
":component_resources"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":component_prerender" -> ":component_scripts" -> ":component_styles" -> ":component_resources" [ style=invis ];
rankdir = LR;
}
}

":component_prerender" -> ":component_metadata"
":component_scripts" -> ":component_metadata"
":component_styles" -> ":component_metadata"
":component_resources" -> ":component_metadata"
":component_metadata"
":component_metadata" -> ":prerender"
":component_metadata" -> ":scripts"
":component_metadata" -> ":styles"
":component_metadata" -> ":resources"

subgraph cluster_component_inputs {
label = "Component Inputs";
labelloc = b;

":prerender"
":scripts"
":styles"
":resources"

// Enforce left-to-right ordering.
// https://stackoverflow.com/questions/44274518/how-can-i-control-within-level-node-order-in-graphvizs-dot
{
rank = same;
":prerender" -> ":scripts" -> ":styles" -> ":resources" [ style=invis ];
rankdir = LR;
}
}
}
Loading

0 comments on commit d7d1770

Please sign in to comment.