Bulk-Move Named Files Into Folders
If you’re looking to improve your JavaScript file structure, this blog post is for you. In this tutorial, I’ll walk you through the process of bulk-moving named files into folders, making it easier to organize and manage your code. By using a simple command line script, you can easily convert your named files into index.js files within new folders that match the current file name. This approach will not only simplify your codebase, but also help with file-specific documentation and allow for styles or other files you may want to add in future…
Passing Data from PHP to JavaScript
When passing data between PHP and JavaScript in WordPress, two methods can help. Use wp_add_inline_script to easily pass any data and perform dynamic code logic. Then, access the data from a single file to limit global variable access and allow easy inline documentation.
How WordPress 5.3 Might Break Your Editor Screen
This post comes in three parts. In the first, I present the problem I was facing when upgrading a site that was running on WordPress 5.2.x and no Gutenberg plugin. The second part is about the solution I found, which I think is no more than a workaround fix, actually. In the third part, I […]
Switching Between Branches with Different node_modules Folders
Every once in a while, I find myself in the situation of needing to change quite a few JavaScript dependencies. And oftentimes, this means that I would need to switch between two branches with rather different node_modules folders—which is a hassle. You too? Well, in this post, I will share how to do just that. […]
How to Test Container Components in React
Assuming you would want to unit-test container components in React (i.e., connected components in a Redux-based project), or any component that is wrapped in a higher-order component (HOC) etc. really, here’s a simple thing you should always do: 👉 Also export the “naked” component! I am talking about something like this: // … export { […]
The Gutenberg Development Course by Zac Gordon
In this post, I briefly review the new Gutenberg Development course by Zac Gordon. Hint: It is awesome, and you should sign up for it right away.
WordCamp Europe 2018: Unit Testing Workshop
I’m super excited to be hosting a workshop on unit testing at WordCamp Europe 2018. If you want to know why that is, you might want to read this post.
Event Listeners and Business Logic
In this post, I want to share a simple, yet effective best practice when it comes to (JavaScript) event listeners, and code reuse.
Becoming Human
New year, new job. With the end of 2017, I left Inpsyde, and as of January 15, 2018, I am one of the lucky devils working at Human Made. This post provides a little background to that move.
Interview with Wes Bos about WordPress, JavaScript and React
I did an interview with JavaScript and, in particular, React mastermind Wes Bos about a possible future of WordPress and the JavaScript framework React.