Arkansas
Account created on 31 October 2011, over 13 years ago
  • Senior Software Engineer at Red Hat 
#

Merge Requests

More

Recent comments

🇺🇸United States slucero Arkansas

Verified internally. Will be merged for inclusion in the 1.2 release.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.2 release.

🇺🇸United States slucero Arkansas

I've uploaded a new branch, 3511525-disable-reusable-blocks--parameter, that supersedes the previous one with an alternative direction of implementing the config for enabling reusable blocks as a service parameter instead of config value. I've redirected to this direction instead for the following reasons:

  • A service parameter obscures the functionality more effectively than a new setting in the configuration form requiring continued usage of the functionality to be very intentional.
  • Using a service parameter that's not heavily exposed also makes the process easier for phasing out the functionality altogether in a future release.

This new service parameter and related checks throughout the codebase default to disabling reusable blocks unless a site explicitly opts into enabling them through the use of the service parameter. This will make it easier to move toward removal altogether as part of 📌 Remove Reusable Block Support Active .

Included in this branch are the following changes:

Assuming the new enable_reusable_blocks service parameter is not set or is explicitly set to FALSE,

  • Reusable block derivatives will not load in order do address the originally reported performance issue
  • The following routes and related pages are no longer accessible or shown in menus:
    • /admin/structure/block/patternkit
    • /patternkit_block/{patternkit_block}
    • /patternkit_block/{patternkit_block}/edit
    • /patternkit_block/{patternkit_block}/delete
    • /patternkit_block/add
    • /patternkit_block/add/{pattern_id}
  • Existing reusable blocks originally created through the layout builder interface and placed in layouts should continue to render as expected
  • Existing reusable blocks originally created through the Block Structure > Patternkit Library interface and placed in layouts will not render
  • A status warning has been added to the requirements page if reusable blocks existing within the database

If the new service parameter is enabled, existing functionality should be maintained, but the status warning added to the requirements page will still be reported.

The new service parameter by be enabled on a site by adding the following to the site's services.yml file, typically found in sites/default/services.yml:

parameters:
  patternkit.config:
    enable_reusable_blocks: true
🇺🇸United States slucero Arkansas

slucero changed the visibility of the branch 3511525-disable-reusable-blocks to hidden.

🇺🇸United States slucero Arkansas

slucero created an issue.

🇺🇸United States slucero Arkansas

This has been reviewed an tested internally. It is now approved for merging.

🇺🇸United States slucero Arkansas

slucero changed the visibility of the branch 3516087-update-json-editor to active.

🇺🇸United States slucero Arkansas

slucero changed the visibility of the branch 3516087-update-json-editor to hidden.

🇺🇸United States slucero Arkansas

I've now finished addressing most of the code review feedback an pushed up several improvements to the MR that should make it significantly more robust and user-friendly in the case of a failure.

🇺🇸United States slucero Arkansas

The change here looks good to me. We'll just do some light regression testing to make sure token replacement is still working as expected, and then we can get this merged in.

🇺🇸United States slucero Arkansas

I've pushed up some work here to build on top of the patch from #6 and #7. My primary concerns with that implementation was a number of assumptions that are potentially site-specific:

  • The selected media entity has a field named field_media_image
    • This is the default name for an image media type, so the assumption isn't terribly risky
  • The target pattern has several additional fields at the same level for population:
    • alt
    • width
    • height
  • These additional fields are not represented on the committed image pattern and would need to be added for testing and validation.

In the new commit I've added, the field name is addressed by looking it up from the media entity's field configuration. Regarding the assumed schema field names, I've built on the existing logic looking for the src attribute and allowed it to add the values for the additional fields and fail silently otherwise.

Since this only affects the image url solution, and not the media token solution that is now recommended, I'm not too concerned about adding additional testing and refactoring the example patterns to automate tests for this.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.2 release.

🇺🇸United States slucero Arkansas

The work for this looks good, so I'm going to go ahead and merge it for inclusion in the 1.2 release. Thank you for the contribution!

🇺🇸United States slucero Arkansas

slucero made their first commit to this issue’s fork.

🇺🇸United States slucero Arkansas

I've pushed up some work that adds a new configuration option to disable loading these derivatives and further disables the implementation of reusable blocks altogether. To help move toward disabling support for these altogether, the option is currently getting set to FALSE by default and outputs a warning during the update hook if there are any reusable blocks present in the system.

Remaining work includes:

  • Determine a migration path and implementation plan for sites currently using reusable blocks
  • Add automated test coverage for each option
  • General functional testing to make sure everything continues to work as intended
🇺🇸United States slucero Arkansas

slucero made their first commit to this issue’s fork.

🇺🇸United States slucero Arkansas

Reviewed and tested internally. Merging for inclusion in the 1.2 release.

🇺🇸United States slucero Arkansas

Revert previous update based on documentation here with automatic service alias.

🇺🇸United States slucero Arkansas

Correct typo in original service reference for decorator pattern.

🇺🇸United States slucero Arkansas

Merged for inclusion in the next release.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 9.1.1 bug fix release.

🇺🇸United States slucero Arkansas

@krisahil, good catch and thank you for opening up the MR to address it already! That looks good to me. Let's go ahead and get it merged in and I'll cut a new 1.0.1 release so it's available for anyone who hasn't started the process to upgrade to 1.0 yet.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release.

🇺🇸United States slucero Arkansas

Adding testing instructions to the summary.

🇺🇸United States slucero Arkansas

slucero changed the visibility of the branch 3468609-patternkit-1.0-release to active.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0. release.

🇺🇸United States slucero Arkansas

I was able to both reproduce this and confirm the fix. Good find and thanks for the fix!

🇺🇸United States slucero Arkansas

I've added some tests to the MR for covering the new code changes, and everything looks good to me for moving forward with it. Unless I hear otherwise from anybody I'll get this merged in a couple of days.

🇺🇸United States slucero Arkansas

slucero made their first commit to this issue’s fork.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release.

🇺🇸United States slucero Arkansas

This has been resolved in more recent releases.

🇺🇸United States slucero Arkansas

Closing as no longer relevant.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release: 🌱 Patternkit 1.0 Release Plan Active

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release: 🌱 Patternkit 1.0 Release Plan Active

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release: 🌱 Patternkit 1.0 Release Plan Active

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release: 🌱 Patternkit 1.0 Release Plan Active

🇺🇸United States slucero Arkansas

Reviewed and approved internally.

🇺🇸United States slucero Arkansas

Merged for inclusion in the 1.0 release.

🇺🇸United States slucero Arkansas

Tested and confirmed internally. I'll get this merged in momentarily.

🇺🇸United States slucero Arkansas

After further testing, I've uncovered that the existing behavior (the currently proposed default) is not terribly helpful for several reasons:

  • When patterns are used in the default layout for a content type, the cache tags present for it don't matter as much for invalidation during pattern updates since the related updates to the default layout invalidate a tag like config:core.entity_view_display.node.page.default which is present on every page of that content type using that display mode regardless whether it is overridden. Due to this, every page of that content type will be invalidated regardless.
  • When used on overridden layouts, including the invalidation of the patternkit_pattern:<id> cache tags will result in all pages containing this pattern being invalidated when a single instance of the pattern is updated. These other blocks won't show any changes, however, since they still point to the prior revision of the pattern entity. The same behavior is true for pattern:<asset_id>cache tags which also get invalidated on update with this setting enabled.

Based on these findings, I'll be updating the default value for this new setting to FALSE which will represent a change in behavior for most sites already. This change should be for the better, however, by bringing cache invalidation more in line with visible changes to the content.

🇺🇸United States slucero Arkansas

slucero changed the visibility of the branch 3469294-make-patternkit-pattern to hidden.

Production build 0.71.5 2024