SlideShare une entreprise Scribd logo
Digging into Gutenberg
Imran Sayed
@imranhsayed
Ajit Bohra
@ajitbohra
WordPress Meetu
Saturday, 14th Mar 202
10:30 am UTC
Welcome To WordPress
What WordPress can do
▪ Blogs
▪ LMS
▪ Ecommerce
3
Block Editor
Gutenberg Mental Modal
https://atomicdesign.bradfrost.com/table-of-contents/
Look Beyond Blocks
Diving into
Gutenberg Core
Gutenberg Packages
▪ Packages can be used independently
▪ Can be used outside WordPress
▪ Have documentation.
▪ https://github.com/WordPress/gutenberg/tree/maste
r/packages
8
Composition of packages
Common Packages
Common Packages
▪ @wordpress/components
▪ @wordpress/block-editor
▪ @wordpress/data
▪ @wordpress/rich-text
▪ @wordpress/i118n
11
wordpress.github.io/gutenberg - View components in Storybook
12
Tools
Build Tools
▪ @wordpress/scripts
▪ @wordpress/create-block
▪ @wordpress/env
14
Editor and data ?
1.
WordPress Data
WordPress Data Module
▪ Serves as a hub to manage application state for both
plugins and WordPress itself
▪ Provides tools to manage data within and between
distinct modules.
▪ designed as a modular pattern for organizing and
sharing data
▪ Its implemented atop redux.
17
What is Redux?
A state management tool for javascript apps.
19
20
Store
Cookie Maker
21
Cookie Maker
Distributor
22
Distributor
Store
23
Distributor
Store
Cookie Maker Distributor
24
Store
26
Distributor
Store
Cookie Maker
( Action Creator )
Distributor
( Reducer )
Food: Payload
Subscriber
Instruction:
Dispatch
Actions, Reducers, Store, State
Triggers an action Create & Dispatch an Action
Updates store with
new state based on
action type
Defines
Why use Redux?
▪ Allows you to share the state between components
▪ It integrates nicely with React. Can use it with any
other view library. It allow us to track changing data.
▪ When we have big complicated data for complex
applications.
28
Why use Redux?
▪ Any component can pull any piece of data from the
redux store. So data needs to be shared between
multiple components.
▪ Run in different environments (client, server, and
native), and are easy to test.
29
Why use Redux?
▪ Reusing the components because they no longer are
dependent to get the props from their parents, they
can all get their state values as props ,from a single
redux store
30
WordPress Data Module
▪ Simple enough to satisfy the needs of a small plugin
▪ Scalable to serve the requirements of a complex
single-page application
▪ Built upon and shares many of the same core
principles of Redux
▪ But it's only merely ‘Redux for WordPress’
▪ Includes a few of its own distinguishing
characteristics
31
3.
WordPress Data Store
WordPress Data Store
▪ Default stores
▪ Custom store
33
WordPress Data Store
▪ Mostly used packages
▫ core
▫ core/blocks
▫ core/block-editor
▫ core/edit-post
▪ More
▫ core/notices
34
3.
Retrieving Data
( using Selectors )
Retrieving Data
▪ wp.data.select( 'namespace' ).selector( param );
Get edited and current post data.
▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'title' );
▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'excerpt' );
▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'featured_media' )
▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'content' );
36
Retrieving Data
Get post meta
▪ wp.data.select( 'core/editor' ).getCurrentPost().meta
Get settings
▪ wp.data.select( 'core/block-editor' ).getSettings();
▪ wp.data.select( 'core/block-editor' ).getBlock( ‘client-id’ );
Get WordPress Data
▪ wp.data.select( 'core' ).getEntityRecords( 'postType', 'post' );
▪ wp.data.select( 'core' ).getAuthors();
▪ wp.data.select( 'core' ).getTaxonomies()
37
4.
Updating Data ( using
actions )
Updating Data
▪ wp.data.dispatch( 'namespace' ).action( params );
Update current post data.
▪ wp.data.dispatch( 'core/editor' ).editPost( { title: 'My New Title' } );
▪ wp.data.dispatch( 'core/editor' ).editPost( { excerpt: 'My excerpt' } );
▪ wp.data.dispatch( 'core/editor' ).editPost( { featured_media: imageID } );
Update data
▪ wp.data.dispatch('core/notices').createNotice( 'success', 'Here is our notice!'
);
39
Updating Data
Update current post data.
▪ wp.data.dispatch( 'core/editor' ).lockPostSaving()
▪ wp.data.dispatch( 'core/editor' ).unlockPostSaving();
40
5.
Subscribe To Any Change.
Subscribe to any change - Saving Post
wp.data.subscribe( () => {
const isSavingPost = wp.data.select( 'core/editor').isSavingPost();
const isAutoSavingPost = wp.data.select( 'core/editor').isAutosavingPost();
// Update post data when the post is saving.
if ( isSavingPost && ! isAutoSavingPost ) {
// Do something
} } );
42
Subscribe to any change = Typing
wp.data.select( 'core/block-editor' ).isTyping();
wp.data.subscribe( () => {
const isTyping = wp.data.select( 'core/block-editor' ).isTyping();
// Get the post title when user is typing, and do something
if ( isTyping ) {
const title = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'title' );
console.warn( 'Typing..', title );
} } );
43
2.
WordPress Data Module vs
Redux
Let’s start with the first set of slides
WordPress Data Module Vs Redux - Similarities
▪ Many of the same core principles like:
▫ Single store object.
▫ State is changed by emitting an action.
▫ Making state changes with Reducers.
▪ Many of the same API method naming like:
▫ Dispatch, subscribe, createStore etc.
▪ Implemented atop Redux
45
WordPress Data Module Vs Redux - Difference
▪ Differs is in establishing a modularization pattern for
creating separate but interdependent stores.
▪ Higher-order components were created to
complement this distinction
46
Redux
WordPress Data Module Vs Redux - Difference
WordPress Data Module
47
▪ A subscribe listener is called on
every dispatch, regardless of
state change
▪ A subscriber is only called
when state has changed
▪ In React Redux, a
mapStateToProps function
must return an object.
▪ A withSelect mapping function
can return undefined if it has
no props to inject.
Redux
WordPress Data Module Vs Redux - Difference
WordPress Data Module
48
▪ In React Redux, the
mapDispatchToProps
argument can be defined as an
object or a function.
▪ The withDispatch higher-order
component creator must be
passed a function.
7.
Current State of Gutenberg
What features have currently been added
8.
Future of Gutenberg
Phase 2
https://wordpress.org/about/roadmap/
https://github.com/WordPress/gutenberg/blob/master/docs/roadmap.md
9.
Contributing to Gutenberg
Contributing to gutenberg
▪ Guide https://developer.wordpress.org/block-
editor/contributors/
52
Contributing to gutenberg
▪ Contribute to :
● Good first issue https://mkaz.blog/code/good-first-issue-
on-gutenberg/
● Documentation
● Design
● Adding Stories to StoryBook
https://mkaz.blog/code/coding-a-storybook-story/
● Testing
● Write Test Cases
● PR Reviews
53
54
THANKS!
ANY QUESTIONS?
You can find us on Twitter at:
▪ @imranhsayed
▪ @ajitbohra

Contenu connexe

Tendances

Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)
Frazer Clement
 
The benefits of My sql
The benefits of My sqlThe benefits of My sql
The benefits of My sql
CacheWorks©
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
Ronald Bradford
 
Introduction Mysql
Introduction Mysql Introduction Mysql
Introduction Mysql
Gerben Menschaert
 
Drupal Now! - Introduction to Drupal
Drupal Now! - Introduction to DrupalDrupal Now! - Introduction to Drupal
Drupal Now! - Introduction to Drupal
Alozie Nwosu
 
Bacula4
Bacula4Bacula4
Bacula4
Elsayed Atef
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud Features
Guillermo Caicedo
 
Local Drupal MultiSite Set-up
Local Drupal MultiSite Set-upLocal Drupal MultiSite Set-up
Local Drupal MultiSite Set-up
Manuel Felix G. Abejo Jr.
 
Windows Azure Drive
Windows Azure DriveWindows Azure Drive
Windows Azure Drive
Pavel Revenkov
 
your browser, my storage
your browser, my storageyour browser, my storage
your browser, my storage
Francesco Fullone
 
UKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA'sUKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA's
FromDual GmbH
 
[B5]memcached scalability-bag lru-deview-100
[B5]memcached scalability-bag lru-deview-100[B5]memcached scalability-bag lru-deview-100
[B5]memcached scalability-bag lru-deview-100
NAVER D2
 
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013   MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
Serge Frezefond
 
Introduction to Mysql
Introduction to MysqlIntroduction to Mysql
Introduction to Mysql
Tushar Chauhan
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Keith Hollman
 
MaxScale - the pluggable router
MaxScale - the pluggable routerMaxScale - the pluggable router
MaxScale - the pluggable router
MariaDB Corporation
 
Sql azure federations
Sql azure federations Sql azure federations
Sql azure federations
Pavel Tsukanov
 
Linux17 MySQL_installation
Linux17 MySQL_installationLinux17 MySQL_installation
Linux17 MySQL_installation
Jainul Musani
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
eLiberatica
 
Dbdeployer
DbdeployerDbdeployer
Dbdeployer
Giuseppe Maxia
 

Tendances (20)

Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)
 
The benefits of My sql
The benefits of My sqlThe benefits of My sql
The benefits of My sql
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
 
Introduction Mysql
Introduction Mysql Introduction Mysql
Introduction Mysql
 
Drupal Now! - Introduction to Drupal
Drupal Now! - Introduction to DrupalDrupal Now! - Introduction to Drupal
Drupal Now! - Introduction to Drupal
 
Bacula4
Bacula4Bacula4
Bacula4
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud Features
 
Local Drupal MultiSite Set-up
Local Drupal MultiSite Set-upLocal Drupal MultiSite Set-up
Local Drupal MultiSite Set-up
 
Windows Azure Drive
Windows Azure DriveWindows Azure Drive
Windows Azure Drive
 
your browser, my storage
your browser, my storageyour browser, my storage
your browser, my storage
 
UKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA'sUKOUG 2011: MySQL Architectures for Oracle DBA's
UKOUG 2011: MySQL Architectures for Oracle DBA's
 
[B5]memcached scalability-bag lru-deview-100
[B5]memcached scalability-bag lru-deview-100[B5]memcached scalability-bag lru-deview-100
[B5]memcached scalability-bag lru-deview-100
 
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013   MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 
Introduction to Mysql
Introduction to MysqlIntroduction to Mysql
Introduction to Mysql
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
 
MaxScale - the pluggable router
MaxScale - the pluggable routerMaxScale - the pluggable router
MaxScale - the pluggable router
 
Sql azure federations
Sql azure federations Sql azure federations
Sql azure federations
 
Linux17 MySQL_installation
Linux17 MySQL_installationLinux17 MySQL_installation
Linux17 MySQL_installation
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
 
Dbdeployer
DbdeployerDbdeployer
Dbdeployer
 

Similaire à Digging Into Gutenberg

Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Decoupling Drupal mit dem Lupus Nuxt.js Drupal StackDecoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
nuppla
 
WEBPACK
WEBPACKWEBPACK
WEBPACK
home
 
Containerizing ContentBox CMS
Containerizing ContentBox CMSContainerizing ContentBox CMS
Containerizing ContentBox CMS
Gavin Pickin
 
13 things every developer should know about their database to run word press ...
13 things every developer should know about their database to run word press ...13 things every developer should know about their database to run word press ...
13 things every developer should know about their database to run word press ...
Seravo
 
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Andrew Duthie
 
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minsChandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
wpnepal
 
Wordpress
WordpressWordpress
Wordpress
samirlakhanistb
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
Nuvole
 
WordPress Optimization & Security - ThinkVisibility 2012, Leeds
WordPress Optimization & Security - ThinkVisibility 2012, LeedsWordPress Optimization & Security - ThinkVisibility 2012, Leeds
WordPress Optimization & Security - ThinkVisibility 2012, Leeds
Bastian Grimm
 
Worcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20minsWorcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20mins
Chandra Prakash Thapa
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
Otto Kekäläinen
 
ITB2019 Containerizing ContentBox CMS - Gavin Pickin
ITB2019 Containerizing ContentBox CMS - Gavin PickinITB2019 Containerizing ContentBox CMS - Gavin Pickin
ITB2019 Containerizing ContentBox CMS - Gavin Pickin
Ortus Solutions, Corp
 
WordPress Optimization & Security - LAC 2013, London
WordPress Optimization & Security - LAC 2013, LondonWordPress Optimization & Security - LAC 2013, London
WordPress Optimization & Security - LAC 2013, London
Bastian Grimm
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012
Bastian Grimm
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
DrupalDay
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
rtCamp
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
vitepress-en.pdf
vitepress-en.pdfvitepress-en.pdf
vitepress-en.pdf
ssuser65180a
 
Zend
ZendZend
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStore
Vikalp Bhalia
 

Similaire à Digging Into Gutenberg (20)

Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Decoupling Drupal mit dem Lupus Nuxt.js Drupal StackDecoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
 
WEBPACK
WEBPACKWEBPACK
WEBPACK
 
Containerizing ContentBox CMS
Containerizing ContentBox CMSContainerizing ContentBox CMS
Containerizing ContentBox CMS
 
13 things every developer should know about their database to run word press ...
13 things every developer should know about their database to run word press ...13 things every developer should know about their database to run word press ...
13 things every developer should know about their database to run word press ...
 
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
 
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minsChandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
 
Wordpress
WordpressWordpress
Wordpress
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
WordPress Optimization & Security - ThinkVisibility 2012, Leeds
WordPress Optimization & Security - ThinkVisibility 2012, LeedsWordPress Optimization & Security - ThinkVisibility 2012, Leeds
WordPress Optimization & Security - ThinkVisibility 2012, Leeds
 
Worcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20minsWorcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20mins
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
 
ITB2019 Containerizing ContentBox CMS - Gavin Pickin
ITB2019 Containerizing ContentBox CMS - Gavin PickinITB2019 Containerizing ContentBox CMS - Gavin Pickin
ITB2019 Containerizing ContentBox CMS - Gavin Pickin
 
WordPress Optimization & Security - LAC 2013, London
WordPress Optimization & Security - LAC 2013, LondonWordPress Optimization & Security - LAC 2013, London
WordPress Optimization & Security - LAC 2013, London
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
vitepress-en.pdf
vitepress-en.pdfvitepress-en.pdf
vitepress-en.pdf
 
Zend
ZendZend
Zend
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStore
 

Plus de Imran Sayed

Docker with WordPress
Docker with WordPressDocker with WordPress
Docker with WordPress
Imran Sayed
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
Imran Sayed
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in react
Imran Sayed
 
Fastest Way of Creating Gutenberg Blocks - WordCamp Rochester
Fastest Way of Creating Gutenberg Blocks - WordCamp RochesterFastest Way of Creating Gutenberg Blocks - WordCamp Rochester
Fastest Way of Creating Gutenberg Blocks - WordCamp Rochester
Imran Sayed
 
Harness The Power Of ACF For Gatsby and WordPress
Harness The Power Of ACF For Gatsby and WordPressHarness The Power Of ACF For Gatsby and WordPress
Harness The Power Of ACF For Gatsby and WordPress
Imran Sayed
 
Improving Your Debugging Skills In WordPress
Improving Your Debugging Skills In WordPressImproving Your Debugging Skills In WordPress
Improving Your Debugging Skills In WordPress
Imran Sayed
 
Build Modern Web Applications with React and WordPress
Build Modern Web Applications with React and WordPressBuild Modern Web Applications with React and WordPress
Build Modern Web Applications with React and WordPress
Imran Sayed
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
Imran Sayed
 
Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge ...
Fastest Way Of Creating  Gutenberg Blocks  With Minimal JavaScript Knowledge ...Fastest Way Of Creating  Gutenberg Blocks  With Minimal JavaScript Knowledge ...
Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge ...
Imran Sayed
 
Why progressive web apps for word press wc-ahemdabad
Why progressive web apps for word press wc-ahemdabadWhy progressive web apps for word press wc-ahemdabad
Why progressive web apps for word press wc-ahemdabad
Imran Sayed
 
Build fast word press site in react in 30 mins with frontity
Build fast word press site in react in 30 mins   with frontityBuild fast word press site in react in 30 mins   with frontity
Build fast word press site in react in 30 mins with frontity
Imran Sayed
 
Build Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyBuild Fast WordPress Site With Gatsby
Build Fast WordPress Site With Gatsby
Imran Sayed
 
Why Progressive Apps For WordPress?
Why Progressive Apps For WordPress?Why Progressive Apps For WordPress?
Why Progressive Apps For WordPress?
Imran Sayed
 
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACFCreating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
Imran Sayed
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with React
Imran Sayed
 
SSR with React - Connecting Next.js with WordPress
SSR with React - Connecting Next.js with WordPressSSR with React - Connecting Next.js with WordPress
SSR with React - Connecting Next.js with WordPress
Imran Sayed
 
React with WordPress : Headless CMS
React with WordPress : Headless CMSReact with WordPress : Headless CMS
React with WordPress : Headless CMS
Imran Sayed
 
React Workshop: Core concepts of react
React Workshop: Core concepts of reactReact Workshop: Core concepts of react
React Workshop: Core concepts of react
Imran Sayed
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
Imran Sayed
 
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 

Plus de Imran Sayed (20)

Docker with WordPress
Docker with WordPressDocker with WordPress
Docker with WordPress
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in react
 
Fastest Way of Creating Gutenberg Blocks - WordCamp Rochester
Fastest Way of Creating Gutenberg Blocks - WordCamp RochesterFastest Way of Creating Gutenberg Blocks - WordCamp Rochester
Fastest Way of Creating Gutenberg Blocks - WordCamp Rochester
 
Harness The Power Of ACF For Gatsby and WordPress
Harness The Power Of ACF For Gatsby and WordPressHarness The Power Of ACF For Gatsby and WordPress
Harness The Power Of ACF For Gatsby and WordPress
 
Improving Your Debugging Skills In WordPress
Improving Your Debugging Skills In WordPressImproving Your Debugging Skills In WordPress
Improving Your Debugging Skills In WordPress
 
Build Modern Web Applications with React and WordPress
Build Modern Web Applications with React and WordPressBuild Modern Web Applications with React and WordPress
Build Modern Web Applications with React and WordPress
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 
Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge ...
Fastest Way Of Creating  Gutenberg Blocks  With Minimal JavaScript Knowledge ...Fastest Way Of Creating  Gutenberg Blocks  With Minimal JavaScript Knowledge ...
Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge ...
 
Why progressive web apps for word press wc-ahemdabad
Why progressive web apps for word press wc-ahemdabadWhy progressive web apps for word press wc-ahemdabad
Why progressive web apps for word press wc-ahemdabad
 
Build fast word press site in react in 30 mins with frontity
Build fast word press site in react in 30 mins   with frontityBuild fast word press site in react in 30 mins   with frontity
Build fast word press site in react in 30 mins with frontity
 
Build Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyBuild Fast WordPress Site With Gatsby
Build Fast WordPress Site With Gatsby
 
Why Progressive Apps For WordPress?
Why Progressive Apps For WordPress?Why Progressive Apps For WordPress?
Why Progressive Apps For WordPress?
 
Creating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACFCreating Gutenberg Blocks With ACF
Creating Gutenberg Blocks With ACF
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with React
 
SSR with React - Connecting Next.js with WordPress
SSR with React - Connecting Next.js with WordPressSSR with React - Connecting Next.js with WordPress
SSR with React - Connecting Next.js with WordPress
 
React with WordPress : Headless CMS
React with WordPress : Headless CMSReact with WordPress : Headless CMS
React with WordPress : Headless CMS
 
React Workshop: Core concepts of react
React Workshop: Core concepts of reactReact Workshop: Core concepts of react
React Workshop: Core concepts of react
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
React workshop
React workshopReact workshop
React workshop
 

Dernier

ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
widenerjobeyrl638
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 

Dernier (20)

ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 

Digging Into Gutenberg

  • 1. Digging into Gutenberg Imran Sayed @imranhsayed Ajit Bohra @ajitbohra WordPress Meetu Saturday, 14th Mar 202 10:30 am UTC
  • 3. What WordPress can do ▪ Blogs ▪ LMS ▪ Ecommerce 3
  • 8. Gutenberg Packages ▪ Packages can be used independently ▪ Can be used outside WordPress ▪ Have documentation. ▪ https://github.com/WordPress/gutenberg/tree/maste r/packages 8
  • 11. Common Packages ▪ @wordpress/components ▪ @wordpress/block-editor ▪ @wordpress/data ▪ @wordpress/rich-text ▪ @wordpress/i118n 11
  • 12. wordpress.github.io/gutenberg - View components in Storybook 12
  • 13. Tools
  • 14. Build Tools ▪ @wordpress/scripts ▪ @wordpress/create-block ▪ @wordpress/env 14
  • 17. WordPress Data Module ▪ Serves as a hub to manage application state for both plugins and WordPress itself ▪ Provides tools to manage data within and between distinct modules. ▪ designed as a modular pattern for organizing and sharing data ▪ Its implemented atop redux. 17
  • 18. What is Redux? A state management tool for javascript apps.
  • 19. 19
  • 25.
  • 26. 26 Distributor Store Cookie Maker ( Action Creator ) Distributor ( Reducer ) Food: Payload Subscriber Instruction: Dispatch
  • 27. Actions, Reducers, Store, State Triggers an action Create & Dispatch an Action Updates store with new state based on action type Defines
  • 28. Why use Redux? ▪ Allows you to share the state between components ▪ It integrates nicely with React. Can use it with any other view library. It allow us to track changing data. ▪ When we have big complicated data for complex applications. 28
  • 29. Why use Redux? ▪ Any component can pull any piece of data from the redux store. So data needs to be shared between multiple components. ▪ Run in different environments (client, server, and native), and are easy to test. 29
  • 30. Why use Redux? ▪ Reusing the components because they no longer are dependent to get the props from their parents, they can all get their state values as props ,from a single redux store 30
  • 31. WordPress Data Module ▪ Simple enough to satisfy the needs of a small plugin ▪ Scalable to serve the requirements of a complex single-page application ▪ Built upon and shares many of the same core principles of Redux ▪ But it's only merely ‘Redux for WordPress’ ▪ Includes a few of its own distinguishing characteristics 31
  • 33. WordPress Data Store ▪ Default stores ▪ Custom store 33
  • 34. WordPress Data Store ▪ Mostly used packages ▫ core ▫ core/blocks ▫ core/block-editor ▫ core/edit-post ▪ More ▫ core/notices 34
  • 36. Retrieving Data ▪ wp.data.select( 'namespace' ).selector( param ); Get edited and current post data. ▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'title' ); ▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'excerpt' ); ▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'featured_media' ) ▪ wp.data.select( 'core/editor' ).getEditedPostAttribute( 'content' ); 36
  • 37. Retrieving Data Get post meta ▪ wp.data.select( 'core/editor' ).getCurrentPost().meta Get settings ▪ wp.data.select( 'core/block-editor' ).getSettings(); ▪ wp.data.select( 'core/block-editor' ).getBlock( ‘client-id’ ); Get WordPress Data ▪ wp.data.select( 'core' ).getEntityRecords( 'postType', 'post' ); ▪ wp.data.select( 'core' ).getAuthors(); ▪ wp.data.select( 'core' ).getTaxonomies() 37
  • 38. 4. Updating Data ( using actions )
  • 39. Updating Data ▪ wp.data.dispatch( 'namespace' ).action( params ); Update current post data. ▪ wp.data.dispatch( 'core/editor' ).editPost( { title: 'My New Title' } ); ▪ wp.data.dispatch( 'core/editor' ).editPost( { excerpt: 'My excerpt' } ); ▪ wp.data.dispatch( 'core/editor' ).editPost( { featured_media: imageID } ); Update data ▪ wp.data.dispatch('core/notices').createNotice( 'success', 'Here is our notice!' ); 39
  • 40. Updating Data Update current post data. ▪ wp.data.dispatch( 'core/editor' ).lockPostSaving() ▪ wp.data.dispatch( 'core/editor' ).unlockPostSaving(); 40
  • 42. Subscribe to any change - Saving Post wp.data.subscribe( () => { const isSavingPost = wp.data.select( 'core/editor').isSavingPost(); const isAutoSavingPost = wp.data.select( 'core/editor').isAutosavingPost(); // Update post data when the post is saving. if ( isSavingPost && ! isAutoSavingPost ) { // Do something } } ); 42
  • 43. Subscribe to any change = Typing wp.data.select( 'core/block-editor' ).isTyping(); wp.data.subscribe( () => { const isTyping = wp.data.select( 'core/block-editor' ).isTyping(); // Get the post title when user is typing, and do something if ( isTyping ) { const title = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'title' ); console.warn( 'Typing..', title ); } } ); 43
  • 44. 2. WordPress Data Module vs Redux Let’s start with the first set of slides
  • 45. WordPress Data Module Vs Redux - Similarities ▪ Many of the same core principles like: ▫ Single store object. ▫ State is changed by emitting an action. ▫ Making state changes with Reducers. ▪ Many of the same API method naming like: ▫ Dispatch, subscribe, createStore etc. ▪ Implemented atop Redux 45
  • 46. WordPress Data Module Vs Redux - Difference ▪ Differs is in establishing a modularization pattern for creating separate but interdependent stores. ▪ Higher-order components were created to complement this distinction 46
  • 47. Redux WordPress Data Module Vs Redux - Difference WordPress Data Module 47 ▪ A subscribe listener is called on every dispatch, regardless of state change ▪ A subscriber is only called when state has changed ▪ In React Redux, a mapStateToProps function must return an object. ▪ A withSelect mapping function can return undefined if it has no props to inject.
  • 48. Redux WordPress Data Module Vs Redux - Difference WordPress Data Module 48 ▪ In React Redux, the mapDispatchToProps argument can be defined as an object or a function. ▪ The withDispatch higher-order component creator must be passed a function.
  • 49. 7. Current State of Gutenberg What features have currently been added
  • 50. 8. Future of Gutenberg Phase 2 https://wordpress.org/about/roadmap/ https://github.com/WordPress/gutenberg/blob/master/docs/roadmap.md
  • 52. Contributing to gutenberg ▪ Guide https://developer.wordpress.org/block- editor/contributors/ 52
  • 53. Contributing to gutenberg ▪ Contribute to : ● Good first issue https://mkaz.blog/code/good-first-issue- on-gutenberg/ ● Documentation ● Design ● Adding Stories to StoryBook https://mkaz.blog/code/coding-a-storybook-story/ ● Testing ● Write Test Cases ● PR Reviews 53
  • 54. 54 THANKS! ANY QUESTIONS? You can find us on Twitter at: ▪ @imranhsayed ▪ @ajitbohra