#56731 closed enhancement (fixed)
Update the `imagesloaded` library
Reported by: | desrosj | Owned by: | desrosj |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | External Libraries | Keywords: | good-first-bug has-patch dev-feedback |
Focuses: | javascript | Cc: |
Description
Currently, version 4.1.4
of imagesloaded
is bundled in Core. Version 5.0.0
is available, so the bundled version should be updated.
This was looked at initially as part of #56670, but there's a strange issue with grunt jsvalidate:build
where the new version of the file does not pass the first time the task is run, but does on successive runs.
Change History (22)
This ticket was mentioned in PR #3653 on WordPress/wordpress-develop by @nazsabuz.
22 months ago
#2
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/56731
#3
@
22 months ago
- Keywords needs-patch added; has-patch removed
PR closed as it's not resolving the issue.
#4
@
22 months ago
- Keywords dev-feedback added
Hi,
Actully we don't need this library anymore. We can check if images are loaded or not with vanilla js. If that is okay. I can make the changes and raise PR
#5
@
22 months ago
- Keywords dev-feedback removed
The imagesloaded
library was included in Core to be used in conjunction with the masonry
library.
While vanilla JavaScript could be used to accomplish the same things in modern times, the intention here is to update this external library to the latest version in case someone is still utilizing it. Some basic scans of the plugin and theme directory show that a fair number of sites are still enqueuing this library.
Once an external library is included in WordPress Core, it very rarely is removed for backwards compatibility reasons.
#6
@
21 months ago
Hi @desrosj ,
How exactly did you create this bug?
I've tried running npm run build:dev
a couple of times on a fresh copy, but I keep getting a good result:
Running "jsvalidate:build" (jsvalidate) task 451 files are valid.
This ticket was mentioned in Slack in #core by costdev. View the logs.
20 months ago
#8
@
20 months ago
The bug I described only happens after attempting to update the dependency. Steps to reproduce:
- Update the
imagesloaded
dependency to5.0.0
in thepackage.json
file. - Run
npm install
- Run
npm run build
and observe the error.
This ticket was mentioned in PR #3927 on WordPress/wordpress-develop by @desrosj.
20 months ago
#9
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/56731
#10
@
20 months ago
- Keywords needs-patch added; has-patch removed
I've created a PR that demonstrates the problem: https://github.com/WordPress/wordpress-develop/actions/runs/4026712852/jobs/6921561752.
This ticket was mentioned in Slack in #core by costdev. View the logs.
20 months ago
#12
@
20 months ago
- Milestone changed from 6.2 to Future Release
This ticket was discussed during the bug scrub. As 6.2 Beta 1 is in a few days, I'm moving this ticket to Future Release. If it's ready for commit before 6.2 Beta 1, feel free to re-milestone it for 6.2.
Additional props: @audrasjb
#13
@
19 months ago
Hey, I wanted to maybe look into a patch a 'good first bug' since I have never contributed to WP before. I have been able to get the latest SVN repo running locally and re-produce this bug but since imagesloaded
is a 3rd party package I am unsure on the steps to providing a patch. Can anyone give me any pointers on how to resolve this bug?
This ticket was mentioned in PR #4247 on WordPress/wordpress-develop by @AhmedGeek.
18 months ago
#14
- Keywords has-patch added; needs-patch removed
V5.0.0 is built with ES6 and it needs to be transpiled first to pass the jsvalidate
task.
I added a babel task that transpiles it, this required adding grunt-babel
as a dev dependency.
Trac ticket: https://core.trac.wordpress.org/ticket/56731
#15
@
16 months ago
- Component changed from External Libraries to Build/Test Tools
- Focuses javascript added
- Keywords dev-feedback missing file added
- Resolution set to reported-upstream
- Status changed from new to closed
- Type changed from enhancement to defect (bug)
- Version set to 6.2
When testing the test.js file I receive this message.
Build failed with 1 error:
error: Cannot find module 'ava' from '/' js 8.21 is not installed
#16
@
16 months ago
- Component changed from Build/Test Tools to External Libraries
- Keywords missing file removed
- Resolution reported-upstream deleted
- Status changed from closed to reopened
- Type changed from defect (bug) to enhancement
- Version 6.2 deleted
Restoring the correct component and properties, please see The Bug Tracker (Trac) and Trac Workflow Keywords.
#18
in reply to:
↑ 1
@
14 months ago
- Milestone changed from Future Release to 6.4
Replying to desrosj:
The failure encountered:
Running "jsvalidate:build" (jsvalidate) task Validating src/wp-includes/js/imagesloaded.min.js >> Line 6: Unexpected identifier Encountered 2 errors. Warning: Task "jsvalidate:build" failed. Use --force to continue.
#19
@
13 months ago
After the removal of jsvalidate
, I could successfully generate a build with imagesloaded
v5.0.0
Also, noting that the version might need to be updated in script-loader.php
file as well.
The failure encountered: