Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

feat(pages): add validate hook for definePageMeta - #7870

Merged
danielroe merged 9 commits into
mainfrom
feat/validates
Oct 10, 2022
Merged

feat(pages): add validate hook for definePageMeta#7870
danielroe merged 9 commits into
mainfrom
feat/validates

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/nuxt#14024

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This adds validate() function in definePageMeta for easily specifying what valid route options are for a given page. It supports returning an object error format that will then determine the error response on SSR.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroedanielroe added enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Sep 27, 2022
@danielroe
danielroe requested a review from pi0September 27, 2022 15:41
@danielroedanielroe self-assigned this Sep 27, 2022
@codesandbox

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify

netlifyBot commented Sep 27, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit8e3a369
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/634331006a6fd300086ffad5
😎 Deploy Previewhttps://deploy-preview-7870--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment threaddocs/content/migration/7.component-options.md Outdated
Comment threaddocs/content/migration/7.component-options.md
@atinux

Copy link
Copy Markdown
Member

Shall we add also a section after https://v3.nuxtjs.org/getting-started/routing#route-middleware called "Route Validation" and taking the similar content as https://deploy-preview-7870--nuxt3-docs.netlify.app/migration/component-options#validate ?

@danielroe

Copy link
Copy Markdown
MemberAuthor

Great idea!

Comment threaddocs/content/1.getting-started/5.routing.md
Comment threaddocs/content/migration/7.component-options.md
@antfu

Copy link
Copy Markdown
Member

That's awesome, thank you!

@vercel
vercelBot temporarily deployed to Preview October 3, 2022 14:08 Inactive
@danielroedanielroe mentioned this pull request Oct 9, 2022
@danielroe
danielroe merged commit 829a550 into mainOct 10, 2022
@danielroe
danielroe deleted the feat/validates branch October 10, 2022 10:18
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xenhancementNew feature or request🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validate function in definePageMeta

3 participants

@danielroe@atinux@antfu