-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use URLSearchParams to decode and encode query params (#183)
* fix parseRoute * use URLSearchParams to decode and encode query params * document parseRoute and useMakeLinkWithPreservedPath
- Loading branch information
Showing
15 changed files
with
513 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@rescript-relay-router-example/client-rendering": patch | ||
"rescript-relay-router": patch | ||
--- | ||
|
||
fix parseRoute for routes with only query params or only path params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"rescript-relay-router": minor | ||
--- | ||
|
||
use URLSearchParams to decode and encode query params |
8 changes: 8 additions & 0 deletions
8
examples/client-rendering/src/routes/Root__Home_route_renderer.res
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
let renderer = Route__Root__Home_route.makeRenderer( | ||
~prepare=({environment}) => { | ||
LayoutQuery_graphql.load(~environment, ~variables=(), ~fetchPolicy=StoreOrNetwork) | ||
}, | ||
~render=props => { | ||
<Layout queryRef=props.prepared> {props.childRoutes} </Layout> | ||
}, | ||
) |
8 changes: 8 additions & 0 deletions
8
examples/client-rendering/src/routes/Root__PathParamsOnly_route_renderer.res
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
let renderer = Route__Root__PathParamsOnly_route.makeRenderer( | ||
~prepare=({environment}) => { | ||
LayoutQuery_graphql.load(~environment, ~variables=(), ~fetchPolicy=StoreOrNetwork) | ||
}, | ||
~render=props => { | ||
<Layout queryRef=props.prepared> {props.childRoutes} </Layout> | ||
}, | ||
) |
141 changes: 141 additions & 0 deletions
141
examples/client-rendering/src/routes/__generated__/RouteDeclarations.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
examples/client-rendering/src/routes/__generated__/Route__Root__Home_route.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
93 changes: 93 additions & 0 deletions
93
examples/client-rendering/src/routes/__generated__/Route__Root__PathParamsOnly_route.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 6 additions & 3 deletions
9
examples/client-rendering/src/routes/__generated__/Route__Root_route.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
examples/client-rendering/src/routes/__generated__/Routes.res
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.