Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, matchMedia.patch, failed testing.

droplet’s picture

FileSize
1.69 KB

Ouch, forget generate the new patch after testing. Here is new patch with correct path.

droplet’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: matchMedia.patch, failed testing.

droplet’s picture

Status: Needs work » Needs review
FileSize
11.42 KB
sun’s picture

This proposal seems to conflict with the latest proposals in #1848500: Use performance optimized matchmedia polyfill

droplet’s picture

Both script are very similar. I could see the author name: "WebLinc, David Knight." there. This patch version is rewritten by him in upstream.

sun’s picture

Status: Needs review » Needs work
+++ b/core/core.libraries.yml
@@ -649,13 +649,19 @@ jquery.ui.widget:
+  # @todo Stable release required for Drupal 8.0.
   version: VERSION
...
+  # @todo Stable release required for Drupal 8.0.
+  version: VERSION

Can you clarify (in code) which version we're updating to?

In case this is the upcoming/not-yet-released 0.1.1, then it should state:

version: master
commit: thehashyoudownloaded
droplet’s picture

Status: Needs work » Needs review
FileSize
6.12 KB
1.18 KB
droplet’s picture

FileSize
11.13 KB
1.18 KB

Add back the commit hash

sun’s picture

The issue summary claims

"matchmedia.addListener" ( sometimes, it only need matchMedia )

...but I'm not able to see a proof for that in the actual patch?

If there is no use-case for the split in core, then let's merge the two library declarations into a single.

The last submitted patch, 9: 2207629-9-matchmediaJS.patch, failed testing.

droplet’s picture

@sun,

Checkout CORE Seven theme.

nav-tabs.js

var notSmartPhone = window.matchMedia('(min-width: 300px)');

it used resize event:
$(window).on('resize.tabs', Drupal.debounce(handleResize)).trigger('resize.tabs');

(resize based on tab sizes / content width, not the viewport size)

sun’s picture

Title: Update JS lib: matchMedia » Update matchMedia library to latest release
Assigned: Unassigned » nod_
Status: Needs review » Needs work

@nod_: Can you confirm @droplet's statements? I'm not familiar with those custom event listeners.


A new 0.2.0 release was created a few days ago:

https://github.com/paulirish/matchMedia.js/releases

This means that we should pull in exactly the tagged code + remove the @todo about creating a new upstream release from the library declaration (replacing version with the actual version, and removing 'commit').

The only change since 0.2.0 appears to be an oversight in bower.json, which is irrelevant for us (at this point):
https://github.com/paulirish/matchMedia.js/compare/0.2.0...master

@droplet: Can you perform these changes?

sun’s picture

Priority: Normal » Major
droplet’s picture

Status: Needs work » Needs review
FileSize
10.93 KB

Status: Needs review » Needs work

The last submitted patch, 16: 2207629-11-matchmediaJS.patch, failed testing.

droplet’s picture

Status: Needs work » Needs review

16: 2207629-11-matchmediaJS.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 16: 2207629-11-matchmediaJS.patch, failed testing.

droplet’s picture

Status: Needs work » Needs review

16: 2207629-11-matchmediaJS.patch queued for re-testing.

Wim Leers’s picture

16: 2207629-11-matchmediaJS.patch queued for re-testing.

nod_’s picture

16: 2207629-11-matchmediaJS.patch queued for re-testing.

nod_’s picture

Assigned: nod_ » Unassigned

Looks ok to me, I'll wait for the testbot before gooing further.

nod_’s picture

Status: Needs review » Reviewed & tested by the community

All good :)

catch’s picture

Status: Reviewed & tested by the community » Needs review

Could we not put a minified version in instead?

xjm’s picture

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch in #16 needs a reroll.

catch’s picture

@xjm I think we might as well use the minified versions when doing updates at this point.

rpayanm’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
11.06 KB

rerolling...

Status: Needs review » Needs work

The last submitted patch, 29: 2207629-29.patch, failed testing.

Status: Needs work » Needs review

rpayanm queued 29: 2207629-29.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 29: 2207629-29.patch, failed testing.

Devin Carlson’s picture

Status: Needs work » Needs review
FileSize
836 bytes
11.1 KB

This should fix the test failures.

I'm not sure what to do about minified versions of the files, since they aren't included with the repository.

Wim Leers’s picture

Status: Needs review » Needs work

Patch looks good. I'd say that to ship with a minified version, we want to apply uglifyjs2 to the source. NW only for that, if catch hadn't asked to minify this, this would be RTBC.

droplet’s picture

Here're the online version of 2 best minifier:
http://lisperator.net/uglifyjs/#demo
http://closure-compiler.appspot.com/home

+++ b/core/core.libraries.yml
@@ -752,17 +752,21 @@ jquery.ui.widget:
+  version: &matchmedia_version 0.2.0
+  license: &matchmedia_license
...
+  version: *matchmedia_version
+  license: *matchmedia_license

incorrect ?

Wim Leers’s picture

#35: No, that's correct. See core.libraries.yml, the entries for jQuery UI, for similar examples.

tarekdj’s picture

Status: Needs work » Needs review
FileSize
7.94 KB
7.5 KB

Minified using uglifyjs2 :

$ uglifyjs matchMedia.js -m -o matchMedia-min.js
$ uglifyjs matchMedia.addListener.js -m -o matchMedia.addListener-min.js
Wim Leers’s picture

Status: Needs review » Needs work

Thank you! Two nitpicks, after which this will be RTBC:

  1. --- /dev/null
    +++ b/core/assets/vendor/matchMedia/matchMedia-min.js
    
    --- /dev/null
    +++ b/core/assets/vendor/matchMedia/matchMedia.addListener-min.js
    

    All minified JS in core uses .min.js, not -min.js. Let's be consistent with that.

  2. +++ b/core/assets/vendor/matchMedia/matchMedia-min.js
    @@ -0,0 +1 @@
    \ No newline at end of file
    
    +++ b/core/assets/vendor/matchMedia/matchMedia.addListener-min.js
    @@ -0,0 +1 @@
    \ No newline at end of file
    

    Please add newlines at the end of these files.

tarekdj’s picture

Status: Needs work » Needs review
FileSize
7.89 KB

updated patch.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

catch’s picture

Status: Reviewed & tested by the community » Needs review

Should the license link to either https://github.com/paulirish/matchMedia.js/blob/0.2.0/LICENSE.txt (current patch keeps it at 0.1.0)?

tarekdj’s picture

@catch you're right!
Fixed the license.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Ugh, missed that. Good catch, catch.

The last submitted patch, 37: update_matchmedia-2207629-37.patch, failed testing.

The last submitted patch, 39: update_matchmedia-2207629-39.patch, failed testing.

catch’s picture

Priority: Major » Critical
Status: Reviewed & tested by the community » Fixed

Retrospectively marking critical as a child of #2203431: [meta] Various asset (JavaScript) libraries have to be updated to a (minified) stable release prior to 8.0.0.

Committed/pushed to 8.0.x, thanks!

  • catch committed 37e7d70 on 8.0.x
    Issue #2207629 by droplet, tarekdj, Devin Carlson, rpayanm: Update...

Status: Fixed » Closed (fixed)

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