So much JavaScript!

Anyone who has dived full time into learning something deeply has an idea of what my life has been like lately, as I continue to prepare this JS for WP Master Course 🙂

I wanted to pause from building projects to share some of the great insights I have gotten from recent conversations with experts in the field.

Chris Wiegman

Chris WiegmanI have loved getting to know Chris, a security expert in the community, through WordCamps and teaching WordPress.  I had a chat with him about security and how it applies to JS development.  He talked about some of the common vulnerabilities with JS, like unsanitized input and output, injection, cross site scripting, and pointed me to the Open Web Application Security Project (OWASP) guide on the top 10 security threats.  This will definitely be something we cover in the course.  I liked his recommendation to at least have a layer of JS security helper functions, similar to what WordPress has in Core with PHP, but for JavaScript.  Maybe we eventually see something like that in core, he thought.

This week I will be passing Chris the first major project for the course to get his help finding holes and vulnerabilities.  Thanks Chris for your help! Check out Chris’s talks at WordCamp.tv andfollow him on Twitter.

Jack Lenox

Jack has made a name for himself through his work and talks on building themes with JavaScript in WordPress.  I caught up with him to ask a few questions in regards to the projects for the course and best practices on JS themes in WordPress.  As he began to answer my questions, I realized he has thought about this quite a bit over the last few years and taken a number of different approaches to how to best build WordPress themes with JavaScript.  I’m really looking forward to hearing his talk at a Day of REST about some of the lessons he’s learned.

One of the questions I had for him was about routing in JS, taking action based on the URL, in decoupled apps as well as in WP themes.  He talked about why he really likes Page.js.  He also shared about a project he has that automatically creates PHP WP template files based on your JS templates.  This provides a really cool and rich fallback layer for when JavaScript is disabled if you’re building a WP theme.

Jack has a great article and tutorial series on building themes with JS and the REST API over on ThemeShaper that you should check out and stay tuned to for more.  When I asked him about what folks should learn about JavaScript in general, he mentioned prototypes, inheritance and then pulled Functional JavaScript off the shelf as a good reference.  Aces Jack, Aces.  Follow Jack on Twitter for updates on his talk at a Day of REST!

Eric Lewis

Eric LewisIn digging into learning more about the history of JS and WP, I wanted to talk with someone who had worked with an early JS framework project in Core, particularly the Media Grid buildout in Backbone.  Not only did Eric contribute to the project, but he built a really cool WP Media JavaScript Guide as a WP plugin that you can install to learn, interactively, how to work with the core media library using JS and Backbone.  He graciously shared about his experience with the projects as well as working with JS in general.

When it comes to choosing and implementing a framework, Eric emphasized the importance of making decisions based on features rather than frameworks: understand at a high level what different JS frameworks and libraries offer; learn how they work and are structured; understand how they will help or hinder the specific needs of your project.

We also got into some things related to working with Backbone specifically, like implementing subviews and working with Marionette. This talk from Jaquith on Backbone came up too.  It was good to chat with Eric and learn more about the history (and future) of JavaScript.  He has two recent JS tweets that you should read out too 🙂 Thanks Eric!

Take time to learn

If you are looking to dive deep into JavaScript, even only waist deep, it can be a lot to learn and the ecosystem is constantly evolving.

Add time to learn into your routine if you have not already.

Do more than just read an article, start tinkering or expanding your knowledge through new projects.  Hopefully some of the links above will give you some inspiration and direction on learning JavaScript for WordPress 🙂

Next..

My next announcement will include a peak at one of the cool vanilla JS projects we will build in the Master Course.  Look for that announcement next week, and Kickstarter news as soon as I have the new date set.

Thanks again for your support, and until next time,
Keep on Learning and Happy WordPressing!!!

Cheers,
Zac