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

fix: add undocumented options in integrations-reference.mdx #10822

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

ArmandPhilippot
Copy link
Member

@ArmandPhilippot ArmandPhilippot commented Jan 28, 2025

I was looking at the Integrations reference page and noticed some formatting issues... Since Florian is about to give a talk on integrations, I figured it was a good time to do a more thorough check instead! Also, I was worried that you would be bored after 5.2. 😄 (no rush, still in draft... it takes more time than expected)

Description (required)

Sorry the description isn't really succinct but I'm trying to keep track of the why and when for each point.

In upgrade-to/v5.mx:

  • Fixes a mismatch between paths in addDevToolbarApp code snippets (the path is not the same as the one used in the code block's title)

In integrations-reference.mdx:

  • Consistent formatting:

    • Updates the Type:/Since block to be consistent with the formatting of API reference
    • Updates the indentation in some code snippets (most of them use 2 spaces)
    • Updates some titles to explicitly show that they are functions (e.g. addMiddleware > addMiddleware())
    • Replaces + with ExpressiveCode notation to highlight added lines in Allow installation with astro add
    • Makes injectRoute and injectTypes consistent with the other options. These were the only objects expanded in the API quick reference, so:
      • it might be better to be consistent with the others
      • since InjectedRoute and InjectedType can be imported, it could be nice to show the types there
      • this reduces the horizontal scroll which might be easier to read on mobile.
  • Existing content:

    • Adds the missing refreshContent, middlewareEntryPoint and pages options in Quick API Reference
    • Adds the missing logger option in the type preview of some hooks
    • Reorders the hooks to match the real order (tested using a custom integration and console.log)
    • Fixes the Previous hook/Next hook links (some was wrong/outdated or the anchor did not match the link)
    • Fixes some types
      • addDevToolbarApp have been updated in the other pages, but not in this one... string was removed in feat(next): TODOs astro#11987)
      • in injectRoute, pattern was displayed twice with a different type (one of them should be prerender)
      • addWatchFile is a function
  • New content:

Remaining questions:

IN PROGRESS:

  • move some types involved in multiple hooks (e.g. IntegrationRouteData) to a separate Utility Types of Options section,
  • handle the IntegrationResolvedRoute issue reported by Fryuni on Discord (horizontal scroll, break up the type)
  • similarly to the IntegrationResolvedRoute type, I figured we could break up the IntegrationRouteData.

TODO:

  • the logger option is used in every hook and this is documented in AstroIntegrationLogger. Perhaps we should find a way to link every hook to this section or another idea, thanks to Florian, would be to move the logger documentation before the hooks. Still hesitant. A link in the Hooks introduction could be enough (ie. a `logger` option is available in all hooks...).
  • some proofreading

Related issues & labels (optional)

  • Suggested label: add new content, consistency/formatting and improve or update documentation

The `string` type was definitely removed in withastro/astro#11987.
Other pages was up-to-date but not the integrations reference.
In overview of the functions available, `injectRoute` and `InjectedType`
was the only ones expanded. It might be better to be consistent with the
others and since `InjectedRoute` and `InjectedType` can be imported, it
could be nice to show the types there.
The other options of this hooks are not documented so I just added
the option in the Quick API Reference and fixed the type in the
`astro:build:ssr` type overview.
Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d33deff
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/679bc432c33a6d000804d98a
😎 Deploy Preview https://deploy-preview-10822--astro-docs-2.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 configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jan 28, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/upgrade-to/v5.mdx Source changed, localizations will be marked as outdated.
en/reference/integrations-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@sarah11918
Copy link
Member

Amazing, thank you so much for this initiative Armand!

As you say, in draft so no rush. But would be great for at least @florian-lefebvre and @Fryuni to have a look over when it's ready before I do!

You could also post this in the #integrations channel in Discord to see whether any of our integrations builders are interested in commenting on this!

@ArmandPhilippot
Copy link
Member Author

Oh definitely! There still some work to do here (mainly document what is not documented) so I'll try to do that with my knowledge but yeah, once done a review from our integrations expert would be much appreciated! 😄

@florian-lefebvre
Copy link
Member

Feel free to ping me once you're ready!

@sarah11918 sarah11918 added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label Jan 30, 2025
I moved some hooks in the page to match the hooks order. I also
fixed some `Next hook`/`Previous hook` which seemed wrong or at
least outdated. Tested with a custom integration and logs.
We usually use `addMiddleware()` instead of `addMiddleware` in headings
when the type is a function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants