SlideShare une entreprise Scribd logo
1  sur  54
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 sqlCacheWorks©
 
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 DevelopersRonald Bradford
 
Drupal Now! - Introduction to Drupal
Drupal Now! - Introduction to DrupalDrupal Now! - Introduction to Drupal
Drupal Now! - Introduction to DrupalAlozie Nwosu
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesGuillermo Caicedo
 
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'sFromDual 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-100NAVER 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
 
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 - UKOUGKeith Hollman
 
Sql azure federations
Sql azure federations Sql azure federations
Sql azure federations Pavel Tsukanov
 
Linux17 MySQL_installation
Linux17 MySQL_installationLinux17 MySQL_installation
Linux17 MySQL_installationJainul 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 2007eLiberatica
 

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 Stacknuppla
 
WEBPACK
WEBPACKWEBPACK
WEBPACKhome
 
Containerizing ContentBox CMS
Containerizing ContentBox CMSContainerizing ContentBox CMS
Containerizing ContentBox CMSGavin 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 minswpnepal
 
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 FeaturesNuvole
 
WordPress Optimization & Security - ThinkVisibility 2012, Leeds
WordPress Optimization & Security - ThinkVisibility 2012, LeedsWordPress Optimization & Security - ThinkVisibility 2012, Leeds
WordPress Optimization & Security - ThinkVisibility 2012, LeedsBastian 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 20minsChandra 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 PickinOrtus Solutions, Corp
 
WordPress Optimization & Security - LAC 2013, London
WordPress Optimization & Security - LAC 2013, LondonWordPress Optimization & Security - LAC 2013, London
WordPress Optimization & Security - LAC 2013, LondonBastian Grimm
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Bastian 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 BeyondDrupalDay
 
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 3Drupalcon Paris
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreVikalp 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 WordPressImran 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 FinlandImran Sayed
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in reactImran 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 RochesterImran 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 WordPressImran Sayed
 
Improving Your Debugging Skills In WordPress
Improving Your Debugging Skills In WordPressImproving Your Debugging Skills In WordPress
Improving Your Debugging Skills In WordPressImran 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 WordPressImran 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 2020Imran 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-ahemdabadImran 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 frontityImran Sayed
 
Build Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyBuild Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyImran 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 ACFImran Sayed
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with ReactImran 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 WordPressImran Sayed
 
React with WordPress : Headless CMS
React with WordPress : Headless CMSReact with WordPress : Headless CMS
React with WordPress : Headless CMSImran Sayed
 
React Workshop: Core concepts of react
React Workshop: Core concepts of reactReact Workshop: Core concepts of react
React Workshop: Core concepts of reactImran 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

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 

Dernier (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 

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