Replies: 1 comment
-
Nice, great to get these thoughts down! I copied to the older (though quite bare) #151 so locking this one |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A common design pattern in our apps is using a grid layout with a sidebar containing navigation menu items on the left and the app content on the right. This pattern is often paired with
react-router-dom
and itsHashRouter
component to provide SPA routing.Issues with current way of doing things
@dhis2/ui
for every appHashRouter
as backend does not know each app's routesProposed solution
d2.config.js
could be used by developers to declare the routes used by their app like so:and this config would then be used by the app shell to construct a sidebar and router. The runtime would reexport the
Link
andhistory
exports from the routing package for consumption by the app. Declaring the routes in this way also allows the backend to build a global routing table and hence we would not need to use hash routers.If
config.pages
is not present then the app shell would not create a sidebar and allow the app developer to manage routing.Beta Was this translation helpful? Give feedback.
All reactions