Skip to content

Conversation

@ArmandPhilippot
Copy link
Member

@ArmandPhilippot ArmandPhilippot commented Nov 5, 2025

Description (required)

  • Adds some missing <Since />.
  • Adds missing info for createExports(): a second argument exists to retrieve data from setAdapter().
  • Adds docs for the missing astro/app APIs: app.getAllowedDomains(), app.removeBase(), app.setCookieHeaders()
  • Fixes app.match() type: a second argument exists.
  • Moves envGetSecret from "Adapter features" to "Astro features".
  • Moves "Allow installation via astro add" to the end... not sure what is the best place for this.
  • Replaces the types code block from Building an adapter with proper documentation.
  • Rewords the "Server entrypoint" heading and turns it into h2.
  • Replaces Exports > createExports() and Start > start() in "Build a server entrypoint" with some explanations about their shape.
See the relevant links to check types/default/since:

astro/app public APIs (only the missing ones):

Room for improvement: except for envGetSecret that was already documented, the Astro features section is pretty succinct. I'm not sure how these features can/should be used, so I have not developed them.

Not documented
  • app.setManifestData is publicly available when creating a new App (astro/app) but I couldn't find an usage in the source code so I wonder if this is a leftover that should be removed or something like that.

Related issues & labels (optional)

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

@ArmandPhilippot ArmandPhilippot added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. labels Nov 5, 2025
@netlify
Copy link

netlify bot commented Nov 5, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit af91d94
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6914a29f35bfc10008fb2966
😎 Deploy Preview https://deploy-preview-12673--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 project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Nov 5, 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/reference/adapter-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.

@ArmandPhilippot ArmandPhilippot marked this pull request as ready for review November 6, 2025 16:53
ArmandPhilippot and others added 2 commits November 7, 2025 12:06
Co-authored-by: Matt Kane <m@mk.gg>
Co-authored-by: Matt Kane <m@mk.gg>
Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I always found our Adapter API docs a bit weak compared to the Integration API ones, love it!

ArmandPhilippot and others added 4 commits November 7, 2025 14:22
Co-authored-by: Matt Kane <m@mk.gg>

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@sarah11918
Copy link
Member

I think everyone has done some amazing work supporting @ArmandPhilippot 's efforts! Only two points where I feel we really need to do a tiny bit better (called in both Matt and Florian to help), and once those feel good, this puppy LGTM!

@ArmandPhilippot
Copy link
Member Author

Thanks everyone for the really helpful feedbacks! ❤️

I added a new astro/app/node section with the methods overridden by this module and the additional ones.

While doing so, I noticed we document the methods available from App once created (ie. const app = new App()), not the static methods. Should we? I noticed:

  • App.getSetCookieFromResponse()
  • App.validateForwardedHost()

We also have some static methods for NodeApp:

  • NodeApp.createRequest()
  • NodeApp.writeResponse()

I'm not quite sure how to make the distinction between the static methods and the others with the current structure.

Since info:

@sarah11918
Copy link
Member

@florian-lefebvre Are you available to give feedback on Armand's latest commit and questions?

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@florian-lefebvre
Copy link
Member

florian-lefebvre commented Nov 10, 2025

I think we should document static methods as well, they are useful. It's fine to document these alongside the standard methods and just say they're static with a code example. For example usage of the node app specific static methods, I think this file is pretty good: https://github.com/withastro/astro/blob/5dbd59bdced080e3a9ae95ad91bbe737a2e3ba55/packages/integrations/node/src/serve-app.ts

@ArmandPhilippot
Copy link
Member Author

Thanks, I just pushed a new commit to document them. Please check the accuracy because I'm not really sure how this can be used (e.g. I wrap validateForwardedHost in a start function to justify where allowedDomains comes from... but should this be used here?).

I added static method each time for people reading the example too quickly as additional clue.

And, if anyone want to check the versions:

@florian-lefebvre
Copy link
Member

New static methods were just added to address a CVE FYI withastro/astro#14743

@ArmandPhilippot
Copy link
Member Author

Oh thanks! I wouldn't have thought to check the latest version... I'll add them to the docs tomorrow!

ArmandPhilippot and others added 2 commits November 11, 2025 12:28
Co-authored-by: Matt Kane <m@mk.gg>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Armand! Just noting that when you're happy, I'm happy! (You can also request a Yan final boss review at any time!)

@ArmandPhilippot
Copy link
Member Author

Thanks! And yeah, I'm glad we now have all those public APIs documented! But I must say, I didn't expected that when I started:
astro-adapter-diff
😅

And yes, a review from @yanthomasdev is always useful, if you have any spare time! 😄

Same for Florian or Matt, if you have time to check the accuracy of the new entries it would be helpful.
(No rush of course!)

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! I think the the app methods could use more concrete examples perhaps (or maybe that'd belong to a guide, idk) but not blocking at all! This PR is big enough already, thanks a lot!

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, here's my final boss

ArmandPhilippot and others added 2 commits November 12, 2025 16:06
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
@ArmandPhilippot
Copy link
Member Author

I agree with Florian, some examples could probably be improved, but without building an adapter to determine what constitutes a useful minimal code snippet, it's a bit difficult (for me) to trim what is necessary or not in the current adapters. Showing too much/too specific code could also be confusing for users I think.

At least the docs are now a bit more detailed for those who wish to build their own adapter! So, this is NWTWWHB and we can always improve the code snippets later if/when we get feedbacks.

I think this looks ready to be merged! Thank you all again for your help!

@ArmandPhilippot ArmandPhilippot merged commit 8e2d055 into withastro:main Nov 12, 2025
10 checks passed
@ArmandPhilippot ArmandPhilippot deleted the refactor/adapter-reference branch November 12, 2025 16:55
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Nov 13, 2025
ArmandPhilippot added a commit to ArmandPhilippot/astro-docs that referenced this pull request Nov 13, 2025
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. consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants