The Wayback Machine - https://web.archive.org/web/20201109160841/https://github.com/nuxt/nuxt.js/issues/6339
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX utility for trailing slashes #6339

Open
manniL opened this issue Sep 1, 2019 · 3 comments
Open

DX utility for trailing slashes #6339

manniL opened this issue Sep 1, 2019 · 3 comments

Comments

@manniL
Copy link
Member

@manniL manniL commented Sep 1, 2019

Related PR: #6331
Suggested by @pimlie

When trailing slash handling is enforced (in any manner), it'd be great to have two things for improved DX:

Nuxt Link adaption

No matter how you input the links in your Nuxt link (be it as an object via named routes or via string), the component should enforce the set up trailing slash handling (adding or removing the slashes as needed).

Utility function for Nuxt modules

To ensure that all modules (like https://github.com/nuxt-community/redirect-module or https://github.com/nuxt-community/sitemap-module) have the same implementation of trailing slash handling, we should provide a utility for that.

@pimlie
Copy link
Member

@pimlie pimlie commented Sep 5, 2019

So basically these DX tools could be an adaption of these utilities. Here are the corresponding unit tests.

They'd probably only need to be adapted to use a nuxt config setting of whether to enforce the trailing slash or not. @manniL feel free to copy what you need if you want to look in to this.

@dtmzr
Copy link
Contributor

@dtmzr dtmzr commented Jun 6, 2020

Is this solved by today or still open for commitment :)

@pi0
Copy link
Member

@pi0 pi0 commented Jun 7, 2020

@dtmzr Nop it is still open. we will have to make a reusable utility across repos. We will keep here updated when published so we can use it on all random places doing url normalization. Including vue-app, vue-renderer and 3rd party modules :)

@pi0 pi0 assigned pi0 and unassigned manniL and pimlie Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.