Use datocms astro structured text instead of own structured text component#335
Open
JopMolenaar wants to merge 18 commits intomainfrom
Open
Use datocms astro structured text instead of own structured text component#335JopMolenaar wants to merge 18 commits intomainfrom
JopMolenaar wants to merge 18 commits intomainfrom
Conversation
7c8b6f5 to
ad393eb
Compare
Deploying head-start with
|
| Latest commit: |
efff68d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4136403a.head-start.pages.dev |
| Branch Preview URL: | https://feat-use-datocms-astro-compo.head-start.pages.dev |
bae5999 to
38dc91a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the project’s Structured Text and image rendering to the official @datocms/astro components, removing the custom StructuredText implementation and updating blocks/docs accordingly.
Changes:
- Replaced the custom StructuredText renderer with a new
src/components/Text/Text.astrowrapper around@datocms/astro/StructuredText, including node overrides and record/block mappings. - Updated the Image block to use
@datocms/astro’s Image component and adjusted GraphQL fragments/tests for the new data shape. - Removed the legacy
src/components/StructuredText/*implementation and updated usage/docs across blocks.
Reviewed changes
Copilot reviewed 33 out of 37 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/Text/Text.test.ts | Updates the tested component import for the new Text wrapper. |
| src/components/Text/Text.astro | New Structured Text wrapper using @datocms/astro/StructuredText with overrides/mappings. |
| src/components/Text/README.md | Documents new Text/StructuredText usage and override behavior. |
| src/components/Text/nodes/Paragraph.astro | Adds paragraph override with centered styling support. |
| src/components/Text/nodes/ItemLink.astro | Aligns item-link rendering with record-based props. |
| src/components/Text/nodes/Heading.astro | Keeps heading behavior while enforcing h2+ levels. |
| src/components/Text/nodes/Code.astro | Updates code rendering to a safer <pre><code> output. |
| src/components/Text/nodes/Block.astro | Adds block renderer to route structured-text blocks through ~/blocks/Blocks.astro. |
| src/components/StructuredText/StructuredText.d.ts | Removes legacy StructuredText typing helper. |
| src/components/StructuredText/StructuredText.astro | Removes legacy StructuredText component implementation. |
| src/components/StructuredText/README.md | Removes legacy StructuredText documentation. |
| src/components/StructuredText/Nodes/ThematicBreak.astro | Removes legacy node component. |
| src/components/StructuredText/Nodes/Span.astro | Removes legacy node component. |
| src/components/StructuredText/Nodes/Root.astro | Removes legacy node component. |
| src/components/StructuredText/Nodes/ListItem.astro | Removes legacy node component. |
| src/components/StructuredText/Nodes/List.astro | Removes legacy node component. |
| src/components/StructuredText/Nodes/Link.test.ts | Removes legacy Link node test. |
| src/components/StructuredText/Nodes/Link.astro | Removes legacy Link node component. |
| src/components/StructuredText/Nodes/InlineBlock.astro | Removes legacy inline block node component. |
| src/components/StructuredText/Nodes/Blockquote.astro | Removes legacy node component. |
| src/components/StructuredText/Node.astro | Removes legacy recursive node renderer. |
| src/components/LinkToRecord/LinkToRecord.astro | Extends record linking to support VariableRecord rendering. |
| src/blocks/TextImageBlock/TextImageBlock.astro | Switches to shared ~/components/Text/Text.astro. |
| src/blocks/TextBlock/TextBlock.astro | Switches to shared ~/components/Text/Text.astro. |
| src/blocks/TextBlock/Text.astro | Removes legacy shared TextBlock StructuredText adapter. |
| src/blocks/TextBlock/README.md | Updates docs to reflect the moved Text logic. |
| src/blocks/TextBlock/nodes/InlineItem.astro | Removes legacy inline item renderer (variable/link handling). |
| src/blocks/TextBlock/nodes/Heading.astro | Removes legacy heading override implementation. |
| src/blocks/ListBlock/ListBlockFragment.graphql | Adds links selection for list-item structured text. |
| src/blocks/ListBlock/ListBlock.astro | Switches to shared ~/components/Text/Text.astro. |
| src/blocks/ImageBlock/README.md | Updates docs to reference DatoCMS Astro image handling. |
| src/blocks/ImageBlock/ImageBlock.test.ts | Updates expectations for the new image output/styling behavior. |
| src/blocks/ImageBlock/ImageBlock.fragment.graphql | Adds srcSet to the image responsive payload. |
| src/blocks/ImageBlock/Image.client.ts | Removes custom element behavior previously used for load handling. |
| src/blocks/ImageBlock/Image.astro | Migrates image rendering to @datocms/astro Image and updates fallback styling. |
| package.json | Adds @datocms/astro dependency. |
| package-lock.json | Locks @datocms/astro and transitive dependencies. |
Comments suppressed due to low confidence (1)
src/components/Text/Text.test.ts:6
Text.astroexpects adataprop, but this test renders the component without providing any props. That will passundefinedinto@datocms/astro’sStructuredTextand is likely to throw at runtime, causing the test to fail. Pass a minimal valid Structured Text value inrenderToFragmentoptions (or updateText.astroto safely handle missing/nulldata).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a3c1884 to
025863a
Compare
…ify translation string
025863a to
3223e9e
Compare
milailijevic
requested changes
Apr 17, 2026
milailijevic
requested changes
Apr 24, 2026
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.
Changes
Use datocms astro components instead of own components
Associated issue
Resolves #333
How to test
Checklist