repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
693d3e2
parent
17b2c15
author
Eric Bower
date
2024-06-10 17:43:23 +0000 UTC
docs: update pdocs and reframe lib
8 files changed,  +60, -58
M docs/go.mod
+2, -1
 1@@ -2,7 +2,7 @@ module github.com/neurosnap/starfx/docs
 2 
 3 go 1.22
 4 
 5-require github.com/picosh/pdocs v0.0.0-20240218162954-0dec737a7805
 6+require github.com/picosh/pdocs v0.0.0-20240605155503-8b60d6355244
 7 
 8 require (
 9 	github.com/alecthomas/chroma v0.10.0 // indirect
10@@ -11,5 +11,6 @@ require (
11 	github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594 // indirect
12 	github.com/yuin/goldmark-meta v1.1.0 // indirect
13 	go.abhg.dev/goldmark/anchor v0.1.1 // indirect
14+	go.abhg.dev/goldmark/toc v0.10.0 // indirect
15 	gopkg.in/yaml.v2 v2.4.0 // indirect
16 )
M docs/go.sum
+4, -0
 1@@ -8,6 +8,8 @@ github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq
 2 github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
 3 github.com/picosh/pdocs v0.0.0-20240218162954-0dec737a7805 h1:DlHwGHcZKm76+kK7EGG16ExG8S/GM+uz6VDVljmksxw=
 4 github.com/picosh/pdocs v0.0.0-20240218162954-0dec737a7805/go.mod h1:4Ei1K68K1qYyqSx5shNdw4++PN1Ws3QhD1u5eJYBmsA=
 5+github.com/picosh/pdocs v0.0.0-20240605155503-8b60d6355244 h1:5kqyTKIuLWGX9zZwOZoi+maEZEZLkq6QPLspUs8jUJE=
 6+github.com/picosh/pdocs v0.0.0-20240605155503-8b60d6355244/go.mod h1:KXO3Z0EVdA811AX6mlK4lwFDT+KgmegRVrEmZU5uLXU=
 7 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 8 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 9 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
10@@ -23,6 +25,8 @@ github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUei
11 github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0=
12 go.abhg.dev/goldmark/anchor v0.1.1 h1:NUH3hAzhfeymRqZKOkSoFReZlEAmfXBZlbXEzpD2Qgc=
13 go.abhg.dev/goldmark/anchor v0.1.1/go.mod h1:zYKiaHXTdugwVJRZqInVdmNGQRM3ZRJ6AGBC7xP7its=
14+go.abhg.dev/goldmark/toc v0.10.0 h1:de3LrIimwtGhBMKh7aEl1c6n4XWwOdukIO5wOAMYZzg=
15+go.abhg.dev/goldmark/toc v0.10.0/go.mod h1:OpH0qqRP9v/eosCV28ZeqGI78jZ8rri3C7Jh8fzEo2M=
16 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
17 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
18 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
M docs/main.go
+0, -16
  1@@ -22,7 +22,6 @@ func main() {
  2 				Text: "Getting started",
  3 				Href: "/getting-started",
  4 				Page: pager("getting-started.md"),
  5-				Tag:  "Info",
  6 				Children: []*pdocs.Sitemap{
  7 					pdocs.AnchorTagSitemap("Motivation"),
  8 					pdocs.AnchorTagSitemap("When to use this library"),
  9@@ -34,7 +33,6 @@ func main() {
 10 				Text: "Thunks",
 11 				Href: "/thunks",
 12 				Page: pager("thunks.md"),
 13-				Tag:  "Side Effects",
 14 				Children: []*pdocs.Sitemap{
 15 					pdocs.AnchorTagSitemap("Thunk Action"),
 16 					pdocs.AnchorTagSitemap("Thunk Payload"),
 17@@ -45,7 +43,6 @@ func main() {
 18 				Text: "Endpoints",
 19 				Href: "/endpoints",
 20 				Page: pager("endpoints.md"),
 21-				Tag:  "Side Effects",
 22 				Children: []*pdocs.Sitemap{
 23 					pdocs.AnchorTagSitemap("Enforcing fetch response type"),
 24 					pdocs.AnchorTagSitemap("The same API endpoints but different logic"),
 25@@ -61,7 +58,6 @@ func main() {
 26 				Text: "Store",
 27 				Href: "/store",
 28 				Page: pager("store.md"),
 29-				Tag:  "Store",
 30 				Children: []*pdocs.Sitemap{
 31 					pdocs.AnchorTagSitemap("How to update state"),
 32 					pdocs.AnchorTagSitemap("Updating state from view"),
 33@@ -71,7 +67,6 @@ func main() {
 34 				Text: "React",
 35 				Href: "/react",
 36 				Page: pager("react.md"),
 37-				Tag:  "View",
 38 				Children: []*pdocs.Sitemap{
 39 					pdocs.AnchorTagSitemap("useSelector"),
 40 					pdocs.AnchorTagSitemap("useLoader"),
 41@@ -85,7 +80,6 @@ func main() {
 42 				Text: "Schema",
 43 				Href: "/schema",
 44 				Page: pager("schema.md"),
 45-				Tag:  "Store",
 46 				Children: []*pdocs.Sitemap{
 47 					pdocs.AnchorTagSitemap("Schema Assumptions"),
 48 					pdocs.AnchorTagSitemap("any"),
 49@@ -101,7 +95,6 @@ func main() {
 50 				Text: "Caching",
 51 				Href: "/caching",
 52 				Page: pager("caching.md"),
 53-				Tag:  "Store",
 54 				Children: []*pdocs.Sitemap{
 55 					pdocs.AnchorTagSitemap("Manual"),
 56 					pdocs.AnchorTagSitemap("Automatic"),
 57@@ -111,7 +104,6 @@ func main() {
 58 				Text: "Dependent Queries",
 59 				Href: "/dependent-queries",
 60 				Page: pager("dependent.md"),
 61-				Tag:  "Side Effects",
 62 				Children: []*pdocs.Sitemap{
 63 					pdocs.AnchorTagSitemap("Dispatch the thunk as an action"),
 64 					pdocs.AnchorTagSitemap("Call the middleware stack directly"),
 65@@ -121,7 +113,6 @@ func main() {
 66 				Text: "Middleware",
 67 				Href: "/middleware",
 68 				Page: pager("mdw.md"),
 69-				Tag:  "Side Effects",
 70 				Children: []*pdocs.Sitemap{
 71 					pdocs.AnchorTagSitemap("Context"),
 72 				},
 73@@ -130,7 +121,6 @@ func main() {
 74 				Text: "Loaders",
 75 				Href: "/loaders",
 76 				Page: pager("loader.md"),
 77-				Tag:  "Side Effects",
 78 				Children: []*pdocs.Sitemap{
 79 					pdocs.AnchorTagSitemap("Usage"),
 80 					pdocs.AnchorTagSitemap("Shape"),
 81@@ -140,13 +130,11 @@ func main() {
 82 				Text: "Structured Concurrency",
 83 				Href: "/structured-concurrency",
 84 				Page: pager("structured-concurrency.md"),
 85-				Tag:  "Info",
 86 			},
 87 			{
 88 				Text: "Supervisors",
 89 				Href: "/supervisors",
 90 				Page: pager("supervisors.md"),
 91-				Tag:  "Advanced",
 92 				Children: []*pdocs.Sitemap{
 93 					pdocs.AnchorTagSitemap("poll"),
 94 					pdocs.AnchorTagSitemap("timer"),
 95@@ -156,25 +144,21 @@ func main() {
 96 				Text: "Testing",
 97 				Href: "/testing",
 98 				Page: pager("testing.md"),
 99-				Tag:  "Advanced",
100 			},
101 			{
102 				Text: "Design Philosophy",
103 				Href: "/design-philosophy",
104 				Page: pager("design-philosophy.md"),
105-				Tag:  "Info",
106 			},
107 			{
108 				Text: "API",
109 				Href: "/api",
110 				Page: pager("api.md"),
111-				Tag:  "Info",
112 			},
113 			{
114 				Text: "Resources",
115 				Href: "/resources",
116 				Page: pager("resources.md"),
117-				Tag:  "Info",
118 				Children: []*pdocs.Sitemap{
119 					pdocs.AnchorTagSitemap("Quick Links"),
120 					pdocs.AnchorTagSitemap("Talk"),
M docs/posts/getting-started.md
+8, -8
 1@@ -16,16 +16,15 @@ React hook-based fetching and caching libraries dramatically simplify data
 2 synchronization but are so tightly coupled to a component's life cycle that it
 3 creates waterfall fetches and loading spinners everywhere. We also have the
 4 downside of not being able to normalize our cache which means we have to spend
 5-time thinking about how and when to invalidate our various caches.
 6+time thinking about how and when to invalidate our cache.
 7 
 8 Further, all of these data caching libraries don't handle data normalization. In
 9-every library we are going to see a line similar to this: "Data normalization is
10-hard and it isn't worth it." Their libraries are not built with data
11-normalization in mind so they claim it's an anti-feature. Why do we want to
12-normalize data in the backend but not the frontend? Data normalization is
13-critically important because it makes CRUD operations automatically update our
14-web app without having to invalidate our cache just so the app will refetch the
15-data we already have.
16+every library we are going to see a line like: "Data normalization is hard and
17+it isn't worth it." Their libraries are not built with data normalization in
18+mind so they claim it's an anti-feature. Why do we want to normalize data in the
19+backend but not the frontend? Data normalization is critically important because
20+it makes CRUD operations automatically update our web app without having to
21+invalidate our cache.
22 
23 So what if we are building a highly interactive web app that doesn't need SEO
24 and we also need more control over data synchronization and caching?
25@@ -46,6 +45,7 @@ was something missing.
26 
27 The benefits of using this library:
28 
29+- The missing model and controller (MC) in react (V)
30 - Designed for single-page applications (SPAs)
31 - Makes data normalization easy and straightforward
32 - Has a powerful middleware system similar to express to handle requests and
M docs/static/main.css
+1, -1
1@@ -1,5 +1,5 @@
2 .sitemap {
3-  width: 150px;
4+  width: 250px;
5 }
6 
7 .post {
M docs/tmpl/home.page.tmpl
+5, -5
 1@@ -16,7 +16,7 @@
 2     <div class="flex items-center justify-center hero">
 3       <div class="flex flex-col items-center gap-2">
 4         <h1 class="logo-header text-2xl">starfx</h1>
 5-        <div class="text-center text-lg">A modern approach to side-effect and state management for web apps.</div>
 6+        <div class="text-center text-lg">A micro-mvc framework for react apps.</div>
 7         <a href="/getting-started" class="btn-link">GET STARTED</a>
 8       </div>
 9     </div>
10@@ -38,16 +38,16 @@
11 
12       <div class="box">
13         <h3 class="m-0 p-0 text-lg">
14-         React integration
15+          Task tree side-effect system
16         </h3>
17-        <p>Built for react</p>
18+        <p>A robust system for handling complex business logic</p>
19       </div>
20 
21       <div class="box">
22         <h3 class="m-0 p-0 text-lg">
23-          Task tree side-effect system
24+         React integration
25         </h3>
26-        <p>A robust system for handling complex business logic</p>
27+        <p>Built for react</p>
28       </div>
29     </article>
30   </div>
M docs/tmpl/sitemap-footer.partial.tmpl
+22, -11
 1@@ -1,17 +1,28 @@
 2 {{define "sitemap-footer"}}
 3 <div class="sitemap text-sm mb-4">
 4+<ul class="list-none">
 5 {{range .Sitemap.Children -}}
 6-  <div>
 7-  {{- if (and $.Prev (eq $.Prev.GenHref .GenHref)) -}}
 8-  <a href="{{.GenHref}}" class="link-alt-adj">{{.Text}}</a>
 9-  {{- else if (and $.Next (eq $.Next.GenHref .GenHref)) -}}
10-  <a href="{{.GenHref}}" class="link-alt-adj">{{.Text}}</a>
11-  {{- else if (eq $.Href .GenHref) -}}
12-  <a href="{{.GenHref}}" class="link-alt-hover">{{.Text}}</a>
13-  {{- else -}}
14-  <a href="{{.GenHref}}" class="link-alt">{{.Text}}</a>
15-  {{- end -}}
16-  </div>
17+  {{if .Href}}
18+  <li><a href="{{.GenHref}}" class="link-alt text-md">{{.Text}}</a></li>
19+  {{else}}
20+  <li class="text-md">{{.Text}}</li>
21+  {{end}}
22+  {{range .Children -}}
23+    <ul class="list-none sidebar-list">
24+      <li>
25+        {{- if (and $.Prev (eq $.Prev.GenHref .GenHref)) -}}
26+        <a href="{{.GenHref}}" class="link-alt-adj">{{.Text}}</a>
27+        {{- else if (and $.Next (eq $.Next.GenHref .GenHref)) -}}
28+        <a href="{{.GenHref}}" class="link-alt-adj">{{.Text}}</a>
29+        {{- else if (eq $.Href .GenHref) -}}
30+        <a href="{{.GenHref}}" class="link-alt-hover">{{.Text}}</a>
31+        {{- else -}}
32+        <a href="{{.GenHref}}" class="link-alt">{{.Text}}</a>
33+        {{- end -}}
34+      </li>
35+    </ul>
36+  {{- end}}
37 {{- end}}
38+</ul>
39 </div>
40 {{end}}
M docs/tmpl/toc.partial.tmpl
+18, -16
 1@@ -1,23 +1,25 @@
 2 {{define "toc"}}
 3-<div>
 4-  {{range $key, $value := .SitemapByTag}}
 5-    <div class="box my">
 6-      <h2 class="text-xl">{{$key}}</h2>
 7-      <ul>
 8-        {{range $value}}
 9+<div class="sitemap-grid">
10+{{range .Sitemap.Children -}}
11+  {{if .Children}}
12+  <div class="box my">
13+    <h2 class="text-xl text-underline inline-block">{{.Text}}</h2>
14+    <ul class="list-none" style="padding-left: 0;">
15+    {{range .Children -}}
16+      <li>
17+        <a href="{{.GenHref}}">{{.Text}}</a>
18+        <ul class="list-disc" style="padding-left: 2rem;">
19+        {{range .Children}}
20           <li>
21-            <a href="{{.GenHref}}">{{.Text}}</a>
22-            {{if .Children}}
23-              <ul>
24-              {{range .Children}}
25-                <li><a href="{{.ParentHref}}{{.GenHref}}">{{.Text}}</a></li>
26-              {{end}}
27-              </ul>
28-            {{end}}
29+            <a href="{{.ParentHref}}{{.GenHref}}">{{.Text}}</a>
30           </li>
31         {{end}}
32-      </ul>
33-    </div>
34+        </ul>
35+      </li>
36+    {{- end}}
37+    </ul>
38+  </div>
39   {{end}}
40+{{- end}}
41 </div>
42 {{end}}