Skip to content

Comments

Document how to extend integration hooks#8701

Merged
sarah11918 merged 11 commits into4.12.0from
fryuni/extendable-integration-hooks
Jul 14, 2024
Merged

Document how to extend integration hooks#8701
sarah11918 merged 11 commits into4.12.0from
fryuni/extendable-integration-hooks

Conversation

@Fryuni
Copy link
Member

@Fryuni Fryuni commented Jun 28, 2024

Description

@Fryuni Fryuni self-assigned this Jun 28, 2024
@vercel

This comment was marked as outdated.

@Fryuni Fryuni added the minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! label Jun 28, 2024
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jun 28, 2024

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en reference/integrations-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@Fryuni Fryuni requested a review from sarah11918 June 28, 2024 06:01
@sarah11918 sarah11918 added add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) labels Jun 28, 2024
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Luiz! Left some notes.


```ts
// your-integration/index.ts
import './types.ts';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realised we kind of skim over this import. Maybe should be mentioned in the introduction that this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit complicated. It is not required at all; you just have to have some way for the consumer integration to load the type augmentation from the provider integration, and this makes it the most intuitive (by just importing the integration).

But there are multiple ways of doing it and IMHO none of them are intuitive for non-TS-power-users

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the integration code itself though. If it’s not needed, maybe we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I wasn't clear. Loading the type augmentation is required, but it isn't required to be done this way.

I'll explain this in the text

@sarah11918
Copy link
Member

Hey @Fryuni , thanks for this addition! In general, I agree with all of Chris's edits here, but I'd like your confirmation before committing them to have as a base for me to start editing.

Can you take a look over Chris's comments here and resolve them all before I do my (more text-based/structural) reviewing and possibly editing for language? Thanks! 🙌

@sarah11918 sarah11918 added this to the 4.12.0 milestone Jul 2, 2024
[skip ci]

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
[skip ci]

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Fryuni , so excited to have this feature in docs!

I've left some comments/questions, some of which are absolutely coming from a lack of familiarity with authoring integrations, so I apologize for the hand-holding I'll need.

The main takeaways here are: I'd prefer a concrete example showing an actual use case, and I'm thinking that the page hierarchy might best change here.

I think there's a case to be made for this entire section being an <h2> and the whole thing is not about "defining custom hooks" but rather "creating and using custom hooks" (As I've mentioned in one comment, maybe that means that the existing "Hooks" would be improved as "Provided Hooks" or something like that)

Anyway, process this and see what of my comments make any sense! 😄

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking pretty good?? In fact, when reviewing your PR initially, it kind of bothered me that we didn't say anything for Hooks, so this seems like a real improvement across the board!

Are you happy if this PR becomes just this reference documentation, or would you like to also try to fit in a recipe/guide in the same way we did for the Dev Toolbar API page?

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@Fryuni
Copy link
Member Author

Fryuni commented Jul 8, 2024

Are you happy if this PR becomes just this reference documentation, or would you like to also try to fit in a recipe/guide in the same way we did for the Dev Toolbar API page?

I think the recipe/guide should go on a separate PR. It is not a requirement to get the feature released.

@sarah11918 sarah11918 added the Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! label Jul 12, 2024
@netlify
Copy link

netlify bot commented Jul 12, 2024

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 8ea9d47
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/669258a282a4500008c18f46
😎 Deploy Preview https://deploy-preview-8701--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for 4.12 release!

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@sarah11918 sarah11918 changed the base branch from main to 4.12.0 July 14, 2024 12:04
@sarah11918
Copy link
Member

!coauthor

@github-actions
Copy link

Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Chris Swithinbank <357379+delucis@users.noreply.github.com>

@sarah11918 sarah11918 merged commit 61f684f into 4.12.0 Jul 14, 2024
@sarah11918 sarah11918 deleted the fryuni/extendable-integration-hooks branch July 14, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants