#61855 closed defect (bug) (fixed)
Test package versions of default scripts match package.json
Reported by: | peterwilsoncc | Owned by: | peterwilsoncc |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | External Libraries | Keywords: | has-patch has-unit-tests |
Focuses: | javascript | Cc: |
Description
The following dependencies included via NPM are registered in wp_default_scripts()
rather than wp_default_packages_vendor()
are they are not stored in the standard location for vendor files for back-compat reasons.
- backbone
- clipboard
- hoverintent-js (the vanilla JS version)
- imagesloaded
- jquery-core
- jquery-color
- jquery-form
- hoverintent (the jquery version)
- masonry
- underscore
These currently lack tests to ensure the version registered in WordPress matches the version listed in the package.json
file. This ticket is to add tests for that as they've been known to fall out of sync.
Change History (8)
This ticket was mentioned in PR #7176 on WordPress/wordpress-develop by @peterwilsoncc.
8 weeks ago
#1
- Keywords has-patch has-unit-tests added
#2
@
8 weeks ago
While working on the PR for this, it appears that some of the scripts included via wp_default_packages_vendor()
are also missing similar tests. Some of the naming conventions differ but it would be good to add:
- tests for the existing scripts
- a test the tests test to ensure that when scripts added to package.json, they are also added to the tests
#3
@
8 weeks ago
Test looks good, It seems like these are the ones that are missing:
all of the @wordpress
scripts
core-js-url-browser
element-closest
es-module-shims1
formdata-polyfill
json2php
objectFitPolyfill
polyfill-library
wicg-inert
whatwg-fetch
I think for the test of tests to ensure testing we could combine the two data providers and then make sure that everything that's not a @wordpress
package is covered.
#4
@
3 weeks ago
I've updated the tests in the linked pull request to validate all of the scripts included via package.json except for the @wordpress/
scripts and the following:
json2php
is used by grunt but not enqueued, so left outelement-closest
uses a range rather than precise version number,^3.0.2
-- @desrosj is this intentionalwp-polyfill
-- unsure where the version number comes from so have left out
#5
follow-up:
↓ 6
@
3 weeks ago
I think we should make element-closest
use a precise number. It was originally set to the range in [43719] when it was first introduced. Everything added at that time used a range so it feels like an artifact rather than intentional.
#6
in reply to:
↑ 5
@
3 weeks ago
Replying to jorbin:
I think we should make
element-closest
use a precise number. It was originally set to the range in [43719] when it was first introduced. Everything added at that time used a range so it feels like an artifact rather than intentional.
I've updated this in the linked pull request after confirming the value used in the package-lock file.
I've also pushed a test the tests test to test the dataprovider used for the version test is maintained.
Adds tests to confirm the registered version number of the following scripts matches the version in package.json