I’ve long been experimenting with p5.js and Processing. Using it to connect to the WordPress REST API has been fun and educational. With the introduction of blocks into WordPress 5.0 as part of the new block editor (Gutenberg), I thought it would be fun to create a block that handled and rendered p5.js code.
This block could help pave the way for other languages that want to render code on the front-end. While I’ve got a working prototype, it still needs to be optimized.
Creating a block for WordPress is by far the best solution. At this point in time, WordPress runs about 33% of the web. It’s a natural solution for people wanting their own site and hosting their own content. This block will make it easy for users to add their creations to their pages or posts.