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

docs(plugins): add runtime hooks section #1521

Merged
merged 6 commits into from
Aug 6, 2023
Merged

docs(plugins): add runtime hooks section #1521

merged 6 commits into from
Aug 6, 2023

Conversation

gnoeley
Copy link
Contributor

@gnoeley gnoeley commented Aug 2, 2023

πŸ”— Linked issue

#1301

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 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

Attempt to more explicitly outline the available hooks and their usage for Nitro server. This could help support the addition of more hooks in the linked issue.

  • Introduce new guide section for hooks, including examples with hook callback argument types.
  • Move hooks examples from Guides/Plugins into Guides/Hooks.
  • Add Hook documentation for new on/before/after request hooks.

πŸ“ Checklist

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

@nuxt-studio
Copy link
Contributor

nuxt-studio bot commented Aug 2, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
nitro Edit on Studio β†—οΈŽ View Live Preview 20d8aae

- Introduce new guide section for hooks, including examples with hook callback
argument types.
- Move hooks examples from Guides/Plugins into Guides/Hooks.
- Add Hook documentation for new on/before/after request hooks.
@pi0 pi0 added the documentation Improvements or additions to documentation label Aug 6, 2023
@pi0 pi0 changed the title feat: add hooks guide documentation docs(plugins): improve hooks section Aug 6, 2023
@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Merging #1521 (dcac214) into main (451d314) will increase coverage by 0.03%.
Report is 12 commits behind head on main.
The diff coverage is n/a.

❗ Current head dcac214 differs from pull request most recent head 20d8aae. Consider uploading reports for the commit 20d8aae to get more accurate results

@@            Coverage Diff             @@
##             main    #1521      +/-   ##
==========================================
+ Coverage   76.25%   76.28%   +0.03%     
==========================================
  Files          73       73              
  Lines        7478     7540      +62     
  Branches      734      739       +5     
==========================================
+ Hits         5702     5752      +50     
- Misses       1775     1787      +12     
  Partials        1        1              

see 3 files with indirect coverage changes

@pi0 pi0 marked this pull request as ready for review August 6, 2023 21:03
@pi0
Copy link
Member

pi0 commented Aug 6, 2023

Thanks for helping on this @gnoeley <3 In the meantime, I think it makes more sense to keep runtime hooks section under the plugins because that's how mainly they should be registered and used. I have made few changes to merge, added link and list of available routes an additional example for error.

When adding two new (upcoming) hooks for global request, after-reponse, i will extend your current work on new section (therefore merging your PR sooner to iterate. You are more than welcome to open more to improve.)

@pi0 pi0 changed the title docs(plugins): improve hooks section docs(plugins): add hooks section Aug 6, 2023
@pi0 pi0 changed the title docs(plugins): add hooks section docs(plugins): add runtime hooks section Aug 6, 2023
@pi0 pi0 merged commit 428f8b2 into nitrojs:main Aug 6, 2023
5 checks passed
@gnoeley
Copy link
Contributor Author

gnoeley commented Aug 7, 2023

Looks great, agree with your decisions on the changes. Will raise more in the future if I spot gaps and think I can help.

@pi0
Copy link
Member

pi0 commented Aug 7, 2023

Looking forward to more! BTW for your info: #1545

@pi0 pi0 mentioned this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants