victorgarciaesgi / nuxt-typed-router

🚦Provide autocompletion and typecheck to Nuxt router
https://nuxt-typed-router.vercel.app
MIT License
362 stars 12 forks source link

Bug: Incompatibility with turborepo caching system #131

Closed malkhuzayyim closed 11 months ago

malkhuzayyim commented 11 months ago

Hi Victor. Awesome plugin you got here, loving how useful it is.

Describe the bug Turbo repo relies on input/output hashes of files to properly cache tasks

I was trying to cache my nuxt prepare task but it was always missing the cache, upon further investigation I realized it's due to how nuxt-typed-router generates it's type signatures.

You append a random suffix to type signature names for some reason (might be a good one, idk), to route validations type signatures. Which changes everytime the nuxt prepare task runs.

Expected behavior

The output should be always consistent (reliably the same) if the inputs did not change.

Screenshots

image

Environnement infos


Your pages folder structure N/A

Your nuxt.config.ts N/A

Current Workaround

To ignore the file using "!__paths.d.ts" in the turbo outputs of nuxt:prepare

victorgarciaesgi commented 11 months ago

Hi @malkhuzayyim thanks 😇

Ok weird at my company we use turbo too but never noticed this, but that could be a great thing to improve. It's generated IDs because there is a lot a variables to create for each route, but I think it could be cached with a random seed for each route, i'll look at this monday

victorgarciaesgi commented 11 months ago

Fixed in v3.5.0

victorgarciaesgi commented 11 months ago

@malkhuzayyim Did you see any improvement one your side? On our monorepo with the update I didn't see any improvements :(

Before:

image

After:

image