Successfully reported this slideshow.
Your SlideShare is downloading. ×

Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge - Pop-Up Livestream 22nd Feb 2020

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 77 Ad

Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge - Pop-Up Livestream 22nd Feb 2020

Download to read offline

Pop-Up Livestream 22nd Feb 2020

Adapting to Gutenberg could be challenging for PHP developers who have minimal knowledge of JavaScript and React. It’s a paradigm shift and to re-learn how to do what we did with PHP in JavaScript can be overwhelming. You will know about how a php developer, with minimal js knowledge, can build blocks quickly.

How can the php developers survive the amount of technologies to be learnt for Gutenberg? Can creating a custom block be as easy as running a couple of simple commands?

You will know about my personal experiences that helped me build blocks quickly and allowed my clients to migrate to WordPress site, with the power of Gutenberg. ServerSideRender component can simplify creating the editor representation for dynamic blocks. My talk will show how the wp-cli and dynamic blocks can help anyone who wants to create reusable blocks quickly with minimal JavaScript.

Pop-Up Livestream 22nd Feb 2020

Adapting to Gutenberg could be challenging for PHP developers who have minimal knowledge of JavaScript and React. It’s a paradigm shift and to re-learn how to do what we did with PHP in JavaScript can be overwhelming. You will know about how a php developer, with minimal js knowledge, can build blocks quickly.

How can the php developers survive the amount of technologies to be learnt for Gutenberg? Can creating a custom block be as easy as running a couple of simple commands?

You will know about my personal experiences that helped me build blocks quickly and allowed my clients to migrate to WordPress site, with the power of Gutenberg. ServerSideRender component can simplify creating the editor representation for dynamic blocks. My talk will show how the wp-cli and dynamic blocks can help anyone who wants to create reusable blocks quickly with minimal JavaScript.

Advertisement
Advertisement

More Related Content

Similar to Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge - Pop-Up Livestream 22nd Feb 2020 (20)

More from Imran Sayed (19)

Advertisement

Recently uploaded (20)

Fastest Way Of Creating Gutenberg Blocks With Minimal JavaScript Knowledge - Pop-Up Livestream 22nd Feb 2020

  1. 1. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Fastest way of creating Gutenberg blocks with minimal JavaScript knowledge Imran Sayed @imranhsayed 22 Feb 2020 LIVE. LIVESTREAM
  2. 2. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  3. 3. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Need for building custom Blocks?
  4. 4. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Ways of building blocks ES5 ES & JSX Next
  5. 5. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Challenges in building blocks with ES6
  6. 6. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Challenges in building blocks with ES6 ● JavaScript and React have learning curve ● Requires an extra build step for code transformation ● Tooling around JavaScript could be intimidating.
  7. 7. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Challenges in building blocks with ES6 ● ES5 without JSX can run straight in the browser.
  8. 8. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM ES6
  9. 9. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM ES6 ● Import Statements E.g. import { registerBlockType } from '@wordpress/blocks'; ● Arrow Functions. () => {}
  10. 10. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  11. 11. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM React ● Components <RichText>, <InspectorControls>, <TextControl> ● Classes ● Hooks ● State management concepts
  12. 12. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM JSX
  13. 13. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM JSX <p className={ className }> { __( ‘Hello World!’, ‘create-block’ ) } </p>
  14. 14. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  15. 15. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM { "presets": [ "@babel/preset-env", "@babel/preset-react" ], "plugins": [ "react-require" ] }
  16. 16. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  17. 17. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  18. 18. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM There is so much learn??
  19. 19. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM May give up?
  20. 20. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Is there a simpler way?
  21. 21. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Building blocks with minimal JavaScript
  22. 22. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Dynamic Blocks
  23. 23. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Building Dynamic blocks with minimal JavaScript : 1. Using wordpress/create-block
  24. 24. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM @wordpress/create-block ● Officially supported way to create blocks for registering a block for a WordPress plugin. ● Offers a modern build setup with no configuration. ● generates PHP, JS, CSS code, and everything else you need to start the project.
  25. 25. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Generate blocks with create- block
  26. 26. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM todo-list.php
  27. 27. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  28. 28. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM src/index.js
  29. 29. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  30. 30. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM 2. Using WP-CLI
  31. 31. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Generate blocks with WP-CLI
  32. 32. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM movie.php
  33. 33. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  34. 34. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM index.js
  35. 35. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  36. 36. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Adding a dynamic block
  37. 37. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Using dynamic Block - serverSideRender
  38. 38. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Using dynamic Template
  39. 39. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  40. 40. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Movies block - 3 latest movies
  41. 41. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Can we build blocks without using JavaScript?
  42. 42. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM#WCASIA2020 BLOCKS Answer: Yes Blocks ( 5.8+ Pro ) ACF Blocks is a PHP framework that does not require any JavaScript.
  43. 43. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM ● A WordPress plugin. What is ACF? ● Add extra content fields to edit screens.
  44. 44. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Building Blocks with ACF
  45. 45. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM WordPress Block API ● Install packages ● Register Block Server Side ● Register Block Client Side Steps Involved ACF Blocks ● Register Block Server Side acf_register_block_type() ● Create Fields ● Load the template
  46. 46. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Difference WordPress Block API ACF Blocks ● Client Side or Server Side ● Static or Dynamic ● Dynamic ● Server Side
  47. 47. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM ACF Blocks demo
  48. 48. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  49. 49. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Building a brands block
  50. 50. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Step 1: Register Block Server Side function gt_register_block() { acf_register_block_type( $settings ); } add_action( ‘acf/init’, 'gt_register_block' );
  51. 51. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Add Settings $settings = [ 'name' => ‘integration-brands', 'title' => __( ‘Integrations By Brands’ ), 'description' => __( ‘Brand block' ), 'render_template' => 'path/to/brands.php', 'icon' => 'images-alt', 'category' => 'formatting', ‘enqueue_style’ => 'path/to/style.css'
  52. 52. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Step 2: Create Fields
  53. 53. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Step 3: Load block template - brands.php $block print_r( $block )
  54. 54. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM print_r( $block )
  55. 55. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM brands.php
  56. 56. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM brands.php
  57. 57. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM brands.php
  58. 58. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM brands.php
  59. 59. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  60. 60. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Demo in Editor
  61. 61. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  62. 62. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Demo in Front end
  63. 63. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  64. 64. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Live Preview and Edit Mode
  65. 65. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  66. 66. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM More blocks example
  67. 67. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  68. 68. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Creating blocks with JavaScript Vs ACF
  69. 69. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  70. 70. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  71. 71. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Block generation and other tools ● WP-CLI ● @wordpress/create-block
  72. 72. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM Ways of Building Blocks ES5 ES & JSX Next
  73. 73. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  74. 74. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM
  75. 75. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM WordPress Training Program
  76. 76. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM learn.rtcamp.com
  77. 77. #WCASIA2020 BLOCKS #WCASIA2020 BLOCKS LIVESTREAM

×