~/talk

Stop writing your own routes

Talkat vuejs.de Conf 2022 · on Wednesday, 2022-10-05· [vue, typescript]
slides:none on file

Claim: stop hand-writing route arrays and let a generator produce routes, names and param types. Uses a file-system as router tree combined with an unplugin-based plugin for Vite/Rollup/Webpack to generate a TypeScript file that provides typed route params and autocompletion for router.push, <RouterLink> name usage and useRoute generics. Demoed with Vue Router 4.1 and setupLayouts; route types and completions work and stay fast (avoids prior slow conditional-type approach), though regeneration bugs and an optional data‑fetching RFC remain.

AI-written summary · about

  1. 0:00Introduction to routing
  2. 1:00The complexity of routing
  3. 2:33Modern routing concepts
  4. 4:33File-based routing advantages
  5. 7:35Predictable structure
  6. 9:53Type-safe route parameters
  7. 14:01Simplified route management
  8. 15:58Unplugin view router
  9. 17:46Live demo and autocompletion
  10. 24:35Working with typed links
  11. 27:17Behind the generated code
  12. 28:29Customizing routes and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.