Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We do not want people to rely on Backbone as provided by Core.
Proposed resolution
Deprecate the existing library and create a new core/internal.backbone
library to provide backbone for toolbar/tour/contextual/quickedit until the usages are removed.
Contrib modules that depends on core/backbone
library:
acquia_commercemanager
amptheme
commerce_cart_flyout
edit_ui
gridstack
nexx_integration
obiba_mica_dashboard
panels
visualn_libraries
responsive_preview
shs
site_assistant
commerce_cart_api
devel
erd
imago
library_manager
quickedit
Issue fork drupal-3258931
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
Comment #3
nod_Comment #4
nod_Comment #5
nod_Comment #6
Wim LeersI think this is a very reasonable approach. This discourages further adoption/new usage.
We cannot prevent code choosing to depend on the new internal asset library, but you have to go out of your way to even find this and then you need to willfully ignore it.
This does give ample warning time for maintainers of contrib/custom modules currently depending on core-provided Backbone to refactor their code.
All in all: nice trade-off 👍
Just posted 3 suggestions that would make this even more clear, then this is RTBC IMHO.
Comment #7
catch+1 from me. It's a similar-ish approach we took to the core jQuery UI libraries and it gives us room to manoeuvre in Drupal 10.
Since this blocks lots of other work, and we need to deprecate the library definition in Drupal 9, bumping to critical.
Comment #8
nod_Umm we should do the same for underscore too
Comment #9
effulgentsia CreditAttribution: effulgentsia at Acquia commented+1 to this issue. And to doing it for underscore if the contrib list relying on it is similarly small.
Can we and should we add some kind of warning (deprecation? something else?) if something other than toolbar/tour/contextual/quickedit adds backbone.internal as a dependency or tries to add it to #attached?
Comment #10
xjmQuickEdit (contrib) also uses Backbone, but is missing from the IS:
https://git.drupalcode.org/project/quickedit/-/blob/1.0.x/quickedit.libr...
Comment #11
catchAdded.
Comment #12
xjmComment #13
xjmComment #14
nod_updated MR
Comment #15
nod_renamed the library to
core/internal.backbone
to put emphasis on the internal part.Comment #16
nod_updated after #3272872: deprecate underscore and mark it internal
Comment #17
xjmThis looks pretty good. Can we add a deprecation test to ensure the old library raises the deprecation notice as intended?
Comment #18
nod_Little scope creep, update the comment on the underscore library too since it got in before this one.
Comment #20
hooroomoo1. Checked that all files that had core/backbone were changed to core/internal.backbone
2. Checked that internal.backbone library was added to vendor-update.js
3. Checked that deprecation message is there and there is a test for it
Comment #21
xjmLoos good. Great work @hooroomoo!
Comment #22
alexpottCommitted 05d8761 and pushed to 10.0.x. Thanks!
Committed ec891b8 and pushed to 9.4.x. Thanks!
Comment #25
xjm