Releases: tatethurston/nextjs-routes
v2.2.4
What's Changed
- CLI invocation now reads next.config.js or next.config.mjs.
- Fix
route
's handling of query keys whose value isundefined
. Fixes #206. Thanks @sleepdotexe!
Full Changelog: v2.2.3...v2.2.4
v2.2.4-rc.1
2.2.4-rc.1
- CLI invocation now reads next.config.js or next.config.mjs.
Full Changelog: v2.2.3...v2.2.4-rc.1
v2.2.3
2.2.3
- Bug fix:
usePathname
anduseParams
fromnext/navigation
were incorrectly resolving toany
return types.
Full Changelog: v2.2.2...v2.2.3
v2.2.2
2.2.2
-
Adds support for Next.js's
app
directory.Link
accepts either static routes (no url parameters) or aRouteLiteral
string, which can be generated by theroute
helper from this library:import { route } from "nextjs-routes"; <Link href={route({ pathname: "/foos/[foo]", query: { foo: "bar" }, })} > Baz </Link>;
-
Add
RouteLiteral
type. This type represents a string that has been confirmed to be a validated application route and can be passed toLink
oruseRouter
. This is a TypeScript branded type.import { RouteLiteral } from "nextjs-routes";
route
returns aRouteLiteral
. If you construct a route string you can cast it to aRouteLiteral
so thatLink
anduseRouter
will accept it:const myRoute = `/foos/${foo}` as RouteLiteral
In general, prefer using the
route
helper to generate routes. -
Refine types for
usePathname
,useRouter
anduseParams
from"next/navigation"
to usenextjs-routes
generated types. -
Fix generated routes when using parallel-routes and intercepting-routes.
-
Fix
ref
type forLink
. Previouslyref
was missing, now it's correctly typed.
Full Changelog: v2.2.1...v2.2.2
v2.2.2-rc.4
2.2.2
-
Adds support for Next.js's
app
directory.Link
accepts either static routes (no url parameters) or aRouteLiteral
string, which can be generated by theroute
helper from this library:import { route } from "nextjs-routes"; <Link href={route({ pathname: "/foos/[foo]", query: { foo: "bar" }, })} > Baz </Link>;
-
Add
RouteLiteral
type. This type represents a string that confirmed to be a validated application route and can be passed toLink
oruseRouter
. This is a TypeScript branded type.import { RouteLiteral } from "nextjs-routes";
-
Refine types for
usePathname
anduseParams
from"next/navigation"
to usenextjs-routes
generated types. -
Fix generated routes when using parallel-routes and intercepting-routes.
-
Fix
ref
type forLink
. Previouslyref
was missing, now it's correctly typed.
Full Changelog: v2.2.2-rc.3...v2.2.2-rc.4
v2.2.2-rc.3
2.2.2-rc.3
-
Adds support for Next.js's
app
directory.Link
accepts either static routes (no url parameters) or aRouteLiteral
string, which can be generated by theroute
helper from this library:import { route } from "nextjs-routes"; <Link href={route({ pathname: "/foos/[foo]", query: { foo: "bar" }, })} > Baz </Link>;
-
Add
RouteLiteral
type. This type represents a string that confirmed to be a validated application route and can be passed toLink
oruseRouter
. This is a TypeScript branded type.import { RouteLiteral } from "nextjs-routes";
-
Refine types for
usePathname
anduseParams
from"next/navigation"
to usenextjs-routes
generated types. -
Fix generated routes when using parallel-routes and intercepting-routes.
v2.2.2-rc.2
What's Changed
2.2.2-rc.2
-
Adds support for Next.js's
app
directory.Link
accepts either static routes (no url parameters) or aRouteLiteral
string, which can be generated by theroute
helper from this library:import { route } from "nextjs-routes"; <Link href={route({ pathname: "/foos/[foo]", query: { foo: "bar" }, })} > Baz </Link>;
-
Add
RouteLiteral
type. This type represents a string that confirmed to be a validated application route and can be passed toLink
oruseRouter
. This is a TypeScript branded type.import { RouteLiteral } from "nextjs-routes";
-
Refine types for
usePathname
anduseParams
from"next/navigation"
Full Changelog: v2.2.2-rc.1...v2.2.2-rc.2
v2.2.2-rc.1
2.2.2
-
Adds support for Next.js's
app
directory.Link
accepts either static routes (no url parameters) or aRouteLiteral
string, which can be generated by theroute
helper from this library:import { route } from "nextjs-routes"; <Link href={route({ pathname: "/foos/[foo]", query: { foo: "bar" }, })} > Baz </Link>;
-
Add
RouteLiteral
type. This type represents a string that confirmed to be a validated application route and can be passed toLink
oruseRouter
. This is a TypeScript branded type.import { RouteLiteral } from "nextjs-routes";
v2.2.0
What's Changed
- Add
trailingSlash
option toroute
. See #168 - Fix the generated optional catch all route type. See #183
- Sort the generated route types lexicographically.
Full Changelog: v2.1.0...v2.2.0