Replies: 3 comments 3 replies
-
I appreciate the initiative and concern! Thank you The technical background is unfortunately more complex than it seems, making some of the proposals you make not possible or create other undesirable managing issues. It's hard and quite time consuming to correctly explain all these difference so sorry in advance by not covering all points 😓 vite plugin pages has a broader scope than this plugin and is therefore limited by it. The page extensions possibilities present in this lib cannot always be applied outside of vue-router and much further than a simple This plugin is not only about the typed routes, it's about what I have in mind for the future of Vue Router and file-based routing plays a big role but still allows people to not use it. In fact, file based routing is an opt-in. Typed routes are part part of it though, as discussed in #127.
What do you mean? Do you have a practical example?
An example would help for this too.
IIRC the library was missing handling new vue-router routes structures used by unplugin-vue-router, which is why it might not always work.
This is interesting. It could surprise you from time to time with wrong types if unplugin-vue-router is not in control of the route generation though Regarding your advantages:
|
Beta Was this translation helpful? Give feedback.
-
Hey @posva! First of all, sorry for taking so long to reply (been really busy with exams, so I stepped down quite a lot my GH activity I wasn't looking for a technical explanation either, so don't worry about it! Given that I had a fairly good type support already with a combination of both plugins, just wanted to showcase all of these points, just in case you didn't take them into consideration when starting the project.
If you don't mind, I'm going to retry doing a full migration to unplugin-vue-router again once I have some spare time (since I tried I few versions ago, I guess a lot of things have been ironed out) and, if I face any of the issues with the imports or layouts, I will open a relevant issue, so we don't mix things up and we keep everything in scope here👍.
What I basically did is to match the route name generation, so both plugins generated the same route names. At least for what I use it for, it works fine for me. Once I fully switch to unplugin-vue-router, maybe I discover I'm missing so much! I only have a simple suggestion for the future to simplify the integration even more (in case it's possible): drop the /auto suffix and augment/override when possible. I'm not a bundler plugin developer, but maybe rollup's virtual imports might be useful to override them (for vite/rollup setups of course)? Thank you very much for all the work you do in the vue-router ecosystem. |
Beta Was this translation helpful? Give feedback.
-
I'm running into a similar issue. The strange thing is that it works fine in my .ts files but complains that the import doesn't exists when used inside the script setup lang="ts" block. |
Beta Was this translation helpful? Give feedback.
-
Hello. I'm opening this with the aim to help in shaping unplugin-vue-router and the ecosystem around vue-router, gathering feedback from other as well as @posva. I love this plugin, makes working with vue-router much nicer, and I'm very grateful for all the work all contributors poured into it. However, in my opinion, the scope/direction it has it's not the most suitable one, so I'd like to propose an shift, which hopefully simplifies development and gets this plugin out of the experimental stage earlier.
To briefly sum up my proposal: unplugin-vue-router should focus solely on type definitions generation
Key reasons:
*
vue-router/auto
andeslint-plugin-imports
not recognising it as valid imports.* Layouts generated by using
vite-plugin-layouts
However, type generation have been always working wonderfully.
Advantages:
Thank you very much in advance.
Beta Was this translation helpful? Give feedback.
All reactions