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

Remove the process layer #193

Closed
jenlampton opened this Issue Mar 13, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@jenlampton
Copy link
Member

jenlampton commented Mar 13, 2014

In order to kill the process layer, there are a few things we'll need to worry about

  1. Drupal is full of arrays in preprocess that are flattened into strings in process. I would like to move the flattening of arrays into strings into the template files, using implode() for classes and backdrop_attributes() for attributes.
  • rename $classes_array to$classes (flatten in template)
  • rename $attributes_array to $attributes (flatten in template)
  • remove $title_attributes_array everywhere except dynamic block.
  • rename $content_attributes_arrayto $content_attributes (flatten in template)
  • rename $html_attributes_array, $body_attributes_array, and $item_attributes_array to $html_attributes, $body_attributes and $item_attributes (flatten in template)
  1. There are things that are retrieved late (after preprocess!), in theory, this is so that they can be altered just before the page is rendered. I recommend that we call these things directly from the template files instead.
  • Retrieve the page html head, css, and js directly from template files.
    • print $head; becomes print backdrop_get_html_head();
    • print $styles; becomes print backdrop_get_css();
    • print $scripts; becomes print backdrop_get_js();
    • add print backdrop_get_js('footer');
  1. Color module will need to be reworked to use hook_css_alter instead of _color_page_alter so that _color_page_alter does not need to be called from the process layer for themes.
  • Rework color module to use hook_css_alter instead of _color_page_alter
    • update color module
    • update bartik theme
  1. Anywhere in core that implemented a process hook will need to be evaluated. Can this be done in preprocess instead? If not, why not, and how can that be rectified? Can whatever it is be done from a template file?
  • Remove/replace modules/contextual/contextual.module contextual_process
  • Remove/replace modules/layout/includes/layout.theme.inc template_process_layout
  • Remove/replace modules/user/user.module template_process_username
  • Remove/replace modules/views/theme/theme.inc template_process_views_view
  1. Process layer Removal and docs cleanup
  • Final Removal of the process layer
    • replace array of '$variable_process_phases' with a single phase.
    • Replace loops through '$variable_process_phases' with a single pass
    • Remove any process documentation from theme.inc
    • Remove any process documentation from theme.api.php
    • Remove any @see lines from templates and docblocks that reference process functions.
@jenlampton

This comment has been minimized.

Copy link
Member Author

jenlampton commented Nov 24, 2014

@quicksketch

This comment has been minimized.

Copy link
Member

quicksketch commented Dec 11, 2014

It would be great if backdrop/backdrop#459 (restoring the $html_attributes in page.tpl.php) could be incorporated into this set of changes as well.

@quicksketch

This comment has been minimized.

Copy link
Member

quicksketch commented Dec 18, 2014

Merged in backdrop/backdrop#560.

I made a new issue for the old PR at backdrop/backdrop#459 to track that incomplete issue: #471

I performance tested this before the merge. There is a function call differences of about 1% fewer, and the performance benefit is roughly a 1% improvement. Nice. Great simplification overall.

@jenlampton

This comment has been minimized.

Copy link
Member Author

jenlampton commented Dec 18, 2014

highfives

@jenlampton jenlampton changed the title META: Remove the process layer Remove the process layer Dec 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment