Issue #3351356: Reduce repaints by adding username to user button sooner than the lazy builder can.
Merge request reports
Activity
58 58 * See description above. 59 59 */ 60 60 public function deprecatedLibrariesProvider(): array { 61 return [ 62 'Tests deprecation of library core/js-cookie' => [ 63 'core', 64 'js-cookie', 65 'asset library is deprecated in Drupal 10.1.0 and will be removed in Drupal 11.0.0. There is no replacement. See https://www.drupal.org/node/3322720', 66 '07ce73936a26710db875a3e9ee70cd6e', 67 ], 68 ]; 61 return []; - Comment on lines 60 to +61
Eeek, then all of
DeprecatedAssetsTest
is no longer testing anything. Guess it's okay to leave the plumbing in place for when we need it again, but maybe Git history is a better place to store that then an empty test lying around the live code. Seems like a weird/bad example to leave behind, in case someone finds it, tries to copy it, etc.Also, guess we better hurry up and land this before alpha1 so we can unpublish https://www.drupal.org/node/3322720
Should we formally revert all of https://www.drupal.org/node/3296086 at that issue, or undo everything here?
3 3 * Defines the behavior of the Drupal administration toolbar. 4 4 */ 5 5 6 (function ($, Drupal, drupalSettings) { 6 (function ($, Drupal, drupalSettings, Cookies) { 7 (() => { 8 if (!Cookies.get('toolbarState')) { 9 return; 10 } 11 const toolbarState = JSON.parse(Cookies.get('toolbarState')); 12 const { toolbarUserName } = toolbarState; TIL.
I had some head scratching why the cookie was calledtoolbarState
when it seemed to only be a username. Now I realize thetoolbarState
cookie is an array of values, and this line just pulls thetoolbarUserName
out of the array to use it directly. Phew! I was going to complain about the name of the cookie, but now it all makes sense.I can see how that might be confusing, especially since the array version is part of #2998451 which hasnt landed yet
Argh, I thought I could resolve my own threads in Gitlab, but apparently not. Sorry for the noise, but @bnjmnm feel free to resolve this.
- Resolved by Ben Mullins