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
Markdoc - remove $entry
variable
#7244
Conversation
🦋 Changeset detectedLatest commit: 85fb722 The changes in this PR will be included in the next version bump. 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 |
/** | ||
* There are two content collection plugins that depend on the same entry data: | ||
* - `astro:content-imports` - creates module containing the `getCollection()` result. | ||
* - `astro:content-render-imports` - creates module containing the `collectionEntry.render()` result. | ||
* | ||
* We could run the same transforms to generate the slug and parsed data in each plugin, | ||
* though this would run the user's collection schema _twice_ for each entry. | ||
* | ||
* Instead, we've implemented a cache for all content entry data. To avoid race conditions, | ||
* this may store either the module itself or a queue of promises awaiting this module. | ||
* See the implementations of `getContentEntryModuleFromCache` and `setContentEntryModuleCache`. | ||
*/ |
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.
Bye bye big comment 👋
throw new MarkdocError({ | ||
message: [ | ||
`**${String(entry.collection)} → ${String(entry.id)}** contains invalid content:`, |
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 parsed collection and id are no longer passed. For simplicity, just log the file path
6d40c93
to
85fb722
Compare
Changes
$entry
variable for Markdoc entries. This introduced a complex caching layer, leading to complex code comments and race conditions in CI during production builds.getRenderModule()
API with additional props to expose debugging information to Markdoc (relied on the "entry" variable for these earlier)getContentEntryModule()
andgetDataEntryModule()
to align on shared logicTesting
entry-prop.test.js
to a genericvariables
testDocs