Skip to content

Keep path-to-regexp as a dependency for non-browser builds (or expose its exports) #2924

@pimlie

Description

@pimlie

What problem does this feature solve?

For vue-router v2.0.0 path-to-regexp was moved from a dependency to a dev dependency (thanks @pi0 for finding the commit).

Unfortunately the commit doesnt list a reason why this was (probably mostly security/political?), but I think it could make sense to keep path-to-regexp as an external dependency for non-browser builds.

One reason is that Nuxt.js also uses e.g. the tokensToFunction method of path-to-regexp. This means that currently a Nuxt.js app will include two copies of that function, one from vue-router and one from Nuxt.js itself which increases the bundle size needlessly.

Another solution for the above could be that vue-router would expose the path-to-regexp methods like tokensToFunction method so Nuxt.js can use those, but using dependencies has more benefits ofc like quicker delivery of patches for path-to-regexp.

What does the proposed API look like?

Revert: 76d83b6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy