mglaman.dev

Ensuring smart_date works for all versions of Drupal 10 and 11 (mglaman.dev)

At MidCamp a few weeks ago, Martin Anderson-Clutz tapped me on the shoulder to check out a Smart Date issue for compatibility with Drupal 10.2. As of Drupal 10.2, ListItemBase::extractAllowedValues takes an array as its first argument versus a string. The method used to explode a newline separated string into an array for its...

PhpStorm live templates to automate the boring things (mglaman.dev)

I finally took a look at writing a custom live template with PhpStorm. I've used them several times to automate scaffolding a foreach statement or other random suggestions that a Tab keypress leads to automated scaffolded code. But I never really dove in to see how they work or could be customized. Then, I had to fix some of my...

Parallels of typing with PHP and TypeScript (mglaman.dev)

I was listening to the Whiskey Web and Whatnot episode TypeScript, React, and API Issues with Matt Pocock. It made me think about the parallels between PHP and JavaScript/TypeScript typing. If you aren't familiar with TypeScript, it is JavaScript with added types. PHP is loosely typed, just like JavaScript. But PHP also allows...

Improving Simplytest's maintainability (mglaman.dev)

Things have been pretty quiet on the Simplytest front. But I want to bring a fresh round of changes that will make it an easier project to maintain. The Simplytest development workflowIn 2021, I spent time helping Adam Bergstein complete the project's modernization off of Drupal 7. We migrated the code from a self-managed...

Profiling Drupal AJAX requests (mglaman.dev)

One of my favorite development tasks is performance engineering. I love taking an application and analyzing it to increase performance. Application performance monitoring (APM) tools like New Relic and Blackfire.io are tools every developer should have in their toolkit. New Relic is for passive performance monitoring of your...

Using jq with Drush to inspect state values in Drupal (mglaman.dev)

Drupal has a key-value database table that stores information about the current environment. The values stored are serialized PHP objects or arrays. That makes inspecting them nearly impossible by just querying the database. Luckily, Drush provides a state:get command for retrieving those values. This command unserializes the...

Dependency injection anti-patterns in Drupal (mglaman.dev)

Whenever I have done an audit for a Drupal codebase, one of the first things I manually review and profile is dependency injection anti-patterns in custom code and any contributed modules used. The anti-pattern isn't for accessing services statically through \Drupal: service. These anti-patterns live within the class's...

Improving the Drupal theme starterkit and theme generation experience (mglaman.dev)

Wanting to follow up on our work at MidCamp 2023 with the Development Settings form, Mike Herchel wanted to jam on another issue to improve the life of frontend developers. Drupal provides a way to generate themes from starterkit themes. Drupal core provides the Starterkit theme, and contributed themes can also mark themselves...

Can we use concurrency to speed up streamed BigPipe responses in Drupal? (mglaman.dev)

I have been reading The Pragmatic Programmer and just finished the Concurrency chapter. At the same time, I found Nick Gavalas's blog post "parallelizing" php and keeping it simple, which talks about his time at Facebook when they developed the concept BigPipe and pagelets.

Using DDEV snapshots to speed up GitHub Actions workflows (mglaman.dev)

My projects all use DDEV for local development. Regarding end-to-end testing, as part of my continuous integration process, I also use DDEV! This way, my scripts for running Cypress are the same locally and in my CI. Leveraging DDEV in your CI is especially useful if your project has multiple domains, which is harder to...

Profiling Drupal AJAX requests (mglaman.dev)

One of my favorite development tasks is performance engineering. I love taking an application and analyzing it to increase performance. Application performance monitoring (APM) tools like New Relic and Blackfire.io are tools every developer should have in their toolkit. New Relic is for passive performance monitoring of your...

Retrofit: Running legacy Drupal 7 code on your Drupal 10 site (mglaman.dev)

I have had an idea for a few years. It is the greatest yet worst idea I’ve had for four years. Some 400,000 Drupal 7 sites report to Drupal.org through the Update module. Drupal 7's end-of-life is coming on November 1, 2023, and has been a continual topic of discussion.

Factories and dependency injection (mglaman.dev)

Last week I wrote about dependency injection anti-patterns in Drupal. These anti-patterns occur when your service's constructor has logic that interacts with the injected dependent services beyond assigning them to properties. These anti-patterns include creating a new object from a factory or retrieving an object from a stack....

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • rosin
  • thenastyranch
  • Durango
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • cisconetworking
  • Youngstown
  • mdbf
  • slotface
  • osvaldo12
  • GTA5RPClips
  • kavyap
  • megavids
  • InstantRegret
  • everett
  • cubers
  • vwfavf
  • normalnudes
  • tacticalgear
  • tester
  • ethstaker
  • khanakhh
  • modclub
  • Leos
  • anitta
  • JUstTest
  • All magazines