Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/#64: Empty regions verification optimization #124

Merged
merged 8 commits into from
Jul 12, 2024

Conversation

GyD
Copy link

@GyD GyD commented Jul 11, 2024

This pull request relates to BOSA_0100-358 (JIRA issue) and contains Yves's (@GyD) attempt to improve the performance of Kiso.

  • The has_{region} functionality is kept so theme using it still can use it. Functions used to check if region is empty are kept but adapted so theme using it still can use it.
  • A per region variable page_{region} is introduced for future themes, that variable store the rendered output of the page.region so it can be called in theme without re-redering the region again,
  • A function _kiso_render_region() is introduced to avoid calling \Drupal::service('renderer')->render($region); each time but also not mark the region as rendered since the region is not passed by reference. This way if you need to alter region content after kiso_preprocess_html() and kiso_preprocess_page() it still behave as Drupal core.

@rutiolma rutiolma requested a review from smillart July 12, 2024 07:38
Copy link
Collaborator

@rutiolma rutiolma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Collaborator

@smillart smillart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment added regarding the kiso_preprocess_html() function that contains a potentially unused $variables['page_tools'] variable. @GyD Could you please take a look? Thanks!

@GyD GyD requested a review from smillart July 12, 2024 11:51
@smillart smillart changed the title #64 empty regions verification optimisation Bugfix/#64: Empty regions verification optimization Jul 12, 2024
@smillart smillart added the bug Something isn't working label Jul 12, 2024
@smillart smillart added this to the Kiso (基礎) 3.0.3 milestone Jul 12, 2024
@smillart smillart linked an issue Jul 12, 2024 that may be closed by this pull request
@smillart smillart merged commit 41561d9 into openfed:3.0.x Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for empty regions directly in twig file for better performance
3 participants