Problem/Motivation

By the sound of #3145958: [META] Re-evaluate use of Backbone.js in core, the ancient backbone will be ditched at D11.

We need to seek for a more modern solution to replace it: likely vue, alpine, or alike.
Blazy 2.10 (DEV version as of this writing) has a plugin for object reactivity almost similar to those third parties reactive objects, only pretty inferior.
This will be enough to have vanilla JS like at GridStack:1.x while maintaining backbone heritage with very minimal reactivity.
This also has an obvious advantage to not depend on any other third party. Vanilla will do.

More info:
#2873160: Implement core management of 3rd-party FE libraries
#3198417: Official support for npm

Proposed resolution

  • Replace backbone with vanilla JS

Remaining tasks

Eat enough, this is a hugo job. Do it anytime, take your time, it is a long term job, many months, likely years, before core started ditching it, don't push it too hard.

User interface changes

None, just the framework switch.

API changes

None, just the framework switch.

Data model changes

None, just the framework switch.

Comments

gausarts created an issue. See original summary.

gausarts’s picture

Title: Replace backbone with modern vue, apine, or alike » Replace backbone with modern vue, alpine, or alike
gausarts’s picture

Title: Replace backbone with modern vue, alpine, or alike » Replace deprecated backbone for vanilla JS
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new496.63 KB

Many months had passed since this was posted.

Included a massive patch due to rewriting many admin JS files:

  • Removed backbone and underscore for vanilla JS.
  • Moved classes into folders to organize files better.
  • A few fixes related to layout builder integration.

We'll see if any misses from Drupal CS.

This requires Blazy 2.10 (or DEV version as of this writing).

gausarts’s picture

Issue summary: View changes
StatusFileSize
new496.63 KB

Looks like the files were not added recursively.

Checking more misses.

  • gausarts committed 1b2c2d9 on 8.x-2.x
    Issue #3266027 by gausarts: Replace deprecated backbone for vanilla JS...
gausarts’s picture

StatusFileSize
new504 bytes

Intentionally committed partially to spot issues better.

Checking for tests.

  • gausarts committed 1da0076 on 8.x-2.x
    Issue #3266027 by gausarts: Replace deprecated backbone for vanilla JS.
    
gausarts’s picture

StatusFileSize
new832 bytes

Stale.

Updated docs.

  • gausarts committed c866776 on 8.x-2.x
    Issue #3266027 by gausarts: Replace deprecated backbone for vanilla JS.
    
gausarts’s picture

Status: Needs review » Fixed

Any issues and fixes may follow on the background or as bug reports as usual.

Committed. Thank you for contribution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.