Proposed commit message

Issue #2485573 by nod_, alanburke, iMiksu: Update JS library domready to version 1.0.8

Original report

Current version: 1.0.7
New version: 1.0.8

https://github.com/ded/domready

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nod_’s picture

Issue tags: +Novice, +JavaScript

When updating include the minified file, the original source and the source map file (if any supplied by the lib).

alanburke’s picture

Status: Active » Needs review
FileSize
3.42 KB

Updated to new version, and source file added.

Status: Needs review » Needs work

The last submitted patch, 2: 2485573-2-update-domready.patch, failed testing.

iMiksu’s picture

Title: Update domready to 1.0.8 » Update JS library domready to version 1.0.8
Issue summary: View changes

We need to update the tests too at \Drupal\system\Tests\Common\AttachedAssetsTest::testVersionQueryString

function testVersionQueryString() {
    $build['#attached']['library'][] = 'core/backbone';
    $build['#attached']['library'][] = 'core/domready';
    $assets = AttachedAssets::createFromRenderArray($build);

    $js = $this->assetResolver->getJsAssets($assets, FALSE)[1];
    $js_render_array = \Drupal::service('asset.js.collection_renderer')->render($js);
    $rendered_js = $this->renderer->render($js_render_array);
-    $this->assertTrue(strpos($rendered_js, 'core/assets/vendor/backbone/backbone-min.js?v=1.1.2') > 0 && strpos($rendered_js, 'core/assets/vendor/domready/ready.min.js?v=1.0.7') > 0 , 'JavaScript version identifiers correctly appended to URLs');
+   $this->assertTrue(strpos($rendered_js, 'core/assets/vendor/backbone/backbone-min.js?v=1.1.2') > 0 && strpos($rendered_js, 'core/assets/vendor/domready/ready.min.js?v=1.0.8') > 0 , 'JavaScript version identifiers correctly appended to URLs');
  }

EDIT: I figured out that it was actually changed, investigating now why failing.

iMiksu’s picture

Assigned: Unassigned » iMiksu
iMiksu’s picture

Assigned: iMiksu » Unassigned

We need to update the core.libraries.yml file. I haven't worked with external JS libraries before, so I'm not sure do we need to provide the source file by executing something?

diff --git a/core/core.libraries.yml b/core/core.libraries.yml
index dd8eae7..cf0f37a 100644
--- a/core/core.libraries.yml
+++ b/core/core.libraries.yml
@@ -34,10 +34,10 @@ ckeditor:
 
 domready:
   remote: https://github.com/ded/domready
-  version: "1.0.7"
+  version: "1.0.8"
   license:
     name: MIT
-    url: https://github.com/ded/domready/blob/v1.0.7/LICENSE
+    url: https://github.com/ded/domready/blob/v1.0.8/LICENSE
     gpl-compatible: true
   js:
     assets/vendor/domready/ready.min.js: { weight: -21, minified: true }
ragnarkurm’s picture

Status: Needs work » Needs review
FileSize
3.95 KB
nikita.izotov’s picture

Status: Needs review » Reviewed & tested by the community

Tested, everything is ok

how i tested it manually:

  • fund that statistics module is using domready
  • tested if statistics is saving page hits with patch
  • without it.
alexpott’s picture

Assigned: Unassigned » nod_
Status: Reviewed & tested by the community » Needs review
--- /dev/null
+++ b/core/assets/vendor/domready/ready.js

--- a/core/assets/vendor/domready/ready.min.js
+++ b/core/assets/vendor/domready/ready.min.js

@nod_ given that the minified is not minified should we be bothering to in the unminified file.

nod_’s picture

Assigned: nod_ » Unassigned
Status: Needs review » Needs work

Umm yeah, let's loose the unminified file for that one. I don't want to add the unminified version of modernizr or ckeditor or any other lib we don't have a map file for.

alanburke’s picture

Status: Needs work » Needs review
FileSize
2.93 KB
nod_’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, all good.

Nice reduction in size with their new minification config.

Wim Leers’s picture

Nice reduction in size with their new minification config.

Wow, yes, significantly smaller!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 9489b81 and pushed to 8.0.x. Thanks!

  • alexpott committed 9489b81 on 8.0.x
    Issue #2485573 by alanburke, ragnarkurm: Update JS library domready to...

Status: Fixed » Closed (fixed)

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