nuxt-ui-pro / saas

A SaaS template made with Nuxt UI Pro.
https://saas-template.nuxt.dev
267 stars 58 forks source link

Inconsistent declarations for `defineProps` across the codebase #10

Closed IonianPlayboy closed 9 months ago

IonianPlayboy commented 9 months ago

Describe the issue

I've just noticed that OgImageSaas is declaring its props by passing an object parameter to defineProps: https://github.com/nuxt-ui-pro/saas/blob/0863ec2f0249638e26444c7b855f3c0491693706/components/OgImage/OgImageSaas.vue#L6-L15

Whereas the error page (at the root of the repository is using the type-based declaration: https://github.com/nuxt-ui-pro/saas/blob/0863ec2f0249638e26444c7b855f3c0491693706/error.vue#L10-L12

This is not really an issue to be honest, but it would be nice to provide a consistent code structure across the template.

[!NOTE] I did not took the time to look at every other templates to see if they shared the same inconsistency, but I have seen that the Pro Docs template at least follows the same pattern.

Additional notes

I am willing to make the necessary PRs to enforce consistent defineProps declarations across Nuxt templates, I would just need to know which syntax should be prefered and the repos that would need to be updated.

benjamincanac commented 9 months ago

We recently switched all of the @nuxt/ui-pro components defineProps from type-based to runtime declaration to avoid the need to install TypeScript, you can check the PR here: https://github.com/nuxt/ui-pro/pull/189.

I agree that it would be best to use consistent declaration everywhere! I guess I've missed some like the one you linked.

A PR would be very much welcome to use runtime declaration everywhere 😊