Skip to content
Snippets Groups Projects

Issue #3351356: Reduce repaints by adding username to user button sooner than the lazy builder can.

Closed Issue #3351356: Reduce repaints by adding username to user button sooner than the lazy builder can.

Merge request reports

Approval is optional

Closed by Ben MullinsBen Mullins Apr 27, 2023 (Apr 27, 2023 9:49pm UTC)

Merge details

  • The changes were not merged into 10.1.x.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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. :sweat_smile: 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 :wink:

    Should we formally revert all of https://www.drupal.org/node/3296086 at that issue, or undo everything here?

  • Please register or sign in to reply
  • Derek Wright
    Derek Wright @dww started a thread on the diff
  • 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. :sweat_smile: I had some head scratching why the cookie was called toolbarState when it seemed to only be a username. Now I realize the toolbarState cookie is an array of values, and this line just pulls the toolbarUserName 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.

    • Author Maintainer

      I can see how that might be confusing, especially since the array version is part of #2998451 which hasnt landed yet

    • I'm not opposed to landing this first with the cookie as an array and the general name, even if it currently only holds one value. I just wasn't familiar with the JS syntax const { toolbarUserName } = toolbarState; being able to pull a named value out of an array like that...

    • 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.

    • Please register or sign in to reply
  • Derek Wright
  • Ben Mullins added 1 commit

    added 1 commit

    • 8b455e2f - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading