A brand new version of Modernizr has been released. According to the creators:

"Modernizr v.3 is not a mere version bump with some new additions; it is a complete architectural rewrite of the entire library and all of the 150+ community feature tests." Modernizr 3, Stickers & Diversity

In addition, they have added over 100 new detects. Modernizr 3: A new release and website.

I guess the question is whether we want to update so close to RC1. However, since this is a major version change with significant added functionality (the over 100 new detects), we may want to try to get it in now.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TJacksonVA created an issue. See original summary.

nod_’s picture

nod_’s picture

nod_’s picture

Assigned: nod_ » Unassigned
Status: Active » Needs review
Issue tags: +Needs manual testing
FileSize
9.51 KB

Seems to be working.

webchick’s picture

I think it makes sense to try and get it in now. Thanks for flagging it.

What sort of manual testing do we need to do to verify this doesn't break all the things though?

dawehner’s picture

+++ b/core/core.libraries.yml
@@ -825,7 +825,7 @@ modernizr:
-  version: "v2.8.3"
+  version: "3.0.0-alpha.4"

OH, do we really want to update to an alpha release? I guess we will have a stable release when core gets out?

I just compared to usages we have which are Modernizr.touchevents, .inputevents and .details and they at least appear all on https://modernizr.com/docs

What sort of manual testing do we need to do to verify this doesn't break all the things though?

I guess the various things where we use it: tabledrag, contextual links, details and the date field could be tested with mobile browsers and maybe some old browsers?

nod_’s picture

Nothing much actually, the API is the same except for a slight rename for "touch".

What is impacted:

  • details elements on FF/IE
  • tabledrag still working for touch and for desktop (touch laptops have their own issue, unrelated to this)
  • datepicker is native on chrome/opera and polyfilled on the rest
nod_’s picture

Status: Needs review » Needs work

Umm css classes are used and changed name, don't have .touch anymore.

webchick’s picture

Priority: Critical » Major
Issue tags: +rc target

Oh, an alpha release. :\ Hm. Not sure about that... At least PHP-wise we try and stick to stable releases.

I think the proper thing to do would be to tag this as a target issue to get in during RC. It should also be critical, but probably not now. I think. I dunno. Will ping the other maintainers. :D

andypost’s picture

Looks there's only 3 issues left for v3
Also would be great to get their roadmap

IS needs steps for manual testing

dcrocks’s picture

The Modernizr web site didn't indicate this was an alpha release so I asked. Their response was:

Hey David,

That's probably an oversight from us can you please file a issue on github so we can track and fix it.

The version you're using is definitely v3 stable.

The only other possible issue is they switched from a BSD license to a MIT license, but that shouldn't matter.

ps. I did file an issue on their github.

TJacksonVA’s picture

@dcrocks, thanks for following up with the Modernizr team. Their response is consistent with what I have seen on the Modernizr website over the last couple of months, as the alpha/beta versions have been available for at least a few months for testing. This release is the stable release.

dcrocks’s picture

They have updated their builds so that they show the correct version:

/*! modernizr 3.0.0 (Custom Build) | MIT *

TJacksonVA’s picture

Are we going to try to get this in before RC1?

nod_’s picture

yes

xjm’s picture

This one needs framework manager review, I think. Hesitant about committing this during RC and about the alpha, but we should evaluate the benefit vs. risk/disruption etc.

nod_’s picture

Status: Needs work » Needs review
FileSize
12.81 KB

Stuff still works as expected. Just a CSS classname change. Modernizr had to change "touch" in "touchevents" because touch was ambiguous and people assumed it was detecting if the current device was a touch device, which is something that is not possible to do: http://www.stucox.com/blog/you-cant-detect-a-touchscreen/

Config used to build the release (you'd get the same thing when visiting this URL http://modernizr.com/download/?-details-inputtypes-touchevents-addtest-p...).

{
  "minify": true,
  "options": [
    "prefixes",
    "addTest",
    "testStyles",
    "setClasses"
  ],
  "feature-detects": [
    "test/inputtypes",
    "test/touchevents",
    "test/elem/details"
  ]
}
TJacksonVA’s picture

@xjm, this is not an alpha, but is a stable production release. Given the approximately 100 new detects in this version, I think we should try to get it in before RC1 if at all possible.

alexpott’s picture

Status: Needs review » Needs work

3.1.0 is out now...

nod_’s picture

Status: Needs work » Needs review
FileSize
12.92 KB

No change in the code built with the new version. All changes between 3.0.0 and 3.1.0 were on things we're not using.

nod_’s picture

Forgot to update version in libraries.yml file

The last submitted patch, 20: core-js-update-modernizr-2568387-20.patch, failed testing.

cosmicdreams’s picture

Status: Needs review » Reviewed & tested by the community

Beyond the replacement of the library this is shocking little we have to convert in our js to use the new major revision. I searched for other api conversations that could have happened (with fresh eyes) and couldn't find any.

I think this is RTBC

webchick’s picture

Status: Reviewed & tested by the community » Needs review

Can we get a quick round of manual testing? (Presumably playing around on a mobile device or older browser or whatever?)

cosmicdreams’s picture

I have a Nexus 6 with Chrome, which should work fine (not a real good test). Does anyone have an iPhone or OldAndroid browser?

cosmicdreams’s picture

Tested with my Nexus 6 and noticed that the edit icon doesn't work. But that doesn't work without the patch either

nod_’s picture

Status: Needs review » Reviewed & tested by the community

Testing Android 4.4 on an old Nexus S, Details, tabledrag, datefield works. same as #26 on the contextual links. Tested on chrome and the stock browser.

Funny thing, the toolbar has huge, enormous impact on page load speed. Almost unbearable on a slow phone like that we'll have to put it on diet.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs manual testing, -Needs framework manager review +Needs change record

Well Modernizr 3 is no longer in alpha - so unless we want a jquery situation we should move forward. I think we should have a change record which highlights the changes core has had to make.

Settign back to needs work to get the CR done.

effulgentsia’s picture

Title: Update JS lib: Modernizr to 3.0 » Update JS lib: Modernizr to 3.1
Priority: Major » Critical
Issue tags: -rc target

I discussed this with @alexpott and @catch and we decided to promote to Critical, per issue summary of #2203431: [meta] Various asset (JavaScript) libraries have to be updated to a (minified) stable release prior to 8.0.0, because Modernizr 3.0 (actually 3.1 even) is now fully released.

cosmicdreams’s picture

started the change record.

nod_’s picture

Assigned: Unassigned » nod_

Will post patch shortly

nod_’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record
FileSize
12.89 KB

After making my patch, just realized the last patch in #21 was already ok…

Had a look at the CR, looks good to me. The important points that impact us are the last 2 points around touchevents, the first two points of the CR are a general Modernizr API comment since what we're using and shipping with is not impacted.

nod_’s picture

You can ignore patch #32 it's useless.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed #21 to 8.0.x, thanks!

  • catch committed 9ed49f2 on 8.0.x
    Issue #2568387 by nod_, TJacksonVA, cosmicdreams, dcrocks: Update JS lib...

Status: Fixed » Closed (fixed)

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

quietone’s picture

Issue tags: -JavaScript +JavaScript

publish the change record