Skip to content

Releases: swan-io/chicane

2.1.0

22 Jul 15:18
0718590
Compare
Choose a tag to compare
  • Add the InferRoutes utility type
  • Fix Router.push / Router.replace / Router.{RouteName} params argument type when routeName is an union:
const Router = createRouter({
  One: "/:one",
  Two: "/:one/:two",
});

const fn = (name: "One" | "Two") => {
  // previously, '{ one: string }' was valid, as it fulfilled the "One" route params type
  Router.push(name, { one: "1" }); // ❌ not assignable to type '{ one: string; two: string }'.
};

2.0.0

04 Apr 09:35
ad06acb
Compare
Choose a tag to compare

What's new

  • Union params support, with /:env{live|sandbox}/projects syntax
  • ts-pattern interop with Router.P.{RouteName}()

Breaking changes

  • Remove hash support (#:param)
  • Remove Location key property
  • Rename useNavigationBlocker to useBlocker

1.4.1

28 Jun 09:33
c57cc4e
Compare
Choose a tag to compare

1.4.0

25 May 08:56
9e87177
Compare
Choose a tag to compare

1.3.4

22 Feb 15:08
Compare
Choose a tag to compare
  • Fix create-react-app compatibility (90be57b)

1.3.3

02 Feb 12:47
9343316
Compare
Choose a tag to compare
  • Extract GetCreateURLFns type in order to avoid TS "type flattening" issue in emitted createRouter.d.ts (fixes #37)

1.3.2

23 Oct 10:25
Compare
Choose a tag to compare
  • Improve params matching performances when no search params are defined.

1.3.1

18 Oct 20:02
Compare
Choose a tag to compare
  • Fix a regression with basePath option

1.3.0

28 Sep 09:57
Compare
Choose a tag to compare
  • Add support for search and hash params on wildcard routes (/*).
    This allow some neat tricks, like using a search param from a whole app area:
export const Router = createRouter({
  Home: "/",

  ...createGroup("User", "/users?:impersonatedId", {
    Area: "/*", // UserArea: "/users/*?:impersonatedId" -> You can get impersonatedId value at area root
    Detail: "/:userId", // UserDetail: "/users/:userId?:impersonatedId" -> as it's a group, each route accept impersonatedId param
  }),
});

1.2.5

25 Aug 15:21
5a61b18
Compare
Choose a tag to compare
  • Rollback some parts of the previous release (it break some types, like URL creation functions params)