49
DEVEL D8 - Release party

Devel for Drupal 8

Embed Size (px)

Citation preview

Page 1: Devel for Drupal 8

DEVEL D8 - Release party

Page 2: Devel for Drupal 8

INTRODUCTION

Page 3: Devel for Drupal 8

ABOUT ME

➤ Luca Lusso

➤ Senior software architect at Wellnet - Italy

➤ Teacher for www.corsidrupal.it

➤ (co-)mantainer of Devel, Vardumper, Monolog, XHProf, …

➤ @lussoluca on Twitter

➤ lussoluca on drupal.org

Page 4: Devel for Drupal 8

DEVEL

Devel module turns 8!The project began in 2003. At that time Drupal version was 4.1

Now it has reached more that 3.500.000 downloads and it runs on more than 200.000 websites.

The actual Drupal 8 version is 1.0-RC1, the next will be the 1.0 stable!

Page 5: Devel for Drupal 8

DEVEL USAGE

Page 6: Devel for Drupal 8

MAINTAINERS

Page 7: Devel for Drupal 8

DEVEL

We’ll release the first stable version very soon!So let’s see the new shiny features of Devel for Drupal 8.

Page 8: Devel for Drupal 8

INCLUDED SUB-MODULES

Page 9: Devel for Drupal 8

NEW SUB-MODULES

➤ kint

➤ webprofiler

Page 10: Devel for Drupal 8

REMOVED SUB-MODULES

Devel Node Access -> now in it’s own module at https://www.drupal.org/dna waiting for a full release for D8. Then it will be added back to Devel.

Page 11: Devel for Drupal 8

CORE INTEGRATIONS

Page 12: Devel for Drupal 8

CORE INTEGRATIONS

Drupal 8 integrates a lot of modules that in Drupal 7 were contrib.

The new Devel leverages those modules to provide information and new features to developers.

Page 13: Devel for Drupal 8

TOOLBAR

Page 14: Devel for Drupal 8

TOOLBAR

➤ Devel is now directly integrated into the core Toolbar module

➤ Visible links are configurable

➤ When in vertical mode the Toolbar shows links to all the available features

Page 15: Devel for Drupal 8

SERVICES, ROUTING AND EVENTS

Drupal 8 adds a lot of new concepts and structures that developers needs to understand in order to build new modules.

Devel now provides report pages for services, routing, events and many more.

Page 16: Devel for Drupal 8

SERVICES, ROUTING AND EVENTS

Page 17: Devel for Drupal 8

SERVICES, ROUTING AND EVENTS

Page 18: Devel for Drupal 8

SERVICES, ROUTING AND EVENTS

Page 19: Devel for Drupal 8

MANAGE CONFIGURATION AND STATE

Goodby Variables API, welcome Configuration Management System and State API!

You can use Devel to inspect and edit both systems.

Page 20: Devel for Drupal 8

MANAGE CONFIGURATION AND STATE

Page 21: Devel for Drupal 8

MANAGE CONFIGURATION AND STATE

Page 22: Devel for Drupal 8

ALL FEATURES➤ Cache clear ➤ Config editor ➤ Container Info ➤ Current route info ➤ Element Info ➤ Entity Info ➤ Events Info ➤ Execute PHP ➤ Field Info ➤ PHPinfo() ➤ Rebuild Menu ➤ Reinstall Modules • Routes Info ➤ Run cron ➤ State editor ➤ Theme registry ➤ View Session

Page 23: Devel for Drupal 8

SWITCH USERS

As in Drupal 7, Devel provides a block that allows a quick switch between users.

Page 24: Devel for Drupal 8

SWITCH USERS

Page 25: Devel for Drupal 8

TWIG EXTENSIONS

The Twig engine in core allows module developers to add new functions and filters to be used in templates (http://twig.sensiolabs.org/doc/2.x/advanced.html).

Devel adds three new Twig functions for template developers:

➤ devel_dump($var)

➤ devel_message($var)

➤ devel_breakpoint()

Page 26: Devel for Drupal 8

DEVEL_DUMP

Prints a complex data structure in a pretty way, the same as PHP function kpr().

Without arguments devel_dump display the full Twig context.

Page 27: Devel for Drupal 8

DEVEL_DUMP

Page 28: Devel for Drupal 8

DEVEL_MESSAGE

Prints a complex data structure in a pretty way in the message area, the same as PHP function dpm().

Without arguments devel_message display the full Twig context.

Page 29: Devel for Drupal 8

DEVEL_MESSAGE

Page 30: Devel for Drupal 8

DEVEL_BREAKPOINT

Forces the PHP interpreter to stop the same way as setting a breakpoint in an IDE.

Available variables are in $context array. Actually it works only with xDebug.

Page 31: Devel for Drupal 8

DEVEL_BREAKPOINT

Quick live demo

Page 32: Devel for Drupal 8

DUMPERS

Page 33: Devel for Drupal 8

DUMPERS

Devel now provides a way to replace the tool used for formatting and displaying the variables inspected through the debug functions.

Dumpers are implemented using the new plugin system in core.

Some of these plugins require external libraries for to be enabled. Those libraries have to be installed with Composer.

Page 34: Devel for Drupal 8

AVAILABLE DUMPERS

Doctrine debug (the default one)

uses Doctrine\Common\Persistence\Proxy\Debug class

Drupal variable

uses Drupal\Component\Utility\Variable class

Symfony var-dumper

uses Symfony\Component\VarDumper\Dumper\HtmlDumper class

ChromePHP

uses the ChromePhp debugging tool

FirePHP

uses the FirePhp debugging tool

Kint (in a sub-module, needs to be enabled)

uses Drupal\kint\Plugin\Devel\Dumper\Kint class

Page 35: Devel for Drupal 8

DOCTRINE DEBUG

Page 36: Devel for Drupal 8

DRUPAL VARIABLE

Page 37: Devel for Drupal 8

SYMFONY VAR-DUMPER

Page 38: Devel for Drupal 8

SYMFONY VAR-DUMPER

If vardumper module is present and enabled the class used by the dumper became:

Drupal\vardumper\Plugin\Devel\Dumper\VarDumper

which provides more integration with Drupal data structures:

➤ class names becomes links to the relative class in IDE (if configured)

➤ user roles becomes link the role edit page

➤ more to come…

Page 39: Devel for Drupal 8

KINT

Page 40: Devel for Drupal 8

ADD A DUMPER

Dumpers are plugins, contrib modules can add new dumpers to the system:

ExampleDumper.php has to be in the Plugin\Devel\Dumper\namespace

Page 41: Devel for Drupal 8

ADD A DUMPER

Every dumpers needs to implement the DevelDumperInterface interface, or extend the DevelDumperBase class:

Page 42: Devel for Drupal 8

WEBPROFILER

Page 43: Devel for Drupal 8

WEBPROFILER

The old Devel query logger and memory profiler has been removed in favour of a new sub-module: Webprofiler

Page 44: Devel for Drupal 8

REALTIME DATA

The report pages that Devel shows about services, routing and so on, lists all data available in a Drupal website.

Webprofiler instead collects data about the rendered page, so it is useful to measure performance data and to debug every single response.

Page 45: Devel for Drupal 8

AVAILABLE DATA COLLECTORS - 1

➤ Assets

➤ Blocks

➤ Cache

➤ Config

➤ Database

➤ Devel

➤ Events

➤ Extensions

➤ Forms

➤ Http

➤ Mail

Page 46: Devel for Drupal 8

AVAILABLE DATA COLLECTORS - 2

➤ PHP Config

➤ Performance Timing

➤ Request

➤ Routing

➤ Services

➤ State

➤ Theme

➤ Timeline

➤ User

➤ Views

Page 47: Devel for Drupal 8

WEBPROFILER

Quick live demo

Page 48: Devel for Drupal 8

INTEGRATION WITH XHPROF

Webprofiler collects high level Drupal data structure. If we need PHP function level data we need a hierarchical profiler like XHProf (or Tideways for PHP > 7.x)

The Drupal XHProf module adds a new data collector for Webprofiler

Page 49: Devel for Drupal 8

CALL FOR VOLUNTEERS

Do you want to contribute to Devel? We need help for development, testing, documentation, UX.

What are you waiting for? Contact us!