Skip to content

Commit 56e2b0f

Browse files
committed
Remove object and page routes
1 parent a0eed66 commit 56e2b0f

1 file changed

Lines changed: 4 additions & 31 deletions

File tree

contributingGuides/philosophies/ROUTING.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Exceptions:
3131
### - MUST convey page hierarchy
3232
Just like breadcrumbs, the URL should reflect the path a user has taken.
3333

34-
Example of the paths taken to manage a workspace member
34+
Example of the paths taken to manage a workspace member:
3535
1. `workspaces`
3636
1. `workspaces/:policyID/overview`
3737
1. `workspaces/:policyID/members`
@@ -47,49 +47,22 @@ Internet routers and third-party-services can see and store any information in t
4747

4848
### - SHOULD NOT use query parameters
4949
Exceptions:
50-
- When a URL needs to be encoded and added to the path (eg. `?exitTo=URL`)
50+
- When a URL needs to be encoded and added to the path (eg. `?backTo=URL`, `?forwardTo=URL`)
5151
- When complex data needs to be part of the path (eg. `/search?q=QUERY`)
5252

5353
### - SHOULD NOT use optional parameters
5454
If there are optional parameters, use two separate route definitions instead to be explicit.
5555

56-
## Object Routes
57-
Object Routes that uniquely identify a specific data element in the product (eg, a report, a workspace, etc) should aim for brevity, as they are generally the building blocks of other routes.
58-
59-
### - MUST end with an ID in their path
60-
Examples:
61-
62-
- `settings/wallet/card/:cardID` the route for a specific credit card
63-
- `workspace/:policyID` the route for a specific workspace
64-
6556
### - SHOULD use plural nouns when there are multiple objects that can exist
6657
Exceptions:
6758

6859
- When abbreviated paths are used in specific instances like `r/` (for reports) and `a/` (for accounts) then plurality does not matter
6960

70-
### - MUST NOT nest inside other object paths
71-
If an object can be accessed by its own ID that doesn't depend on any other object IDs, then only use the object's ID in the URL.
72-
61+
### - SHOULD use only the minimal necessary information to render the page
7362
Examples:
74-
- `r/:threadReportID` GOOD - uses the minimum information required
63+
- `r/:threadReportID` GOOD - `threadReportID` is all that is needed and all the rest of the page can be derived from that
7564
- `r/:parentReportID/:threadReportID` BAD - the `parentReportID` is not necessary so it just adds cruft to the URL
7665

7766
Exceptions:
7867

7968
- When multiple IDs are **required** to render the page.
80-
81-
## Page Routes
82-
Page Routes should attempt to reflect the navigational position in the UI hierarchy, ideally matching the names of the elements pressed to get there, similar to a "trail of breadcrumbs".
83-
84-
### - MUST end with a page name
85-
Examples:
86-
87-
- `workspaces` the page to manage workspaces
88-
- `settings/wallet` the page where you manage your settings
89-
90-
### - MAY contain an ID in the path
91-
Examples:
92-
93-
- `r/:reportID/details` the route for the details of a specific report
94-
- `workspace/:policyID/invite` the page where workspace invites are managed
95-

0 commit comments

Comments
 (0)