Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for postMessage structured clones #1250

Merged
merged 1 commit into from
Jul 16, 2018

Conversation

gregersrygg
Copy link
Contributor

Implemented the test discussed in Issue #388.

The name postmessagestructuredclones is terribly long. Other name suggestions?

Noticed the can-i-use test forces partial support to boolean true. So to test this with can-i-use I have to modify the testify function to handle partial support => false for only this test. But then I noticed the caniuse have some errors in their browser-support, so probably should contact Alexis to fix that first anyways...

*/
define(['Modernizr', 'test/postmessage'], function( Modernizr ) {
Modernizr.addTest('postmessagestructuredclones', function () {
if (Modernizr.postmessage === false) return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was be if (!Modernizr.postmessage) return false; since we know its a bool

@patrickkettner
Copy link
Member

thanks a lot for the PR, @gregersrygg

Can't wait to close out one of our oldest issues :D

@gregersrygg
Copy link
Contributor Author

@patrickkettner Not sure if this is how you meant, but I moved the detection into the postmessage test and added the result as a property.

@gregersrygg
Copy link
Contributor Author

Another thing; How would user find out about this property? Can I document sub-properties with the meta-tags? Any automation into play, or manually edit this file?

@patrickkettner
Copy link
Member

That file will not exist (in current sense) for 3.0, so no worries about updating it.

You would want to edit the DOC portion to include any relevant information about the test, and the notes section for any links.

When you are doing so, could you remove the empty line before and after the doc block?

Finally, could you squish everything down to a single commit when you are done, that would be great.

Once again, fantastic work!

@gregersrygg
Copy link
Contributor Author

Thanks for the feedback :) Updated and squashed now. Is this allowed in the meta-data? "property": ["postmessage", "postmessage.structuredclones"]

@patrickkettner
Copy link
Member

@gregersrygg, we don't include sub props in the property list currently - do you have an opinion on adding this @stucox ?

@gregersrygg
Copy link
Contributor Author

Anything I can do to get this merged @patrickkettner @stucox ? :)

@patrickkettner
Copy link
Member

@stucox had had a lack of availability lately, but pinging him one more time to see if he is against it. If not, we may be able to make that work

@zowers
Copy link

zowers commented Mar 26, 2015

any ETA on when this can be merged?

@rejas
Copy link
Member

rejas commented Jul 4, 2018

Quite a few years have passed @gregersrygg sorry about that. still, would you be willing to update the PR to rebase it against the latest sources?

@gregersrygg gregersrygg force-pushed the postmessage-structuredclones branch 3 times, most recently from 759f495 to 81aa035 Compare July 6, 2018 09:57
@gregersrygg
Copy link
Contributor Author

@rejas No worries. Rebased and fixed up the metadata.

define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('postmessage', 'postMessage' in window);
define(['Modernizr'], function( Modernizr ) {
/* jshint -W053 */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jshint isnt used anymore, can be removed

@@ -5,14 +5,25 @@
"caniuse": "x-doc-messaging",
"notes": [{
"name": "W3C Spec",
"href": "https://www.w3.org/TR/html5/comms.html#posting-messages"
"href": "http://www.w3.org/TR/webmessaging/#crossDocumentMessages"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use https

@rejas
Copy link
Member

rejas commented Jul 6, 2018

only minor nitpicks from my side. what do you say @patrickkettner ?

@rejas rejas requested a review from patrickkettner July 6, 2018 10:14
@rejas rejas added this to the Modernizr v3.8 milestone Jul 6, 2018
@patrickkettner
Copy link
Member

lgtm

@gregersrygg gregersrygg force-pushed the postmessage-structuredclones branch from 81aa035 to 6b1ff98 Compare July 16, 2018 19:46
@gregersrygg
Copy link
Contributor Author

Fixed review issues

@rejas rejas modified the milestones: Modernizr v3.8, Modernizr v3.7 Jul 16, 2018
@rejas rejas merged commit c2e5e48 into Modernizr:master Jul 16, 2018
@rejas rejas mentioned this pull request Jul 16, 2018
@rejas
Copy link
Member

rejas commented Jul 16, 2018

Thx a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants