-
-
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
Implement custom client directives #7074
Conversation
🦋 Changeset detectedLatest commit: f2644e9 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 |
This PR is blocked because it contains a |
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.
Blocked because of minor release
The proposal mentions that overriding built-in directives is a non-goal. In the past some people expressed that this would be bad thing if we allowed it. I didn't notice in the code, are we doing anything that prevents someone from, for example, overriding |
Yeah, I added a guard here (beside the experimental check). It probably also goes in hand of whether it should use |
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.
LGTM, @bluwy! 🥳 Just left a possible link you might want to include!
Co-authored-by: Sarah Rainsberger <[email protected]>
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 looks great, awesome work @bluwy! I can't wait to see what the community do with this 😄
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.
Let's ship it! 🚢 Great work! :)
…/withastro/astro into plt-223-custom-client-directives
It's merge day. Thanks everyone who reviewed this. |
Changes
RFC: withastro/roadmap#583
experimental.customClientDirectives
option.astro:config:setup
hookaddClientDirective()
API to add custom client directive.clientDirectives
map deep down toSSRResult
to be rendered an runtime for.astro
files.astro-scripts prebuild
to have special bundling for client directives (tried my best in implementation 😅)Testing
Added e2e tests
Docs
withastro/docs#3241
Also updated the types for
experimental.customClientDirectives
as the docs site will pull this info here. (Link to diff)