-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add astro/types
for common prop patterns
#5147
Conversation
🦋 Changeset detectedLatest commit: ce62ad0 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 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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
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.
Non-blocking comment about the shape of things, but otherwise this is absolutely wonderful and everything I have ever wished for, awesome work!
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.
Have a few thoughts on naming and documentation. But HTMLAttributes
feels fundelement
al to good Astro components 👏
astro/type-utils
for common prop patternsastro/types
for common prop patterns
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.
This is excellent! Will be able to clean up the @astrojs/image
components too, they're doing a bit of a dance to add typings when extending <img>
and <picture>
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.
That's my type
of change!
Changes
astro/types
entrypoint with some helpful utility types.astroHTML.JSX.AnchorHTMLAttributes
stuff directlyHTMLAttributes
If you would like to extend valid HTML attributes for a given HTML element, you may use the provided
HTMLAttributes
type—it accepts an element name and returns the valid HTML attributes for that element name.Testing
Tested manually
Docs
withastro/docs#1857