 All right, let's get started a little bit about me Moshe Weitzman. I'm a long-time Drupal contributor like the whole time Started in 2001 I am a freelancer doing Drupal architecture working on continuous integration and developer workflows as well. I also started a small Drupal consulting firm around data migration into Drupal and co-wrote the migrate module and some other things that I Maintained there and started groups dot Drupal dot org and the organic groups module Both of those have long moved on for my care, but You'll find my Twitter address there, too Okay, so Devel Started in 2003 It turns eight meaning the version eight there that might have been a little too clever Is coming out this week And it's quite an old project started in 2003 just a little while after Dries released version 1 which was January of 2001 and It has been ported and used many many times over the years Downloads three and a half million And 20,000 sites report back that they're using it and that's despite us recommending it be disabled on production sites They're all stage and dev, but they're still reporting their usage sure Here's the usage charts You can see that the triple eight usage is still far lower than on prior versions But growing It really has been a whole community Pitching in and porting this module over the years and developing it Here's a look at the maintainers from the read me Want to give a real shout out to all these folks they put in lots of hours writing and reviewing patches and Keeping develop and top shape for all of us developers The focus of the talk today is about things that we have added or removed or changed in Drupal 8 Since that's the release that's coming out this week There were two new modules added to develop sub modules One of them is called kint and the other one is called web profiler We're gonna see more of those in a little bit And one that we removed is specifically develop node access, which Is a great module it gives you information on the grants that are in your database around node access and helps you debug Access problems But we weren't able to really maintain it at the high level that we expect so we moved it into contrib You're welcome to work on it there and use it Okay, so the first major triple eight integration point is the toolbar module Devel surfaces a new top-level item in the toolbar If you click on that You have slightly different behavior depending on how your toolbar set up if it's in vertical mode you will see You'll able to expand and see all of the major pages that Devel Offers, so that's a really good way to see all that you can do with Devel And you can also in horizontal mode just hover over that and your expanding menu comes down Okay, so the first major new page for Drupal 8 is called container services Here you can search for any service that Drupal 8 offers and learn more about it In this screenshot. We're showing the service names in the left column and the corresponding class in the right column We have another tab here called parameters Which are you know cousins of services? They are defined in the same services. Well YML file of Drupal 8 Services are really like a major innovation in Drupal 8. It's a feature that we Inherit from symphony and it's definitely like a clean way to Expose your code for use by other modules and other parts of the system Here's our debugging page for the routing system All of the routes on your system are exposed on the left-hand side here with their names the corresponding path What methods are allowed on that route and then Not on the screenshot, but a little further to the right. There's a link for viewing the details of the route So you don't have to grab the code for this stuff and look in what routing YML files If it's more convenient you for you to do it in a browser We provide that here yet another major system in Drupal 8 the event system Provides some of the similar functionality that the hook system has traditionally maintained in Drupal Here we have a listing of the major events that your system exposes and the Subscribers to those events. Okay, so you can see the second one the config delete event There are a bunch of subscribers on this system to that event you could go ahead and Click on these the yeah in this screenshot. You can't see it, but these are clickable links and they open up in your editor Your code editor So there's some nice integration there The configuration system is another big innovation in Drupal 8 and Devel has embraced that one specifically what we do is tell you all the config names in your system let you search for the ones you care about and Let you edit them by hand using a web browser So this is useful if you're just doing some development Less useful for like stage and prod But I think it makes sense locally to do this sometimes if you understand the structure of the YML file You need to just change the value. This is a great place to do it And then you can go ahead and export your configuration after that commit it to get push it along Whatever you need to do The old name for this functionality was called the variable editor if people use that in prior versions Really similar the state editor It lets you view the name value pairs in the state system and lets you edit them This has no corresponding Drupal 7 Feature, this is a new feature. There was no state system before or I guess it was also the variable system in a terribly conflated way So there are many more pages in a similar vein To these here's the list of the pages that you will find if you look at the toolbar integration I can talk about more of these and show more of these later But I want to give an overview of all that Devel is doing in Drupal 8 Folks have been curious if the switch user block is still part of Devel and D8 it is If you guys haven't used it switch user is like a way to quickly masquerade as Another user on the site. So given sufficient permissions You will be offered a list of users to Essentially in visit, you know quickly log in as So in this screenshot here the current user is admin his name is bolded that indicates that you're logged in as admin and You can easily log in as dummy one or dummy two by clicking on those links and then presumably log back into your Main account whenever you're done testing how the site looks like like as another user There was a fair amount of work To provide useful tools for twig developers Or theme developers who are in the twig system Twig is a pretty flexible system. It lets you to define your own twig functions And twig filters and so Devel has taken advantage of that There's three new functions available when you install the Devel module Devel dump develop message develop breakpoint. Let's take a look at them so at the top you have a Screenshot of your code and it shows you how to use the Devel dump function Fairly straightforward inside of those braces Devel dump will Will print out whatever content you pass to it and This particular function develop dump is analogous to the KPR function in develop You've used that before which is stands for kint prr kint print k kint print yes And You're welcome to just pass no parameters and then you get the whole all the variables that are available to to twig Here's what it looks like when you do that You get a massive array as Drupal's fond of doing And you can see what parts of it you need in twig Devel message is the next function that develop exposes for twig developers It's similar to the one we just saw develop Devel dump will drop your Nasty array anywhere on the page where you use that function Devel message is the equivalent of Drupal's of develop set message or DSM or DPM It puts your debugging stuff into the message section of the page So it's a little bit more predictable where it's going to show up and how it's going to show up And it won't break the rendering of other parts of the page. So feel free to use develop message Here we see similar output or identical output, but it's in the message section All right, you can sort of tell that by the green bar on the left and the check Checkmark that says it's an okay type message and not an error message develop breakpoint So this is really handy for twig developers This does What you might be used to with PHP breakpoints? It forces the PHP interpreter to stop Okay, just like you might do in one of your classes or your hooks in other parts of Drupal You can do that in your twig as well and Just to note that this requires the X debug PHP extension Okay, so I want to cover the new dumper system for Drupal 8 You might recall that we've had DSM for a long time and It traditionally or at least in Drupal 7 use the crew mo Extension in order to do pretty printing of a big arrays Crew mo is not well maintained. So that's out for Drupal 8 Ironically the maintainer just arrived and perhaps is maintaining it again, but for now, it's not part of of develop Instead we have a sub module called kint that you may want to try out It's it comes right with develop and it does the pretty printing of arrays The way it does so is the kint module exposes a Dumper plug-in so develop has a plug-in manager and a whole plug-in system for how modules can dump out variables to the screen There's a really simple one that's on by default That like does more of a plain text printing of your variables that one's called the doctrine doctrine plug-in But you might want to try out the other ones. There's kint once you enable the sub module or With other Dependencies enabled you can have the symphony var dumper develop a dumper plug-in or you can have There's Drupal variable chrome PHP and fire PHP I think are the other ones So there's lots of ways to get your variable printouts now And if you're unhappy with the ones that we have put into deval you can write a control module Expose your own develop dumper plug-in from there There's a settings page for develop where you pick which Dumper is active for your site Those dependencies that you need for like symphony var dumper you will want to install Composer packages in order to make those available. Okay, that's the last bullet here Here's the list that I came up with before doctrine is the default as I said Lots of other interesting ones here This is what the doctrine dumper looks like by default just a nested Presentation of variables, okay Drupal variable plug-in a little bit less nested Seems like Fancier is the symphony var dumper one. This is the one that I see most people using actually and The the way the easiest way to get this one is to enable a controlled module called var dumper All right, there's sort of sufficient Dependencies involved with this one that it doesn't come just with develop All right, so you need this var dumper module Once you do you get a couple cool new features Namely the class names like what I was showing earlier With container services and routing all become hyperlinks Where you can gain more information? And open up your IDE to the right Thanks to the right file in the right line for that class Here's a look at the kint develop dumper plug-in Make sure to try that one out and a little bit about coding your own dumper There's a couple pieces to it One is that you have to write a class Usually that class would extend the develop dumper base like what this class does and You can do that just from your own contriver custom modules. All right in the annotation of your class There's the different properties that you have to describe. It's really pretty simple They really have an ID and label stuff Here's the interface for develop dumper. You have to just describe to the system Or handle events like dump or export or export as rendible So really simple to write one of these plugins. All right, I want to talk about The other new sub module in develop for dribble 8. It's really an outstanding piece of software and If you use the query logger and memory profiler in develop in prior versions Those have been deprecated in favor of web profiler, which does that in a whole lot more so web web profilers raison d'etre is not so much to like Investigate the routing and the container services of your site. It's to get information about a rendered page a single page that would just ran it's going to collect performance and debugging and debugging data about that page request and then it's going to surface it at the bottom of the page So I have a short video that I want to show that highlights the web profiler module This video was made by Luca Lusso who's the maintainer of this web profiler module in develop Super software developer. He's from Italy. Hopefully you can like understand his accent and follow his great Video here What profiler has been added to devil to replace the query logger and memory profiler But it collect and expose way more information After we enable the module we can see this toolbar at the bottom of every HTML pages Every widget has a data collector that's actually collects data from some parts of Drupal 8 for example it collects data about the request or time and memory from time performance database queries logged in user views blocks forms active extensions cache or assets The tool bar just contains an Overview of the data if we click on every of this widget on the tool bar We go to the dashboard which contains all the information collected for example This is the database dashboard with show us every single query with information about time and with the possibility of Swap placeholder for example and to filter the queries Collected by the web profiler for this page here on the left We have a list of every dashboard enabled. We can see for example the PHP configure Dashboard the request dashboard with that we have information about the request the cookies the headers sent and received from from the browser the access Check service that allow us to see this page for example information about Timeline we show which show us Every single component that Drupal 8 uses to build this page Divided in service to plate and event listener for example performance timing from the front-end users views blocks forms Extension enabled the cache system Cache hit and miss for instance and the assets which of us shows us every JavaScript and CSS used on the collected web page There are way more data collectors we can enable we can go to the configure web profiler page and here we have the possibility to choose When to purge the Collected profiles for example when the cache clear we can choose which storage back-end To use to store the profile data for now We have a file storage and the database storage which pages to exclude the web profiler and Which data collector enabled we have assets blocks cache that the collector configuration management data collector which show us Many data are read from the configuration management database devil the events that the collector that show us events executed during the Page render the enable extensions the forms every HTTP calls Made from Drupal to external web service for example every single email sent from Drupal PHP configuration performance time of the front-end the request information about routing Information about which services are used on the page Information about the state API the theme used in the page timeline user and use From this page. We can also configure the IDE settings because every single class name and method name Recognized by the modules is turned into a link that brings us to the configured Editor for example in this case is PHP storm so we can go directly to the correct file and correct line of of this method And we can configure this functionality here We can configure the database settings for example to sort the query log by source of by duration and When I glide a query because this is low and we can also purge the profiles directly from this configuration page in the reports section under the web profiler menu item We find a view with all stored profiles, which is useful But for viewing a past profile and to analyze profiles collected during non-html responses Like API calls for example, just click on the token link To go to the dashboard for that profile. Thank you for listening. And if you have any questions about Profiler, feel free to ping me on Drupal.org on our IRC Thank you. Okay, so web prior web profiler is kind of incredible We've never had that much insight Using just your browser into the page construction of a durable page So, you know the collector system that symphony came up with and the Implementation of different collectors and the whole user experience around that is exceptional in this module So really encourage people to use that and learn about Drupal 8 With this module enabled one thing that Luca didn't get into here is that there is integration with the xh prof module with web profiler You can see here that You know web profiler is good for collecting Drupal data But if you need PHP function level data to do performance Evaluation you're you know as always you're going to need xh prof or it's newer and cooler cousin Tideways Which is available for PHP 7 if You enable the Drupal xh prof module it will go ahead and and work with web profiler to collect and display function level Profiling information a little bit about one of the sub modules called Devel generate in In Devel Drupal 8 This one has been in Devel for quite a while But the architecture underneath changed in Drupal 8 and I'm excited about that I helped get a patch into Drupal core during the 8th cycle Such that fields when they're defined in the system email field telephone field tax field integers that stuff They are now able to generate their own example data All right, so they know What their? Limitations are per instance so if you say that like there can only be three values on a certain select widget or I have an integer field that only expects 0 to 9 All of the generated sample data will be valid for that instance Okay, and Devel has nothing to do with that anymore. It's really about field definition Email modules know how the email field type module knows how to generate sample data for emails and so on and so forth so The upshot of this improvement in 8 is that there's less code in Devel generate We just have to call the generate sample data method on a field and it goes ahead and hands that back and Of course Devel generate now supports all field types, so we don't have to Take requests and fulfill requests for obscure field types. They already should work with you develop generate So that's a nice improvement for Devel generate and for core and triple 8 If you guys haven't used Devel generate just a little bit about what it does If you're building a site and your client hasn't put any data into it This is really handy for just putting Laura Mipson data into your text fields numbers into your integer fields users into your user table and You know Can can populate just about any content type and now your site looks rich And it can help you do theming because there's actual content in there. You can demo it to a client and sort of get your project moving in Advance of actual code of actual content which you actually don't want in the beginning of your project because you wipe your database regularly and so forth so Just a quick pitch for Devel generate Devel generate has two interfaces for actually generating all of this information. You can use web forms There's usual Drupal admin pages for generating and there's also Dresch integration too if you prefer to use the command line it's super fast and easy to generate 50 users and 100 nodes along with three comments and all of that sort of stuff okay, so I guess I'm gonna pause here and Just make it into more of a conversation if people want to talk about Devel Once the questions slow down, I'll probably do a little bit more demoing, but I've I've shown enough and I want to get the questions going if there are any Yeah, if you guys could just line up at the mic that would be awesome so says on so I've been having major front-end performance issues with Kent and if any array, it's of You know above a certain size it literally will just freeze the whole browser Is there any movement to address that issue? There may be a movement I'm not familiar with whether there is or not You know Kent is a third-party project and so I am not following How they're addressing, you know large variables that need to be printed, so I guess I can't really answer that I guess I would add a follow-up then. Is there any consideration of other Crumo like the tools that might be more performant getting that into the bell core. Yeah, I mean I think that we recognize that That people have different needs here and I mentioned one called the symphony var dumper I'd encourage you to Download the var dumper module which makes that plug-in available and then just go to your develop settings page and pick symphony var dumper Do you know if the web profiler can catch Like drush type commands like can it catch a drush cron run that kind of thing? I Think that that's possible I'm not a hundred percent sure, but I think it can catch requests like that I know for example that it catches non html responses and you can go pick them out from a list I think that Luca showed that there So CLI initiated responses, I'm not sure though I don't see a technical reason why it wouldn't be possible and it would be handy for getting performance about CLI requests So I can see the need for that Actually, I have two questions number one on the switching users Did you ever consider putting in like a link that where you could click on it after you've selected a user that has Lesser permissions just to return to the role instead of having to log out and log back in Yeah, so Yeah, I can see the usefulness of that too It's just that you have to really explicitly override that person's permission set in order to provide such a link because they're not allowed to Do that so you'll in that sense you're sort of half masquerading or Worse your two people at once You are the masqueradee and the masquerader at once and so I can definitely see the user experience benefit of that But I'm a little hesitant to try to Be two things at once on a Drupal page Drupal's not built for that. Okay. Yeah, the other one was is about xh prof You mentioned a Drupal module. Is it a specific Drupal module or just xh prof installed run on the website. Yeah, there's well There's two components to xh prof one is the the Drupal module the Drupal contrived module you'll want to install that and I think that once you install that it Will do a check to see if you have the PHP extension called xh prof or It's alternative tied ways and you have to have one of those for that module to work Do you see that That bottom bar the web profiler. Does that pretty much replace New Relic when you have that installed? Um, I mean is it that kind of I don't think so. I think that New Relic for one thing has like overtime that sort of time series Performance data and so you can look back over the last month and see like it was this release when my performance tanked And you know, I haven't used New Relic in a while So I can't say if the actual request by request date is the same Maybe other people can chime in and say what the differences might be But I think definitely that's sort of time series aspect is substantially different All right, thank you. All right. Yeah, that's a good question And if people want to share like how they're using Devel or tips or anything like that that that I'm welcome for that too It's a small tip that I have to share with using kint. I read it. I think in the blog of Mike and yellow Many people make the mistake of clicking on the arrow Which seems to make sense and in my experience that what takes minutes of loading everything Instead if you try I think it's clicking the title That gives like a very short array of what you really wanted to see Okay, so beware where you click There maybe there's a user experience lesson in there But click on the title of the thing you want and not the arrow next to it the arrows like an expand all Right The plus yeah, that's better. Not it's not an arrow. It's a plus. Yeah, don't do the plus though Do the title? Here That's bad. He says yes, we'll develop help identify missing dependencies I Don't think so now Drupal has many things that calls dependencies But for the things I'm thinking of Devel really is in part of that you know the first thing about dependencies is Composer dependencies right your modules depend on composer libraries being available and Drupal dependencies Drupal module dependencies that can depend on each other so Devel doesn't really participate in that system both composer and Drupal have systems that enforce those dependencies So yeah, it doesn't it does a lot of developer-ish things for you But there are other developer things that handle those two cases anyway Yeah, okay. Oh, yeah, go ahead So what profile profiler when you disable it what happens to the data does it remains in the database It's destroyed or what happens to that data? Yeah, that's a good question So in the settings for web profiler you have the option of storing your data as files in your file system Or in your database Okay in addition you have some Control over when that data gets purged All right, there was a checkbox that we saw in the movie that said purge on cash clear That's a relatively easy way to make sure that you don't have thousands of these lying around if you check that box then You'll just have sort of the most recent ones around which is typically all you need and There are other systems that do more interesting things by saving runs Blackfire is another profiling tool. That's pretty cool And you can have like a model run and that gets saved and you compare subsequent runs against the model run That's not really what web profiler is all about That's kind of a performance Optimization specific tool that is quite cool Yeah Okay, so let's take a look at these web pages Here I have a Drupal 8 site with Devel installed I have clicked on the Devel item in my toolbar and I have The toolbar in this vertical mode, so it's exposing all of these pages that Devel offers Okay The one it's had since disco is config is cash clear There's an easy way to kill clear your cash You'll remember a screenshot about the config editor Here it is in action. We can take our aggregator settings config object We can read exactly what's in it here. This is the yaml and we can change a value if we're so inclined save it and Then this current website has different configuration Presumably you'd want to export that to config it to get and go ahead with the the fancy workflow that we have in Drupal 8 this one came up in the introduction as well container services you can click here and filter somehow Anyway here. He oh, yeah, it is filtering. These are the user ones user off user authentication the corresponding class and lots more information about this Service user off Okay, so this is really the equivalent of browsing its services yml file Instance parameters. I honestly have not looked in here There's a lot of stuff in here that I'm not sure what it does so the route Detail in this case is like the current route that we're looking at In this case it happens to be Devel's own page But you can change this query string param path and put any value you want So if you want to see the routing definition for Is that a path still No, I picked so I just put a UID maybe slash before user. Oh, yeah, thanks everyone Okay, so for this route here's the Detail, okay, I Guess it's it's more informative than the routing yml file, which is a definition only this has values in it so you can see the value of two has made it into the The the actual user object is here and its UID is to and so forth and so on so the the system has already Translated the two in the in the path to its corresponding object Information about the entity system Right here. Here's a big array. This is the action Entity There's lots of entities in the system configuration entities. You can learn more about them here the quite traditional execute PHP text field remains in Devel Fortunately, it does not remain in Drupal core itself that got removed in Drupal 8 But if you were a fan of that feature, it's available for you and develop which is probably where it belonged the whole time Here's a field information report It's a better and different presentation of the same information core provides a field report in the Reports section of the admin system Here's one a little different all your field definitions And their instances and so forth and so on are here Yeah, there's a lot of stuff here You know every so often in addition to clear and cash you want to rebuild your menu system That's here Reinstalling a module can be handy if its configuration or its data is messed up you can go ahead and Just click which modules you want to reinstall and they will get uninstalled and installed for you cleanly So that can be handy Again, use it wisely. You'll definitely you lose all the data that was being saved by that module by design Quickly run Cron and see what that's going to do for you Devel has had that for a long time. It continues to offer that and Little bit of information about the session Namely the name and value So definitely don't copy and paste and send it to your friends This is secret information at least the value part is And Just some more variable information about what is stored along with the current session So that's a look at Devel I think We have a few more minutes. I can potentially Show you some other stuff. Let's See if that works out. Oh, I see Different things than you see. Okay, let's try to move this up I'm enabling the web profiler module There it goes Maybe move it down to here Okay, so If I take a regular old page here Maybe this page. Let's see if I get a web profiler at the bottom Make sure you can see the bottom There it goes Okay, so On the left hand side it tells you what version of Drupal you're running which is handy Here I'm running a very recent version And you know, there's some pretty interesting stuff here. Namely what git commit I have checked out For the current code base is written right here So it's clearly doing a little git command To find that out. So that's super nice. Whoa, there's The actual commit message if you hover over it That is like good service right there Thank you, Luca Okay, and a way to get involved Okay, so Here's like the the list of pages that you can go to that develop offers Information about your PHP environment Right here, you can see which key PHP extensions I have enabled I have the X debug enabled here Definitely recommend that one for all you developers out there That's how I solve hard bugs is by stepping through them in the debugger That's how I learned Drupal. So Definitely use a debugger instead of printing things all over the place I know I showed you ways to print variables, but That's not really the way you can deal with difficult bugs Okay The current route name for the page you're looking at here in this case. It's entity dot user dot canonical It's going to be a little hard for people in the back to see this. I apologize and Just like develop is always done your sort of memory snapshots here of memory available and memory used not in that order and The front-end timing for this request, which is pretty interesting DNS lookup was really fast TCP was fast time to first bite was slow You know, I had just enabled a module For this request. Let's see if I do it again if it's faster. Yeah, that was definitely faster 739 milliseconds for this request. So that's in the neighborhood of reasonable for Drupal these days and the number of queries and You'll remember that Luca clicks on these collectors and you get lots more detail When you hover over these collectors, it's just summary information. There's lots more detail behind them So go ahead and do that when you get a chance Anyone have a question on their minds right here go ahead. I didn't hear too well all of the article Routes that yeah, there isn't available routes That was current route, but I think that there's another one which is routes info Yeah, this is all of the available routes User switch is a block Yeah, so I have disabled that block on the current install But definitely look at your blocks and you'll find a couple blocks related to develop there um The question was does this work better with one debugger over the other? um Yeah, we have to define debugger. I guess but uh, if you mean the uh, dumper plugin Um, I think the ones that that most people are using is that var dumper plugin Um, if you're talking about like xdebug debugging That's really the one that everyone uses is xdebug Um, so yeah, it takes a little effort to get it installed on your system. It's a php extension So you have to interact with your environment of it, but it's definitely worth it Um, and it works really well with php storm and net beans and other things you might be using So definitely recommend that one All right. Well, let's break there. Um, feel free to come up and talk more about develop. Thanks for coming everyone And as you've been hearing all day, um There are sprints first time sprinter workshop Mentored core sprint general sprints join us on friday for those and uh, don't forget to um rate the session All right. Bye. Bye