Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDX utility for trailing slashes #6339
Comments
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. |
Is this solved by today or still open for commitment :) |
@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 :) |
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.