Skip to content

Expose getFetchState function#14021

Open
matthewp wants to merge 4 commits into
v7from
docs/expose-get-fetch-state
Open

Expose getFetchState function#14021
matthewp wants to merge 4 commits into
v7from
docs/expose-get-fetch-state

Conversation

@matthewp

@matthewp matthewp commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description (required)

astro/hono module has a getFetchState now that lets you grab the FetchState object from the HonoContext. This documents it.

Related issues & labels (optional)

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit ae6f21b
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6a2724898254fa000898bae2
😎 Deploy Preview https://deploy-preview-14021--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Jun 8, 2026
@astrobot-houston

astrobot-houston commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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/experimental-flags/advanced-routing.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.

@matthewp matthewp force-pushed the docs/expose-get-fetch-state branch from bcf83dd to a71e7ff Compare June 8, 2026 16:55
@matthewp matthewp changed the title Docs/expose get fetch state Expose getFetchState function Jun 8, 2026
@matthewp matthewp marked this pull request as ready for review June 8, 2026 17:14

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A nit for consistency, but LGTM!

I couldn't check the preview though... Maybe a GitHub outage preventing the Netlify comment to update.

Comment thread src/content/docs/en/reference/experimental-flags/advanced-routing.mdx Outdated
@ArmandPhilippot ArmandPhilippot added merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) 7.0 and removed i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! labels Jun 8, 2026
@ArmandPhilippot ArmandPhilippot added this to the v7 milestone Jun 8, 2026
matthewp and others added 2 commits June 8, 2026 16:22
…ing.mdx

Co-authored-by: Armand Philippot <git@armand.philippot.eu>
…ing.mdx

Co-authored-by: Armand Philippot <git@armand.philippot.eu>

Use `getFetchState()` when writing custom Hono middleware that needs to read or modify Astro's per-request state (e.g. `locals`, `cookies`, `routeData`):

```ts title="src/app.ts"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might want to use the default filename here:

Suggested change
```ts title="src/app.ts"
```ts title="src/fetch.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.0 merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants