-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 a Core Concepts section for the iAPI #62921
Comments
It would be great if these pages included an introduction to the declarative approach, highlighting its benefits over the imperative one. Additionally, they should review the concepts independently, without mentioning any Gutenberg-related aspects. This is necessary because WordPress has historically been heavily related to PHP, and many experienced, old-school WP developers may not have any reactive background at all, nor be aware of the Gutenberg block creation process. iAPI aims to be a new standard for the WordPress front end, which is great. But to achieve this goal, we need to 'sell' it to the developers and avoid complicating the understanding of this new concept by mentioning unnecessary details. I also propose covering the following essential points: 1. Declarative vs. Imperative approaches: Overview and explanation Show a visual example highlighting the drawbacks of the imperative approach, then explain and promote the declarative one. 2. Interactivity vs. Reactivity: Explanation Explain why the term 'interactivity' was chosen, and clarify its relation to and difference from the term 'reactivity.' 3. Why iAPI, and its benefits over alternatives (within WP) The current About the Interactivity API page can be used as a base but should be made more presentable. iAPI is a new concept, and most clients, as well as developers from other frameworks, are not familiar with it. It's necessary if we want to propose the iAPI as a headless alternative solution (at least for some cases). Currently, if you mention 'your front end will employ iAPI,' most colleagues/clients ask what it is, and there is no presentation link to send them. A good presentation page would help them: a) Understand the overall idea Otherwise, iAPI usage will be refused in favor of a headless or a third-party solution. Additionally, many non-WP agencies and freelancers who use other tools but periodically take on WP-related projects would also benefit from such a 'promo & definition page.' Without it, they may never consider using iAPI even in the perfect use cases. P.S. You can check this article we made at WPLake to see how we approached it. You might find inspiration or even reusable parts there. |
Thanks @WPLake for the feedback!
I agree these could be great topics to be covered in pages under "Core Concepts" section. Would you be up to write about them? I think @luisherranz also wanted to start writing about some Core Concepts related to the iAPI in the docs, so having an issue for each piece of content would enable a proper conversation and organization around working on these topics to improve the iAPI docs. |
@juanmaguitar Glad to hear you like the suggestions. I've opened the issues, but they have the default label added automatically when choosing the issue type. I couldn't add the same labels as you did for this issue. I assume that's due to permission restrictions, but I hope it isn't a big deal to have the default [Enhancement] labels. |
I have opened a pull request for the first guide: |
I have opened another pull request for the second guide: EDIT: In the end, I merged it with the first pull request, which includes the first three guides. |
@luisherranz Exciting news! I've read both, and they are great - well done! I'm sure with such documentation, iAPI will gain many more fans! Currently, it's difficult to see the whole picture, but after publishing the new section, I assume we'll be able to have a general look and fill in if there are any gaps. The main thing is that the new foundation will be in place, making it easy to make minor improvements. One more thing that could make the articles even more attractive is making examples playful, i.e., adding a live playground. Wouldn't it be great to wrap examples into JSFiddle or CodePen? It seems new to wp.org, but if adopted, it could be useful in many places. I see a couple of ways:
The second option looks attractive because you don't need to manage fiddles separately, but it requires injecting a script tag ('https://static.codepen.io/assets/embed/ei.js'). What are your thoughts on this? |
@juanmaguitar It seems the Core Concepts section is missing a 'How it works scheme overview,' which would explain the entire API's workflow based on a single page request. This could be useful for helping devs create and structure a general process roadmap, which other guides will then detail. Not sure about the exact name, but we've made a pull request with the suggested content. Please review it and let us know your thoughts about the idea and if it needs any style polishing to meet the WordPress guidelines. |
@WPLake, thanks for this suggestion! I agree that providing live examples of code snippets would be extremely helpful for understanding the documentation's explanations about the iAPI fully. My approach here would be to add those snippets of code to block-development-examples and then show them in the code with WordPress Playground Block This approach would allow:
Having said this, I'm curious about what an example would be of using CodePen or JSFiddle to display the outcome of some of the current examples in the docs. Do you have any example you could share? |
@juanmaguitar That's an amazing thing! We were unaware of this block; it truly seems impressive. We've previously had experience only with the WordPress playground for plugins (while setting it up for our Advanced Views plugin). It definitely deserves to be highlighted on WordPress Playground Docs. We've raised an issue to include its mention. Regarding the real example, I believe that all the mentioned full code examples can be integrated into the Playground. Our initial idea was to use CodePen/JSFiddle, which allows for third-party JavaScript (iAPI JS library), involving ready HTML while omitting server-side functions. However, with the Playground block, it seems even more advantageous, as allows to play with the server side functions as well. |
I have opened another separate pull request for the TypeScript guide. It is not finished yet, as I still need to document some use cases. It should not be a blocker for merging the pull request of the first three guides. |
Some core concepts related to the Interactivity API need a better explanation in the Docs. For that, I propose to create a section called "Core Concepts" with subpages covering some key concepts needed to understand how to work with the Interactivity API fully:
The text was updated successfully, but these errors were encountered: