Hi ! You’re requested to implement functionality to create a Gutenberg Block that fetches a list of elements from an API and displays it in the frontend (think of it as if you needed to fetch tweets from specific Twitter users).
For the sake of examples, you can use https://httpbin.org/post as the URL to get data from, and use the headers returned there as the return data from the API.
You do not need to complete the task, rather, explain how you would approach it. Provide a rough plan of how to implement the block, or provide where to change code in the existing codebase of the site.
Requirements:
- The implementation needs to be theme agnostic.
- The block needs to follow the latest recommendations from the Gutenberg project.
- A fallback to a shortcode needs to be implemented that displays the same information in a sidebar, or elsewhere.
- The functionality needs to impact as little as possible on the site performance (leveraging as many caching techniques as possible, having a properly structured stylesheet, along WP good practices).
- The data returned by the API doesn’t need to be filtered.
- The UX from visitors using the block (both the edit and the display experience) should be as native to Gutenberg as possible.
- The solution as a whole needs to be as secure as possible.
Be sure to include how long will it take you to complete the task, and please send your approach by the date indicated in your email correspondence.