#47478 closed task (blessed) (fixed)
Update Backbone.js to 1.4.0
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | External Libraries | Keywords: | early good-first-bug has-patch has-dev-note |
Focuses: | Cc: |
Description
Backbone.js 1.4.0 was released on February 19, 2019.
Core currently includes version 1.3.3 using the package.json
file. However, the version indicated when the script is enqueued incorrectly indicates 1.2.3 is loaded.
A full list of changes since 1.3.3 can be found here: https://github.com/jashkenas/backbone/compare/1.3.3...1.4.0.
Attachments (8)
Change History (28)
#1
@
6 years ago
I have attached patch for wp-includes/script-loader.php and package.json.
package.json will now download Backbone.js version 1.4.0
This ticket was mentioned in Slack in #core by desrosj. View the logs.
6 years ago
#3
follow-up:
↓ 4
@
6 years ago
- Keywords has-patch needs-testing needs-refresh added; needs-patch removed
- Owner set to priyankkpatel
- Status changed from new to assigned
Assigning to @priyankkpatel to mark good-first-bug
claimed.
Thanks for the patch! The package-lock.json
file will also need to be updated.
@adamsilverstein are you able to help testing this?
#4
in reply to:
↑ 3
@
6 years ago
Replying to desrosj:
Assigning to @priyankkpatel to mark
good-first-bug
claimed.
Thanks for the patch! The
package-lock.json
file will also need to be updated.
@adamsilverstein are you able to help testing this?
You are welcome @desrosj
@
6 years ago
Final patch including changes in package.json, package-lock.json and wp-includes/script-loader.php
#6
@
6 years ago
I did some testing with this today. I found a few issues. They all seem to be related to this._listeners
and cleaning up memory bindings. Here are scenarios that are showing the issue:
- Go to the Media Library and upload an image. When uploading finishes, you'll see the console error.
- In the Classic Editor, click Add Media, select an image, click insert. Observe the console error.
- In the Classic Editor, click Add Media, click Create Gallery. Observe the console error. The view also does not switch, and subsequent tab changes do not always work. Clicking Create New Gallery does nothing.
These issues also happen when working with the media modals in the block editor.
#7
@
6 years ago
Took some time out and managed to solve this. The _listeners
object was being applied to the states
Collection in the StateMachine (aka this.controller
), instead of the StateMachine itself. This is because of a change in Backbone v1.4.0 which applies listeners to the object's public on
method (in this case the StateMachine maps events and triggers to the states
object).
47478.3.patch fixes this by passing the states
object instead of the StateMachine. I also refactored StateMachine to remove some dead code.
This ticket was mentioned in Slack in #core by pierlo. View the logs.
6 years ago
#9
@
6 years ago
- Keywords needs-dev-note added
Hey @pierlo thanks for the patch and the detailed explanation about the required changes. I tested media and revisions and everything worked as expected after this change.
Since the listener changes in 1.4 might also affect plugin authors, this change deserves a devnote. https://backbonejs.org/#changelog
@desrosj this looks good to me, unless you have any final concerns I can go ahead and commit this.
#10
@
6 years ago
- Keywords commit added; needs-testing needs-refresh removed
@adamsilverstein Let's get it in so it has time to sit until beta next week.
Thanks for working on this, @pierlo! Would you be willing to summarize the above in a short paragraph or two for a dev note? Doesn't have to be on this ticket. We can connect in Slack if you'd like.
#13
@
6 years ago
47478.2.diff limits the package-lock changes to the backbone dependency
#14
@
6 years ago
47478.3.diff removes unintended changes in class-wp-user-query.php
This ticket was mentioned in Slack in #core-js by adamsilverstein. View the logs.
6 years ago
#18
@
6 years ago
Great question @joyously - I did some basic testing in the Customizer: additional testing would be welcome!
In general, I don't think the bigger changes would affect the Customizer.
#19
@
6 years ago
- Keywords has-dev-note added; needs-dev-note commit removed
Dev note posted: https://make.wordpress.org/core/2019/10/10/wordpress-5-3-backbone-upgrade-guide/
Thanks again, @pierlo!
Patch for wp-includes/script-loader.php