In the latest live stream, we explored end-to-end (e2e) testing for a custom WordPress block using @wordpress/scripts and @wordpress/env. A simple e2e test suite was crafted to confirm block insertion and content accuracy, incorporating snapshot testing and database pre-population methods. Catch the recorded session and access all codes at Ryan Welcher’s GitHub. Streams are live on Thursdays at 10:30 EST on Twitch and YouTube. Read More
WordPress’s ‘getEntityRecords’ selector greatly assists in fetching data for custom Gutenberg blocks. It requires understanding of parameters like EntityType, Kind, and Query for effective use. Integration of the useSelect and useDispatch hooks ensures real-time data updates and user feedback, though sparse documentation may initially challenge developers. The use of ‘isResolving’ and ‘invalidateResolution’ provides loading states and the ability to refresh data, enhancing user experience. Read More