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

Improve Astro.slots API #2695

Merged
merged 6 commits into from
Mar 10, 2022
Merged

Improve Astro.slots API #2695

merged 6 commits into from
Mar 10, 2022

Conversation

natemoo-re
Copy link
Member

Changes

  • Improves Astro.slots API to include has() and render() utils.
---
let content;
if (Astro.slots.has("default")) {
  content = await Astro.slots.render("default");
  content = await doSomeCustomTransformation(content);
}
---

<Fragment set:html={content} />

Testing

TBD

Docs

TBD

@changeset-bot
Copy link

changeset-bot bot commented Mar 1, 2022

🦋 Changeset detected

Latest commit: 7545571

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 pkg: astro Related to the core `astro` package (scope) test labels Mar 1, 2022
@natemoo-re natemoo-re force-pushed the feat/astro-slots branch 2 times, most recently from 83f1dd3 to 36d5b97 Compare March 2, 2022 03:37
@natemoo-re natemoo-re changed the base branch from main to next March 2, 2022 03:37
@github-actions github-actions bot added 🚨 action Modifies GitHub Actions and removed test labels Mar 2, 2022
@github-actions github-actions bot added the test label Mar 2, 2022
@natemoo-re natemoo-re self-assigned this Mar 2, 2022
@github-actions github-actions bot removed 🚨 action Modifies GitHub Actions test labels Mar 2, 2022
@natemoo-re natemoo-re marked this pull request as ready for review March 4, 2022 17:21
Base automatically changed from next to main March 9, 2022 21:44
@natemoo-re natemoo-re merged commit ae8d925 into main Mar 10, 2022
@natemoo-re natemoo-re deleted the feat/astro-slots branch March 10, 2022 00:09
This was referenced Mar 10, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* feat: update Astro.slots API

* fix: migrate Markdown to public `Astro.slots.render` API

* chore: update internal AstroGlobal types

* chore: add changeset

* Update clean-bottles-drive.md

* refactor(test): update slot tests to new syntax
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.

None yet

1 participant