Skip to content
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

Fix: component styles within imported markdown files #3116

Merged
merged 14 commits into from
Apr 18, 2022

Conversation

bholmesdev
Copy link
Contributor

Changes

Testing

TODO

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Apr 14, 2022

🦋 Changeset detected

Latest commit: 09a3992

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Apr 14, 2022
@bholmesdev
Copy link
Contributor Author

Update: this PR doesn't fix production builds!

This specifically has to do with our deferred markdown load. The change in the PR is necessary for this to work at all. But by replacing async function load() to pull in a static ESM import instead of an async import, it works. We don't want to introduce eager loading of markdown just for style processing, but it makes our CSS crawling logic out-of-sync.

The sequence is this:
load page -> crawl CSS -> deferred markdown load
But we want:
load page -> deferred markdown load -> crawl CSS

@bholmesdev bholmesdev marked this pull request as draft April 14, 2022 22:14
@github-actions github-actions bot added the pkg: example Related to an example package (scope) label Apr 15, 2022
@github-actions github-actions bot removed the pkg: example Related to an example package (scope) label Apr 15, 2022
@bholmesdev bholmesdev marked this pull request as ready for review April 15, 2022 15:49
Copy link
Member

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

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

LGTM if you can get tests passing

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM!

@matthewp
Copy link
Contributor

lgtm

@bholmesdev bholmesdev merged commit 44bacd2 into main Apr 18, 2022
@bholmesdev bholmesdev deleted the fix/markdown-glob-styles branch April 18, 2022 19:44
@github-actions github-actions bot mentioned this pull request Apr 18, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* fix: replace markdown path prefix with suffix flag

* fix: avoid non-encoded colons for flag

* fix: remove needless ?

* fix: dev server load order

* fix: production build crawl dynamic imports

* fix: remove  unused virtual_module_id const

* fix: remove unsafe "!" on getmodbyid

* fix: remove needless @id path check

* fix: add list of SSR-able file extensions

* docs: virtual_mod_id change

* fix: support id prefix on resolved ids

* fix: switch to ?mdImport flag to resolve glob imports

* tests: imported md styles for dev and build

* chore: changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Markdown-imported component styles do not get applied when Astro.glob().Content is used
4 participants