Fix code snippets in integrations guides - #14481
Open
ArmandPhilippot wants to merge 8 commits into
Open
Conversation
Contributor
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Preview deployment ✅ Deployment complete!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
integrations-guide/cloudflare.mdx:.jsfile, we can't use: any. And, we usually prefix the title withsrc/.integrations-guide/markdoc.mdx:.astrosnippets:entrycan beundefined(once collection types are generated) and can't be used directly inrender().srcisImageMetadata | string, we need the sametypeof src === "string"check as in "Override Markdoc’s default image node".integrations-guide/mdx.mdx:postis implicitlyany. We need to add a type for it.componentsto MDX content":entrycan beundefined(once collection types are generated) and can't be used directly inrender()extendMarkdownConfig: missing fake importsignoreElementNames: missing code snippet title, and we usually show components undersrc/componentsintegrations-guide/partytown.mdx, both in "Proxying requests":create-astro, the config file contains@ts-check. TypeScript complains aboutproxyMap[url.hostname]. And, because this is not a TS file, we can't use types. I see two options:Mapinstead of an object. Given browsers support, I don't think usingMapis an issue. (my choice)References