Releases: cher-ami/router
Releases · cher-ami/router
v3.5.1
v3.5.0
Re implement getPaused and setPaused because history block API don't keep the last URL pushed in history.
v3.4.0
-
remove
getPaused
andsetPaused
because history block API can do it. #149 -
props route returns queryParams & hash #153
export type TRouteProps = { params?: TParams queryParams?: TQueryParams hash?: string [x: string]: any }
v3.3.0
Fix sub-router createUrl
#154
When with createUrl
of a sub-router, from a sub-router, the URL wasn't build properly on the server-side. This cause a diff of render between server and client.
To resolve this issue we need to:
- Get an "is root router" state on server and client side
- Harly reset all Routers property on each http request (because the nodejs runtime is not clear on each http request)
- Rework
createUrl()
function: internalize all thegetUrlByRouteName
logic - Update and split tests
- Remove old core
getUrlByRouteName()
&getFullPathByPath()
- Remove core
compileUrl()
, use path-to-regexpcompile
instead
v3.2.1
v3.2.0
v3.1.2
v3.1.1
v3.1.0
Feature
Route matching with queryParams & hash
- url
/?foo=bar
match with route with path/
- url
/?foo=bar#my-hash
match with route with path/
- url
/bar?foo=bar#my-hash
match with route with path/bar
TRoute returns
currentRoute have to return these properties:
{
path: "/",
queryParams: { "foo": "bar" }
hash: "my-hash"
}
createUrl & Link component update
<Link>
component to props (TOpenRouteParams
) can takequeryParams
&hash
properties
<Link to={{ name: "Home", queryParams:{"foo": "bar", "zoo": "hello"}, hash: "my-hash" }}>...</Link>
// will create the URL -> /?foo=bar&zoo=hello#my-hash