Skip to content

Releases: willybrauner/low-router

@wbe/[email protected]

15 Aug 09:47
33192fd
Compare
Choose a tag to compare

Patch Changes

  • 2abc0f7: export compilePath

    Add missing compilePath export in index.ts

@wbe/[email protected]

15 Aug 09:42
d2f6705
Compare
Choose a tag to compare

Minor Changes

  • e5eca20: extract compile path function

    before:

    LowRouter.compilePath(path)(params)

    after:

    compilePath(path)(params)
    • compile base if it contains params in createUrl
  • 71279f3: extract compilePath static method as external function

@wbe/[email protected]

12 Aug 22:15
27f6860
Compare
Choose a tag to compare

Minor Changes

  • 1cd1608: change local browserHistory listener params to object

    Goal is to feat with the remix history lib api in order to switch to it easily, if needed.

    before:

    history.listen((location, action) => {})

    after:

    history.listen(({ location, action }) => {})
  • 74f5122: Cleanup type generics

Patch Changes

  • b2efc1d: expose options

    options are now a public value, in order to get them from the instance.

    const router = new LowRouter(routes, options)
    console.log(router.options) // {...}

@wbe/[email protected]

11 Aug 09:04
8f6e5b4
Compare
Choose a tag to compare

Minor Changes

  • 358bae8: RouteContext returns relativePathname

    RouteContext returns relativePathname. It's the compiled path of current router instance.

    export interface RouteContext<A = any, C extends RouterContext = RouterContext> {
      pathname: string
      params: RouteParams
      query: QueryParams
      hash: Hash
      base: string
      route: Route<A, C>
      parent: RouteContext<A, C> | null
    + relativePathname: string
    }

@wbe/[email protected]

10 Aug 15:20
9003064
Compare
Choose a tag to compare

Minor Changes

  • 5035b82: Externalize compile path as static method.

    ex:

    LowRouter.compilePath("/foo/:id")({ id: "bar" }) // "/zoo/bar"

@wbe/[email protected]

29 Apr 12:07
4bf69c2
Compare
Choose a tag to compare

Minor Changes

  • 4ce916c: Install @wbe/debug dependency

    • browser debug:

      localStorage.debug = "low-router:*"
    • Node debug:

      DEBUG=low-router:*

@wbe/[email protected]

26 Mar 17:58
d1c75c1
Compare
Choose a tag to compare

Minor Changes

  • e02a7f3: Create resolveSync method

    Resolve a route synchronously. It returns response and context without promise.

    const { response, context } = router.resolveSync("/foo")

@wbe/[email protected]

12 Jan 08:40
4963c82
Compare
Choose a tag to compare

Minor Changes

  • c98cc80: ## breaking change: Improve resolve and onResolve params.

    router.resolve() and onResolve() option return now {response, context} object of the matching route.

    before:

    router.resolve("/").then((res) => {
      // res: "Hello home!"
    })

    after:

    router.resolve("/").then(({ response, context }) => {
      // response: "Hello home!"
      // context: RouteContext interface
    })

@wbe/[email protected]

25 Nov 13:37
185d080
Compare
Choose a tag to compare

Patch Changes

@wbe/[email protected]

29 Sep 10:47
689dd32
Compare
Choose a tag to compare

Minor Changes