fenok / react-router-typesafe-routes

Comprehensive and extensible type-safe routes for React Router v6 with first-class support for nested routes and param validation.
MIT License
145 stars 3 forks source link

Consider renaming buildUrl and buildRelativeUrl functions #22

Closed fenok closed 1 year ago

fenok commented 1 year ago

Current names are misleading because these functions don't generate full URLs. Instead, they generate URL parts which are called paths in React Router. There already are buildPath and buildRelativePath functions, but they actually generate pathnames, so they can also be renamed.

These are the possible renamings:

It won't even be a breaking change, because buildUrl can be safely used instead of buildPath.

fenok commented 1 year ago

buildPathname and buildRelativePathname seem redundant, so it's better to simply have buildPath and buildRelativePath.