How to use TypeScript in WordPress: a Starters Guide

Аватар автора
CSS создание динамических элементов и эффектов
If you use a lot of JavaScript for developing WordPress plugins and themes, but haven&started using TypeScript, you should! It makes the development experience of the JS part of WordPress so much better. However, TypeScript is not so much used in WordPress (yet), but setting it up is not that hard! In this video, I will set-up a simple plugin with a set-up that supports TypeScript. You can code along or use this as an inspiration for your own projects. * 0:00 Start * 00:57 Prerequisites (dev tools) * 04:15 Setting up a local WordPress environment * 05:42 Plugin Basics (PHP) * 07:29 Installing Dependencies with NPM * 12:29 Webpack Config * 23:52 TypeScript Config * 26:34 Enqueueing * 30:39 Writing TypeScript * 38:57 How it looks in WordPress It&also on (digital) paper, read it here: There is also a starter template, which is almost similar to what&written in the video: There&one catch, types are not fully supported (yet) in developing blocks and extensions for the Block Editor. I also wrote an article about this topic: Check me out at: Follow me on social media: My videos may contain affiliate links to fund the time spent on creating, testing and, reviewing. This won&cost you anything extra, but brings me some extra bread to the table.

0/0


0/0

0/0

0/0