-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Custom Client Directives #3241
Comments
Thanks for this, @bluwy ! Initial questions:
Those are the initial things I'm thinking about here! |
@sarah11918 we are not including any custom directives with this release (correct me if I'm wrong @bluwy). So this is a bit tricky right now as the end-user has to enable a flag and install some packages, but those packages do not exist yet. Maybe it makes sense to focus the documentation on the audience of people who want to build custom directives? This is most similar to our concept of framework renderers. The audience for someone building their own renderer is different from the audience that wants to use a renderer built by someone else. |
@matthewp Yup, I gathered that! My thinking is someone on the reference page reading about Template Directives gets a link to know that there's a place they can read about creating their own custom directives, then the package README is as technical as you want for builders. But, at least this way someone looking up the references in docs can see that there's a(n experimental) way to build one themselves. |
Side question, would it be helpful to have an example in the |
Examples are always helpful! But I absolutely think documentation is enough for this release. |
Yeah there will be no new directives and package/integrations added in this feature. What we do allow is new kinds of integrations that add custom client directives, which the user has to also opt-in with an experimental flag (to show they know what they're getting into). |
Yup, so to be clear, what I'm expecting is:
I'll happily review and edit all of these, so just look at existing examples and write what you feel makes sense! |
Re no1, there's no new package or integrations introduced for this feature, so I'm a bit confused. We're only introducing the Re no2, that makes sense to me (besides the |
@bluwy Ah, I was going off of Matthew's comment that some packages would need to be installed AND a user flag. I thought the user would have to install a package in order to write custom directives. But, I think the packages referred to are the new (not yet existing?) custom directives? So, you'd install each new directive you wanted that Astro has created, in addition to being able to write your own? If yes, then I agree with you! So:
|
Yes 👍 the packages we're referring to are future third-party packages/integrations that would use the new But of course the users can also create their own directive integration locally too, similarly to the usual local integration workflow (My PR has a test setup example). Hope that clears things up! I agree with your 3 points too. I'll make sure my core PR gets no1 ready too. |
Yup, perfect, thanks @bluwy! |
Summary
Support custom
client:
directives that can be added by integrations. Enabled withexperimental.customClientDirectives
optionTodoc
experimental.customClientDirectives
optionastro:config:setup
addClientDirective()
APIclient:
in.astro
filesThe text was updated successfully, but these errors were encountered: