router icon indicating copy to clipboard operation
router copied to clipboard

chore(playground): upgrade to `script setup` syntax and TypeScript

Open curtgrimes opened this issue 7 months ago • 3 comments

Upgrade the playground package to use the <script setup> syntax and TypeScript. This change makes the playground more consistent with recent Vue.js practices and improves type safety.

Keep the purpose of each example identical to the original examples as much as possible. Therefore, components using beforeRouteEnter(), which does not have a <script setup> equivalent, are not converted to <script setup> syntax but are only converted to use TypeScript for improved type safety (Home.vue and ComponentWithData.vue). Converting these to use the recommended data loaders or defineMacro() could be an option in the future.

Update RouteNamedMap in main.ts to improve type safety and better demonstrate the newer typed routes feature (introduced in [email protected]) in LongView.vue, Nested.vue, and RepeatedParams.vue.

Fix type issue in AppLink.vue where RouterLinkProps replaces RouterLink.props.

Remove the name option from the defineComponent calls that used it, because this option is only useful when the component recursively calls itself, but there are not components in this playground project that do so.

curtgrimes avatar Apr 14 '25 05:04 curtgrimes

Deploy Preview for vue-router canceled.

Name Link
Latest commit 04d35ebb469164987df352a8c27ce19690e6b2f2
Latest deploy log https://app.netlify.com/sites/vue-router/deploys/67fc9b9e7fcadd0008089c6a

netlify[bot] avatar Apr 14 '25 05:04 netlify[bot]

Thanks for this, it's a long overdue! I have quite a few other things to cover before this so it will most definitely take me a few months before merging it

posva avatar Jun 04 '25 11:06 posva

Sounds good! Thank you for the update.

curtgrimes avatar Jun 04 '25 12:06 curtgrimes