Problem/Motivation

In the BigPipe D8.1 core issue, @effulgentsia said this at #2469431-258: BigPipe for auth users: first send+render the cheap parts of the page, then the expensive parts:

+++ b/core/modules/big_pipe/src/Controller/BigPipeController.php
@@ -0,0 +1,64 @@
+    $response->headers->setCookie(new Cookie(BigPipeStrategy::NOJS_COOKIE, TRUE));

While testing, I switched my browser back and forth from JS enabled to disabled and back. Once this cookie is set, nothing unsets it once JS is re-enabled. Should we add some JS code to do so?

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

Wim Leers created an issue. See original summary.

nod_’s picture

Issue tags: +JavaScript
wim leers’s picture

Project: BigPipe » Drupal core
Version: 8.x-1.x-dev » 8.1.x-dev
Component: Code » big_pipe.module
Assigned: Unassigned » wim leers

Working on a first iteration of this.

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new3.18 KB

If this approach is approved by @nod_ and others, then I'll still need to add test coverage to \Drupal\big_pipe\Tests\BigPipeTest::testNoJsDetection().

wim leers’s picture

Title: Consider removing the no-JS cookie when JS is enabled again in a browser » Consider removing the BigPipe no-JS cookie when JS is enabled again in a browser

Slight clarification.

wim leers’s picture

Assigned: Unassigned » nod_

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wim leers’s picture

Version: 8.2.x-dev » 8.1.x-dev
nod_’s picture

Status: Needs review » Reviewed & tested by the community

Works as advertised. If we talk CSP compliance that'll be an issue, since it's experimental it's good enough, a warning somewhere is enough.

Wouldn't mind having the meta reorganized and script tags appear below the <title>. Anyway, out of scope.

wim leers’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the RTBC :) But I still want to add test coverage first!

wim leers’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new6.32 KB
new3.17 KB

There :)

nod_’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Status: Reviewed & tested by the community » Fixed

I didn't manage to finish my review of the original patch before it got in, but this was one of my concerns with it. Like the solution here.

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

  • catch committed 221ab60 on 8.2.x
    Issue #2678628 by Wim Leers: Consider removing the BigPipe no-JS cookie...
wim leers’s picture

Also committed & pushed to the contrib module for Drupal 8.0: http://cgit.drupalcode.org/big_pipe/commit/?id=e5ba3f4.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.