diff --git a/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php index 6fada86..be64602 100644 --- a/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php @@ -42,10 +42,6 @@ public function __construct(AttachmentsResponseProcessorInterface $html_response * The event to process. */ public function onRespond(FilterResponseEvent $event) { - if (!$event->isMasterRequest()) { - return; - } - $response = $event->getResponse(); if (!$response instanceof HtmlResponse) { return; diff --git a/core/modules/big_pipe/big_pipe.info.yml b/core/modules/big_pipe/big_pipe.info.yml new file mode 100644 index 0000000..13a739b --- /dev/null +++ b/core/modules/big_pipe/big_pipe.info.yml @@ -0,0 +1,6 @@ +name: BigPipe +type: module +description: 'Sends pages in a way that allows browsers to show them much faster. Uses the BigPipe technique.' +package: Core +version: VERSION +core: 8.x diff --git a/core/modules/big_pipe/big_pipe.libraries.yml b/core/modules/big_pipe/big_pipe.libraries.yml new file mode 100644 index 0000000..88ecff6 --- /dev/null +++ b/core/modules/big_pipe/big_pipe.libraries.yml @@ -0,0 +1,11 @@ +big_pipe: + version: VERSION + js: + js/big_pipe.js: {} + drupalSettings: + bigPipePlaceholders: [] + dependencies: + - core/jquery + - core/drupal + - core/drupal.ajax + - core/drupalSettings diff --git a/core/modules/big_pipe/big_pipe.module b/core/modules/big_pipe/big_pipe.module new file mode 100644 index 0000000..f2615e6 --- /dev/null +++ b/core/modules/big_pipe/big_pipe.module @@ -0,0 +1,56 @@ + 'hidden', + '#default_value' => '1', + ); + + $form['#after_build'][] = 'big_pipe_form_after_build'; + $form['#submit'][] = 'big_pipe_form_set_js_check'; +} + +/** + * After build handler for user_login_form(). + */ +function big_pipe_form_after_build($form, FormStateInterface $form_state) { + // This is tricky: we want Form API to 'default big_pipe_has_js' to '1' in + // case it is not sent. We also want to set the value of the HTML element + // to '0' and wrap it in a