WordPress Now Ships with React and ReactDOM Custom Blocks Belong In Plugins, Not Themes It Is Best to Use ES6+ With Tools Like Webpack & Babel WordPress Offers A Library Of Pre-Built UI Components
WordPress and a code editor with command line access. Go to javascriptforwp.com/wcphx-2019 and download the workshop files. Copy the files into your plugins folder. Plugin Setup
WordPress and a code editor with command line access. Go to javascriptforwp.com/wcphx-2019 and download the workshop files. Copy the files into your plugins folder. Activate the first plugin and open it in your code editor. 3. Plugin Setup
SETTING UP A CUSTOM BLOCK PLUGIN. This will include registering our main JavaScript and CSS files and looking at the register_block_type function. Let’s Code!
well as JSX with React. Babel Tools Allows us to install helpful packages and easily run command line scripts. NPM Bundles our JavaScript files so we can use imports and exports. Webpack
CUSTOM BLOCK DEVELOPMENT. This will involve looking at the package.json, webpack.config.js and .babelrc files. Then we will run npm install and npm start and npm run build to test everything. Let’s Code!
BLOCK USING JAVASCRIPT. This will involve registering using registerBlockType, giving it a unique name and adding the appropriate settings. We will also look at the i18n library and add some custom CSS to our block. Let’s Code!
MAKE A DYNAMIC BLOCK. In this practice session we will look at how to setup a custom attribute to make our block editable or dynamic. We will also begin looking at how to destructure props, and write conditional statements based on whether block is selected. Let’s Code!
INSIDE OF OUR BLOCKS. In this practice session we will look at how to use a component from wp-components and one from wp-editor. We will need to make sure the dependencies are included and we have them configured correctly. Let’s Code!
TO OUR BLOCK TO MANAGE SETTINGS. Now we will look at how to add <InspectorControls /> and it’s related components to create a sidebar. Then we will add some settings to our block. Let’s Code!