8000 feat(astro)!: add getReveal and make the host element internal by morellodev · Pull Request #332 · awesome-reveal/awesome-reveal · GitHub
[go: up one dir, main page]

Skip to content

feat(astro)!: add getReveal and make the host element internal - #332

Merged
morellodev merged 2 commits into
nextfrom
feat/astro-client-control
Oct 21, 2026
Merged

morellodev merged 2 commits into
nextfrom
feat/astro-client-control

Conversation

@morellodev
Copy link
Copy Markdown
Collaborator

Summary

Astro users now control a reveal with when, as React and Vue users do. They do not query the <awesome-reveal> host element. The host is now an internal detail.

import { getReveal } from "@awesome-reveal/astro";

const reveal = getReveal(document.querySelector("#result")!);
reveal.when = false;
reveal.when = true; // plays the entrance again
reveal.when = null; // gives the control back to the viewport
reveal.revealed;
  • getReveal(element) is in the root entry, with no new subpath. Astro 6.0 to 7 replace each .astro import in client code with an empty module, so a client script that imports the root entry bundles no component. I checked this in Astro 6.0.0, 6.4.8 and 7.3.8.
  • The control object has no state of its own. It reads and writes the attributes of the host, so a when set before the custom element upgrades still applies.
  • getReveal accepts only the element that the host animates, and throws for other elements.
  • The contract suite now runs through getReveal, so Astro passes the same checks as React and Vue.
  • The size limit of the client script in dist.test.ts changes from 5150 to 5580 bytes. The host script is smaller (5029 to 4934 bytes). The increase is the new getReveal script of the fixture page (525 bytes), which loads only on pages that use getReveal.
  • The README, the Astro skill, the Astro example and the Astro rule use getReveal.

Follow-up: the website repo uses the host element in its demos and docs. It needs its own PR after a release.

Checklist

  • The PR targets the next branch.
  • The PR title follows Conventional Commits. A breaking change has ! and a BREAKING CHANGE: footer.
  • Tests cover the change.
  • A change to an option, a default or an export also updates the READMEs, the consumer skills and the examples.

BREAKING CHANGE: @awesome-reveal/astro no longer exports the RevealElement type or adds awesome-reveal to the DOM types, and the host element has no public when property. Use getReveal(element).when on the rendered tag.

BREAKING CHANGE: @awesome-reveal/astro no longer exports the RevealElement type or adds awesome-reveal to the DOM types, and the host element has no public when property. Use getReveal(element).when on the rendered tag.
@morellodev
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Oct 21, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T20:09:00.709988Z 84d72a0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: b24bd6e63d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@morellodev
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 84d72a0321

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@morellodev
morellodev merged commit e582aad into next Oct 21, 2026
19 checks passed
@morellodev
morellodev deleted the feat/astro-client-control branch October 21, 2026 20:17
@morellodev morellodev mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0