Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nextjs-routes

Package Overview
Dependencies
Maintainers
0
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-routes - npm Package Versions

23
6

2.2.4

Diff

Changelog

Source

2.2.4

  • CLI invocation now reads next.config.js or next.config.mjs.
  • Fix route's handling of query keys whose value is undefined. Fixes #206. Thanks @sleepdotexe!
tatethurston
published 2.2.4-rc.1 •

tatethurston
published 2.2.3 •

Changelog

Source

2.2.3

  • Bug fix: usePathname and useParams were incorrectly resolving to any return types.
tatethurston
published 2.2.2 •

Changelog

Source

2.2.2

  • Adds support for Next.js's app directory. Link accepts either static routes (no url parameters) or a RouteLiteral string, which can be generated by the route 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 to Link or useRouter. This is a TypeScript branded type.

    import { RouteLiteral } from "nextjs-routes";
    

    route returns a RouteLiteral. If you construct a route string you can cast it to a RouteLiteral so that Link and useRouter will accept it:

    const myRoute = `/foos/${foo}` as RouteLiteral
    

    In general, prefer using the route helper to generate routes.

  • Refine types for usePathname, useRouter and useParams from "next/navigation" to use nextjs-routes generated types.

  • Fix generated routes when using parallel-routes and intercepting-routes.

  • Fix ref type for Link. Previously ref was missing, now it's correctly typed.

tatethurston
published 2.2.2-rc.4 •

tatethurston
published 2.2.2-rc.3 •

tatethurston
published 2.2.2-rc.2 •

tatethurston
published 2.2.2-rc.1 •

tatethurston
published 2.2.1 •

Changelog

Source

2.2.1

  • Fix route generation on Windows. See #187. Thanks @AkanoCA!
tatethurston
published 2.2.0 •

Changelog

Source

2.2.0

  • Add trailingSlash option to route. See #168
  • Fix the generated optional catch all route type. See #183
  • Sort the generated route types lexicographically.
23
6
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc