You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a big, important change. I want to create a clean separation between three different trees that exist in a modern SPA.
The view tree
This is the tree that is commonly represented by something like React, and eventually renders down to the DOM.
The route tree
This is the tree that represents the potential "route space" in an application. The branches under each node represent a selection of potential active states; for example, a tab container would be represented by a node, and individual tabs are child nodes.
The route state tree
This is what isn't correctly represented in 0.1.x. Traditional routers represent "current state" as a scalar value, which makes sense on the server side but makes no sense on the client side. 0.1.x of pine represents state as a seq representing a single path down the tree, but this is wrong too. Instead, state should be represented as a tree, to account for the fact that multiple routing branches can be active at the same time.
In order to make this work, I need to create two methods:
(get-route-state route-tree path), of type RouteTree -> Path -> RouteState
(get-route-path route-tree route-state), of type RouteTree -> RouteState -> Path
The text was updated successfully, but these errors were encountered:
This is a big, important change. I want to create a clean separation between three different trees that exist in a modern SPA.
The view tree
This is the tree that is commonly represented by something like React, and eventually renders down to the DOM.
The route tree
This is the tree that represents the potential "route space" in an application. The branches under each node represent a selection of potential active states; for example, a tab container would be represented by a node, and individual tabs are child nodes.
The route state tree
This is what isn't correctly represented in
0.1.x
. Traditional routers represent "current state" as a scalar value, which makes sense on the server side but makes no sense on the client side.0.1.x
of pine represents state as aseq
representing a single path down the tree, but this is wrong too. Instead, state should be represented as a tree, to account for the fact that multiple routing branches can be active at the same time.In order to make this work, I need to create two methods:
(get-route-state route-tree path)
, of typeRouteTree -> Path -> RouteState
(get-route-path route-tree route-state)
, of typeRouteTree -> RouteState -> Path
The text was updated successfully, but these errors were encountered: