Skip to content
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

Docs: Interactivity API - Create and "Interactivity API" section under "How to Guides" section and include some initial guides #62922

Open
3 tasks
juanmaguitar opened this issue Jun 27, 2024 · 3 comments
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Developer Documentation Documentation for developers

Comments

@juanmaguitar
Copy link
Contributor

juanmaguitar commented Jun 27, 2024

There are some guides to complement the docs at Interactivity API Reference that could be added to a new "How to Guides > Interactivity API" section

Some of the guides that could go under this new section are:

  • How to Guides > Interactivity API
    • Adding interactivity to existing blocks
    • Using interactivity API in classic themes
@juanmaguitar juanmaguitar added [Type] Developer Documentation Documentation for developers [Feature] Interactivity API API to add frontend interactivity to blocks. labels Jun 27, 2024
@juanmaguitar juanmaguitar changed the title Docs: Interactivity API - Create a Core Concepts section for the iAPI Jun 27, 2024
@WPLake
Copy link

WPLake commented Jun 30, 2024

It would be nice to highlight the fact that iAPI can be used in any theme, including classic ones. Providing a small practical example would encourage developers to apply it even while developing classic themes.

Currently, it states that the API is public but does not provide a complete example. For instance, if developers try to use the @wordpress/interactivity alias directly, it won't work because WordPress doesn't define this alias automatically when it's used out of Gutenberg blocks.

Therefore, the example should describe the way to 'enable' the alias, or at least mention that the full root path (/wp-includes/...) is necessary for usage. Otherwise, many developers might feel that using iAPI outside of Gutenberg is not expected or encouraged.

@juanmaguitar
Copy link
Contributor Author

juanmaguitar commented Jul 1, 2024

It would be nice to highlight the fact that iAPI can be used in any theme, including classic ones. Providing a small practical example would encourage developers to apply it even while developing classic themes.

@WPLake, this sounds like a great guide for the "How-to Guides > Interactivity API." Would you be up to writing this guide?

If the guide becomes too long, or it turns out to more like a tutorial, it could be suggested as a Developer Blog post and just link it from "How-to Guides > Interactivity API."

@WPLake
Copy link

WPLake commented Jul 13, 2024

@juanmaguitar it seems more like a simple example with a description rather than a guide. This example is included in our article within this section.

While writing the Interactivity API page, you can copy that part of the article and reword it to fit the flow of the page. The idea is to showcase that it's legimit to use in the classic themes too. Otherwise, if you copy-paste any example, it won't work due to the missing @wordpress/interactivity alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Developer Documentation Documentation for developers
2 participants