Problem/Motivation

Toolbar will either need to refactor or include the library itself.
#3623843: Remove Backbone.js and Underscore.js, not used in core anymore

See how tour did it here: #3558002: Update backbone.js and move off of core

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork toolbar-3624031

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nicxvan created an issue. See original summary.

smustgrave made their first commit to this issue’s fork.

smustgrave changed the visibility of the branch 3624031-core-no-longer to hidden.

smustgrave’s picture

For a stable release this should be the last ticket needed. Then I’d start a 3.x branch for any future development

dydave made their first commit to this issue’s fork.

smustgrave’s picture

On my phone but you can drop the twig pin that should be fixed in core now.

dydave’s picture

Version: 1.x-dev » 2.x-dev

Looks like the tests are failing due to the missing claro theme and workspace module:

There was 1 error:
1) Drupal\Tests\toolbar\Functional\ToolbarClaroOverridesTest::testClaroAssets
Drupal\Core\Extension\Exception\UnknownExtensionException: Unknown themes: claro.
/builds/project/toolbar/web/core/lib/Drupal/Core/Extension/ThemeInstaller.php:66
/builds/project/toolbar/web/core/lib/Drupal/Core/Extension/ThemeInstaller.php:143
/builds/project/toolbar/tests/src/Functional/ToolbarClaroOverridesTest.php:54
--
There was 1 failure:
1) Drupal\Tests\toolbar\FunctionalJavascript\workspaces\WorkspaceTest::testToolbarSwitcherDynamicPageCache
Behat\Mink\Exception\ExpectationException: Current response header "X-Drupal-Dynamic-Cache" is "", but "MISS" expected.
/builds/project/toolbar/vendor/behat/mink/src/WebAssert.php:888
/builds/project/toolbar/vendor/behat/mink/src/WebAssert.php:180
/builds/project/toolbar/web/core/tests/Drupal/Tests/WebAssert.php:979
/builds/project/toolbar/tests/src/FunctionalJavascript/workspaces/WorkspaceTest.php:135
ERRORS!
Tests: 42, Assertions: 470, Errors: 1, Failures: 1.

How do you think we should approach these issues?

OK dropped the twig pin 👌

nicxvan’s picture

Claro I assume you can put in require dev right?

Not sure about the workspace failure.

dydave’s picture

Added drupal/claro in composer next major job... the error has changed now:

There were 2 failures:
1) Drupal\Tests\toolbar\Functional\ToolbarClaroOverridesTest::testClaroAssets
Behat\Mink\Exception\ExpectationException: Current response status code is 500, but 200 expected.
/builds/project/toolbar/vendor/behat/mink/src/WebAssert.php:888
/builds/project/toolbar/vendor/behat/mink/src/WebAssert.php:145
/builds/project/toolbar/tests/src/Functional/ToolbarClaroOverridesTest.php:118

2) Drupal\Tests\toolbar\FunctionalJavascript\workspaces\WorkspaceTest::testToolbarSwitcherDynamicPageCache
Behat\Mink\Exception\ExpectationException: Current response header "X-Drupal-Dynamic-Cache" is "", but "MISS" expected.
/builds/project/toolbar/vendor/behat/mink/src/WebAssert.php:888
/builds/project/toolbar/vendor/behat/mink/src/WebAssert.php:180
/builds/project/toolbar/web/core/tests/Drupal/Tests/WebAssert.php:979
/builds/project/toolbar/tests/src/FunctionalJavascript/workspaces/WorkspaceTest.php:135
FAILURES!
Tests: 42, Assertions: 490, Failures: 2.

I'll have to look closer at the issues locally when I get some time to test.

slasher13’s picture

Claro will be removed in Drupal 12 see https://www.drupal.org/node/3623824

dydave’s picture

Status: Active » Needs review

OK, all tests are now passing 🟢

Added 2 commits:
1 - To fix the phpunit tests for D12, due to a remaining static file path reference to 'core/themes/claro/templates/navigation' and explicitly enable the 'dynamic_page_cache' module for another test.
2 - Cleaned up the Gitlab CI configuration and fixed a deprecation message in one of the tests.
Unpinned constraints in composer.json file.

I've tested this locally as well with Drupal "12.0-dev" and everything seemed to work fine.

Moving this to Needs review as an attempt to get more reviews and testing feedback.

Thanks in advance!

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Say ship it

nicxvan’s picture

@slasher13 you are correct, just like toolbar, that's why we needed to add it to composer for the tests.

dydave’s picture

Thanks a lot @smustgrave once again for the speedy reply and confirmation! 🙏

Just a quick question to confirm:

Is it OK to release toolbar-2.0.0 with the current composer namespace?
https://git.drupalcode.org/project/toolbar/-/blob/2.x/composer.json#L2

    "name": "drupal/toolbar-toolbar",

I assume YES, since the infrastructure team needs a 2.0.0 stable version of the module first in order to change the namespace, as detailed here:
https://git.drupalcode.org/project/project_composer/-/work_items/3567861...

As soon as I can have your final confirmation, I'll go ahead, merge the changes in 2.x and create the new 2.0.0 stable release.

Thanks again everyone! 😊

smustgrave’s picture

Correct once you do a 2.0.0 comment on the composer ticket and Drupal infrastructure team will make a change on their end so it goes to Drupal/toolbar

ressa’s picture

Sounds great! And yes, the order is to first release a stable, and then fix the Composer namespace drupal/name-name gets fixed, as @drumm confirmed. I added it to the documentation page (the last sentence):

Create the contrib project with a stable release

A stable release is needed so that site owners are able to take action as soon as they see warnings and change records.

Only when a stable release exists can the Composer name be corrected to drupal/EXTENSION_NAME, from the temporary drupal/EXTENSION_NAME-EXTENSION_NAME.

[...]

From https://www.drupal.org/about/core/policies/core-change-policies/how-to-d...

... and in the issue template, the last sentence here:

{needs issue in <a href="https://www.drupal.org/project/issues/project_composer">packages.drupal.org issue queue</a>} Ensure EXTENSION_NAME does not get special core treatment &nbsp;This is to allocate the drupal/EXTENSION_NAME Composer namespace to contrib extension rather than the core extension. Corrects the temporary drupal/EXTENSION_NAME-EXTENSION_NAME name and requires a stable release.

From https://www.drupal.org/about/core/policies/core-change-policies/how-to-d...

dydave’s picture

Thanks again @smustgrave ... everything is very clear, I'll get all these points covered within the next 6 hours. 👍

dydave’s picture

Thanks a lot @ressa for all your great help with the documentation! 🙏

  • dydave committed 871ce781 on 2.x authored by smustgrave
    task: #3624031 Added support for Drupal 12.
    Fixed: Core no longer has...
dydave’s picture

Status: Reviewed & tested by the community » Fixed

All good here!! 🥳

✅ The merge request !5 was merged above at #21.

✅ The initial release for the 2.x branch was just created: toolbar-2.0.0.

✅ I have just notified the infrastructure team in the composer namespace ticket:
https://git.drupalcode.org/project/project_composer/-/work_items/3567861...

✅ Notified @quietone as well in #3484850-69: [meta] Tasks to deprecate Toolbar module.

✅ Credited everyone in this issue. 🙏

At this point, we should be able to consider all the work and actions to be carried in this issue should have been completed, thus marking it as Fixed, for now.

Feel free to let us know if we missed anything or if you would see any other actions, we would surely be very happy to help.
Thanks again everyone for all the great help! 🙏
(Special thanks to @smustgrave: You did all the work in the first version of the MR! Thanks a lot! 🤩)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.