Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nuxt): add pages:routerOptions hook #24922

Merged
merged 6 commits into from Jan 18, 2024
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Dec 27, 2023

πŸ”— Linked issue

resolves #24141

❓ 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)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This adds a new hook: pages:routerOptions. It allows modifying the detected app/router.options.ts files from layers, as well as adding new router options (for example, from a module).

If optional: true is set, then this will not force pages integration. (Which is ideal for a custom scroll behaviour, for example.

πŸ“ Checklist

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

@danielroe danielroe self-assigned this Dec 27, 2023
Copy link

stackblitz bot commented Dec 27, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

nuxt-studio bot commented Dec 27, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview 0c3d2a9

@github-actions github-actions bot added the 3.x label Dec 27, 2023
@danielroe danielroe changed the title feat(nuxt): add pages:router-options hook feat(nuxt): add pages:routerOptions hook Dec 27, 2023
@Atinux
Copy link
Member

Atinux commented Dec 27, 2023

/trigger release

Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-24922

@Atinux
Copy link
Member

Atinux commented Dec 27, 2023

/trigger release

Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-24922

@Atinux
Copy link
Member

Atinux commented Dec 27, 2023

/trigger release

Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-24922

@danielroe
Copy link
Member Author

I think we probably do need to keep calling this within the template (or update it manually when watched paths are detected) or we won't have updates when user adds/removes an app/router.options.ts.

Copy link
Member

Atinux commented Dec 29, 2023

Makes sense, reverted :)

@danielroe danielroe merged commit 807ead6 into main Jan 18, 2024
36 checks passed
@danielroe danielroe deleted the feat/router-options-hook branch January 18, 2024 16:06
@github-actions github-actions bot mentioned this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hook to allow module authors to add additional router.options files
2 participants