Releases: tatethurston/nextjs-routes
v1.0.2
1.0.2
-
Link
now accepts anchor props:<Link href="/dashboard" className="border-indigo-500"> Dashboard </Link>
Full Changelog: v1.0.1...v1.0.2
v1.0.1
1.0.1
-
Update
NextRouter
type to keepquery
andpathname
bound in a union. This allows you to userouter
fromuseRouter
as an argument torouter.push
orrouter.replace
:const router = useRouter(); // reload the current page, preserving search parameters router.push(router, undefined, { locale: "fr" });
Full Changelog: v1.0.0...v1.0.1
v1.0.0
1.0.0
-
This library will now follow semantic versioning.
-
The previously deprecated direct invocation of nextjs-routes via
npx nextjs-routes
has been removed in favor of automatic regeneration via withRoutes. See #63 for the motivation behind this change or to voice any concerns.
Full Changelog: v0.1.7...v1.0.0
v0.1.7
0.1.7
-
Support Next 13 app (beta) directory
-
Add
dir
option to support non standard NextJS project structures such as Nx:// next.config.js const withRoutes = require("nextjs-routes/config")({ dir: __dirname });
Thanks @alexgorbatchev for the contribution!
New Contributors
- @alexgorbatchev made their first contribution in #91
Full Changelog: v0.1.6...v0.1.7
v0.1.6
0.1.6
-
Accept path strings for static routes:
<Link href="/foo">Foo</Link>
Thanks @MariaSolOs for the contribution!
-
Use function overloads for
Link
androuter.push
androuter.replace
. This yields better hints for typos in pathnames:<Link href={{ pathname: "/foosy/[foo]" }}>Foo</Link>
Previously:
[tsserver 2322] [E] Type '"/foos/[foo]"' is not assignable to type '"/"'.
Now:
Type '"/foosy/[foo]"' is not assignable to type '"/api/hello" | "/bars/[bar]" | "/foos/[foo]" | "/"'. Did you mean '"/foos/[foo]"'?
(+2 other overload errors).
Full Changelog: v0.1.5...v0.1.6
v0.1.5
0.1.5
-
Export
Locale
fromnextjs-routes
.import { Locale } from "nextjs-routes";
New Contributors
Full Changelog: v0.1.4...v0.1.5
v0.1.4
0.1.4
nextjs-routes
now generates route types for Nextjs i18n configuration. Eg the following next config:
module.exports = withRoutes({
i18n: {
defaultLocale: "de-DE",
locales: ["de-DE", "en-FR", "en-US"],
},
});
Will make locale
typed as 'de-DE' | 'en-FR' | 'en-US'
for Link
and useRouter
.
Full Changelog: v0.1.3...v0.1.4
v0.1.3
0.1.3
nextjs-routes
pageExtensions has been updated to respect multiple extensions such as.page.tsx
. In0.1.2
, only single extensions.tsx
were respected. This is now identical behavior to Next.js. Thanks @Elindorath!
New Contributors
- @Elindorath made their first contribution in #79
Full Changelog: v0.1.2...v0.1.3
v0.1.2
0.1.2
nextjs-routes
now respects pageExtensions fromnext.config.js
.
Full Changelog: v0.1.1...v0.1.2
v0.1.1
0.1.1
[skipped]