Skip to content

Fix TS errors and replace getAdapterLogger in modules/astro-app#14275

Merged
ArmandPhilippot merged 4 commits into
mainfrom
armand/fix-astro-app-code-snippets
Jul 21, 2026
Merged

Fix TS errors and replace getAdapterLogger in modules/astro-app#14275
ArmandPhilippot merged 4 commits into
mainfrom
armand/fix-astro-app-code-snippets

Conversation

@ArmandPhilippot

@ArmandPhilippot ArmandPhilippot commented Jul 17, 2026

Copy link
Copy Markdown
Member

Description (required)

Follow-up of #14089. TL;DR: Improve UX by preventing the appearance of red squiggles (TS) and visual changes (formatting with Astro extension) when the user copies and pastes a code snippet.

Formats and fixes code snippets in modules/astro-app.mdx:

  • createApp(): useless import and we have the following error Property 'respondWith' does not exist on type 'Event'.ts(2339)... The fix I'm suggesting is only available when setting webworker in compilerOptions.lib but I guess this is expected: on MDN, they say that "This feature is only available in Service Workers."
  • We have a bunch of very short code snippets like app.render()... those can be confusing for users (e.g. where does request comes from). I tried to integrate them into a complete example (not an adapter expert though...). And I converted them as TypeScript examples: I believe it's easier to remove the types rather than wasting time to find them.
  • app.getAdapterLogger(): doesn't exist. It was removed in 6.3.0 with experimental advanced routing. But, we have app.adapterLogger (a getter) since 6.2.0. So, I updated the heading, the signature, <Since />, and the code snippet.

References

@ArmandPhilippot ArmandPhilippot added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) code snippet update Updates a code sample: typo, outdated code etc. labels Jul 17, 2026
@astrobot-houston

astrobot-houston commented Jul 17, 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/modules/astro-app.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.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@ArmandPhilippot
ArmandPhilippot marked this pull request as ready for review July 17, 2026 16:39
@ArmandPhilippot ArmandPhilippot changed the title Fix TypeScript errors in modules/astro-app code snippets Fix TS errors and replace getAdapterLogger in modules/astro-app Jul 17, 2026

@yanthomasdev yanthomasdev 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.

LGTM! Good work!

@ArmandPhilippot
ArmandPhilippot merged commit 0bdebeb into main Jul 21, 2026
9 checks passed
@ArmandPhilippot
ArmandPhilippot deleted the armand/fix-astro-app-code-snippets branch July 21, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code snippet update Updates a code sample: typo, outdated code 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.

3 participants