router icon indicating copy to clipboard operation
router copied to clipboard

Can't use $ route params when using Microsoft TFVC

Open Renart-fox opened this issue 1 year ago • 2 comments

Describe the bug

This is a feature request.

I am using TFVC for source control and due to naming conventions, I cannot use a dollar sign in a path component, which means any file with a dollar sign in its name cannot be commited.

It is mostly Microsoft's fault for working this way, but it would still be great if we could customize the token to use.

Your Example Website or App

https://github.com/TanStack/router/discussions/1565

Steps to Reproduce the Bug or Issue

  1. Create a file with a $ in its name
  2. Try to commit your modifications

Expected behavior

The user could change the token for the params in order to follow naming conventions.

Screenshots or Videos

No response

Platform

OS: Windows 10 Version control via Teams Foundation Version Control

Additional context

Issue created as asked here : https://github.com/TanStack/router/discussions/1565

Renart-fox avatar Jun 03 '24 08:06 Renart-fox

Currently, the router-generator, follows pretty closely with how Remix handles filesystem routing.

I've linked some resource below, which should probably be considered before making this change.

Microsoft TFVC Restrictions

Filename restrictions - https://learn.microsoft.com/en-us/azure/devops/organizations/settings/naming-restrictions?view=azure-devops#area-and-iteration-paths

Remix

Route param - https://remix.run/docs/en/main/file-conventions/routes#dynamic-segments Catch-all - https://remix.run/docs/en/main/file-conventions/routes#splat-routes

NextJS

Route param - https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#convention Catch-all - https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#catch-all-segments

Nuxt

Route param - https://nuxt.com/docs/guide/directory-structure/pages#dynamic-routes Catch-all - https://nuxt.com/docs/guide/directory-structure/pages#catch-all-route

SvelteKit

Route param - https://kit.svelte.dev/docs/routing#other-files Catch-all - https://kit.svelte.dev/docs/advanced-routing#sorting

SolidStart

Route param - https://docs.solidjs.com/solid-start/building-your-application/routing#dynamic-routes Catch-all - https://docs.solidjs.com/solid-start/building-your-application/routing#catch-all-routes

SeanCassiere avatar Jun 12 '24 01:06 SeanCassiere

Thanks for filing this, @Renart-fox.

Having to use $ to prefix parameter names can be a bit of a problem when you're working in the shell on Linux, too.

If you forget to escape the $ in your filenames when creating them, some strange things can happen without any feedback from the shell.

It would be great to be able to use a different character that doesn't need escaping.

njc-pdixon avatar Aug 22 '24 11:08 njc-pdixon

with Virtual File Routes (https://tanstack.com/router/v1/docs/framework/react/guide/virtual-file-routes) you can use arbitrary file names. closing this as a solution is available

schiller-manuel avatar Oct 21 '24 20:10 schiller-manuel