Needs work
Project:
Drupal core
Version:
main
Component:
Starterkit theme
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Apr 2021 at 19:58 UTC
Updated:
11 Dec 2023 at 16:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #9
matthieuscarset commentedJust added a new library to starterkit_theme to demonstrate how to implement a Drupal JS behavior:
starterkit_theme/reading-timeIt shows how to use
drupalSettingsandonce()within anattach()anddetach(). I tried to keep the whole code below ~100 lines - comments included.File changes:
NB: I had to update the theme generator PHP script to rename the source theme name in the
*.themefile's content and in JavaScript files too. .Comment #10
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #11
matthieuscarset commentedComment #12
smustgrave commentedMoving to NW for the open threads.
+1 for pointing to docs for once()
Comment #13
matthieuscarset commentedComment #14
smustgrave commentedCan the changes to core/lib/Drupal/Core/Command/GenerateTheme.php be reverted?
Comment #15
matthieuscarset commentedComment #16
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #17
matthieuscarset commentedThank you mister robot.
Added the missing new line at the end of the file.
Needs review.
Comment #18
smustgrave commentedThanks! Believe this is ready.
Comment #20
kostyashupenkoRebased
I see issues with eslint on
yarn lint:core-jsSecond warning is fixed, what to do with the rest warnings?
Comment #21
lauriiiPosted comment in the MR
Comment #22
smustgrave commented@matthieuscarset I think that sounds like a great idea and a good example.
Comment #23
matthieuscarset commentedOups! sorry, this is actually already what I did! 🤦♂️ I forgot to re-read myself.
@lauriii's question is still relevant.
Do we want to keep
console.log()or should we use something more visual, such asalert()orDrupal.message?Comment #24
smustgrave commentedThink console.log and maybe Drupal.message would be good examples.
Console.log for debugging
Drupal.message for themers
Comment #25
matthieuscarset commentedComment #26
smustgrave commentedReran tests and they still fail, so think failure is related to the change.
Comment #27
matthieuscarset commentedJust rebased on top of
11.xand rerun the whole pipeline.The failures are not related to changes on this issue.
Not sure how to handle this situation... but unless I'm wrong, the current issue is done and can be RTBC .
Comment #28
smustgrave commentedRerunning again but I don’t see that HEAD is broken. So if this can’t pass all the tests can’t mark it RTBC
Comment #29
smustgrave commentedRan here again and locally and it fails. Somehow this change is being picked up.
Comment #30
matthieuscarset commentedI need help to understand why an unrelated test is constantly failing in this MR
I merged latest code from
11.xand run the pipeline again but it is still failing atDrupal\FunctionalJavascriptTests\Core\JsMessageTest.If I run the test locally, it passes without errors (see screenshot below).

Any help much appreciated! TY
Comment #31
smustgrave commentedPosted a comment on the MR, hopefully that helps some.