-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(assets): Missing styles in Cloudflare + MDX #15696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
08849d4
fix(assets): Missing styles in Cloudflare + MDX
Princesseuh 5e57831
test: add tests
Princesseuh 37eb270
Merge branch 'main' into fix/cf-mdx-images
Princesseuh c4a3009
chore: changeset
Princesseuh f3dc8a5
fix: udpate tailwind test
Princesseuh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@astrojs/cloudflare': patch | ||
| --- | ||
|
|
||
| Fixes duplicate logging showing up in some cases when prerendering pages |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'astro': patch | ||
| --- | ||
|
|
||
| Fixes images not working in MDX when using the Cloudflare adapter in certain cases |
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
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
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
2 changes: 2 additions & 0 deletions
2
packages/integrations/cloudflare/test/fixtures/prerender-styles/astro.config.mjs
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
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
13 changes: 13 additions & 0 deletions
13
...es/integrations/cloudflare/test/fixtures/prerender-styles/src/components/StyledCard.astro
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| --- | ||
|
|
||
| <div class="mdx-styled-card"> | ||
| <slot /> | ||
| </div> | ||
|
|
||
| <style> | ||
| .mdx-styled-card { | ||
| border: 2px solid rebeccapurple; | ||
| padding: 1rem; | ||
| } | ||
| </style> |
11 changes: 11 additions & 0 deletions
11
packages/integrations/cloudflare/test/fixtures/prerender-styles/src/content.config.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { defineCollection, z } from 'astro:content'; | ||
| import { glob } from 'astro/loaders'; | ||
|
|
||
| const posts = defineCollection({ | ||
| loader: glob({ pattern: '**/*.mdx', base: './src/content/posts' }), | ||
| schema: z.object({ | ||
| title: z.string(), | ||
| }), | ||
| }); | ||
|
|
||
| export const collections = { posts }; |
7 changes: 7 additions & 0 deletions
7
...grations/cloudflare/test/fixtures/prerender-styles/src/content/posts/styled.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: Styled Post | ||
| --- | ||
|
|
||
| import StyledCard from '../../components/StyledCard.astro'; | ||
|
|
||
| <StyledCard>Hello from MDX</StyledCard> |
27 changes: 27 additions & 0 deletions
27
packages/integrations/cloudflare/test/fixtures/prerender-styles/src/pages/posts/[slug].astro
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| import { getEntry, render } from 'astro:content'; | ||
|
|
||
| export const prerender = true; | ||
|
|
||
| export async function getStaticPaths() { | ||
| const { getCollection } = await import('astro:content'); | ||
| const posts = await getCollection('posts'); | ||
| return posts.map((post) => ({ | ||
| params: { slug: post.id }, | ||
| props: { post }, | ||
| })); | ||
| } | ||
|
|
||
| const { post } = Astro.props; | ||
| const { Content } = await render(post); | ||
| --- | ||
|
|
||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <title>{post.data.title}</title> | ||
| </head> | ||
| <body> | ||
| <Content /> | ||
| </body> | ||
| </html> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prerenderer server is extremely spammy during the build, it didn't feel intentional?