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

Road to v4 🎉 #2594

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Road to v4 🎉 #2594

wants to merge 22 commits into from

Conversation

Markel
Copy link
Contributor

@Markel Markel commented Aug 30, 2020

This PR supersedes #2108 so it closes #2108

The objetive of the PR is to finish the work started by @patrickkettner of adapting Modernizr to es6 modules. I will try to solve all merging conflicts as they are created so the PR can be picked up by anyone easily.

Compare last Patrick's commit to this PR

TODO:
(Bold means currently working on it)

@Markel
Copy link
Contributor Author

Markel commented Aug 30, 2020

Note: I know that I usually have signed commits, but I'm currently moving for the student year so I'm working from a new PC and I haven't set up the signed commits yet.

* Recreate package.lock

Some problems were created when they new commits were merged

* Solve hyphens and data-uri
Tests converted: scrolltooptions, resizeobserver & clipboard
* Honestly I'm fu***** stupid
More merging errors

* Change tests so errors don't appear 🧠
@Markel
Copy link
Contributor Author

Markel commented Sep 1, 2020

I think I've never been so happy to see the codecov comment, because it means that the PR is finally stable :))))) (apart from appveyor's node 14)

The only thing that worries me is the amount of tests deleted from the test\node\lib\metadata.js file, but I basically followed @patrickkettner 's edits, maybe he could explain why he deleted some tests.

I will be busy the rest of the day and probably tomorrow, so I will read the previous PR in some days.

@Markel Markel closed this Sep 1, 2020
@Markel Markel reopened this Sep 1, 2020
@Markel
Copy link
Contributor Author

Markel commented Sep 1, 2020

Sorry, that was an error 😅

@Markel
Copy link
Contributor Author

Markel commented Sep 10, 2020

Sorry for the hard reset yesterday, I didn't have time to solve the error yesterday and it failed the tests so I hard reverted the commit (actually first time I had done it). Hope it didn't affect ongoing reviews, I'll avoid forced pushes in the future. PS: I haven't merged fda7369, but you know, it merges automatically, it will get merged when a new conflicting commit appears.

@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #2594 (544793c) into master (3514072) will increase coverage by 3.34%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2594      +/-   ##
==========================================
+ Coverage   95.18%   98.52%   +3.34%     
==========================================
  Files           5       50      +45     
  Lines         166      544     +378     
==========================================
+ Hits          158      536     +378     
  Misses          8        8              
Impacted Files Coverage Δ
lib/metadata.js 94.82% <0.00%> (-5.18%) ⬇️
lib/cli.js 100.00% <0.00%> (ø)
lib/options.js 100.00% <0.00%> (ø)
gulpfile.babel.js
src/domPrefixesAll.js 100.00% <0.00%> (ø)
src/roundedEquals.js 100.00% <0.00%> (ø)
src/getBody.js 100.00% <0.00%> (ø)
src/omPrefixes.js 100.00% <0.00%> (ø)
src/injectElementWithStyles.js 100.00% <0.00%> (ø)
src/domToCSS.js 100.00% <0.00%> (ø)
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1fbec3...c8f62e1. Read the comment docs.

@Markel
Copy link
Contributor Author

Markel commented Oct 2, 2020

I was thinking that we may use the PR to also bump some breaking updates to some dependencies, the best of all? Most of them don't even break inside Modernizr (the irony)

Outdated packages list

All packages except the mocha ones can be updated to the latest version without requiring any changes (or at least npm test doesn't break. I will investigate about the mocha errors and comment any discoveries that I find. So does anyone have any problem with updating the dependencies?

@patrickkettner
Copy link
Member

patrickkettner commented Oct 2, 2020 via email

@Markel
Copy link
Contributor Author

Markel commented Oct 3, 2020

So due to the es6 imports being used now, those browsers won't work (at least not in a build) won't they? So would that mean that we can upgrade mocha? Correct me if I'm wrong

@patrickkettner
Copy link
Member

patrickkettner commented Oct 3, 2020 via email

@Markel
Copy link
Contributor Author

Markel commented Oct 3, 2020

Yeah, that was my idea when I wrote the correct me if I'm wrong, I mean it wouldn't make to much sense to have tests for es5 if you require es6 to run the test. But I haven't touched too much the PR except for solving all the merge conflicts, so I'm still checking some technical details about it. But yeah, I think that rollup will help on not requiring es6. Thanks!

@Markel Markel mentioned this pull request Dec 20, 2020
toddwong and others added 3 commits January 16, 2021 08:32
Keyword 'for' in `Symbol.for` caused `Undefined identifier` error in IE8.
I had started solving the conflicts before that commit was merged
@Markel
Copy link
Contributor Author

Markel commented Jan 18, 2021

Note: I'm moving all the comments from #2108 to here, I'll react with a 👍 if I solved it (some easy things) and 👀 if I copied the comment (reactions in the original PR). Also I'm taking ownership from all your comments @rejas as I have to rewrite them 😈

@@ -133,16 +124,16 @@ if (argv.o || argv.f) {
// special case around it :[
if (prop === 'setClasses') {
return 'setClasses';
} else if (_.isUndefined(obj)) {
throw new Error('invalid key value name - ' + prop);
} else if (typeof obj === 'undefined') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isnt (obj === undefined ) enough these days?

@@ -39,30 +37,23 @@ var yargs = require('yargs')
alias: 'uglify',
describe: 'uglify/minify the output'
})
.options('s', {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this option is gone for good?


if (Modernizr._config.usePrefixes) {
// legacy webkit syntax (TODO:: remove when syntax not in use anymore)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so the TODO isnt valid anymore? it will never be removed?

import Modernizr from '../../src/Modernizr.js';
import createElement from '../../src/createElement.js';
import docElement from '../../src/docElement.js';
import computedStyle from '../../src/computedStyle.js';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, but would be good to have changes in the feature detects separately...

(Not really sure what you mean by this...)

Modernizr.addTest('texttrackapi', results.texttrackapi);

// a more strict test for track including UI support: document.createElement('track').kind === 'subtitles'
Modernizr.addTest('track', 'kind' in createElement('track'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

shouldnt this just be results.track?

@@ -16,15 +16,20 @@
}
!*/
/* DOC
Detects support for the `window.postMessage` protocol for cross-document messaging.
Detects support for the `self.postMessage` protocol for cross-document messaging.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

self?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it doesn't seem to make too much sense

Comment on lines +28 to +29
export let textencoder = Modernizr.textencoder
export let textdecoder = Modernizr.textdecoder
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why is here an export let? why is that special?

Comment on lines -15 to -20
"load",
"mq",
"prefixed",
"prefixes",
"prefixedCSS",
"setClasses",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why is that gone?

and could you document those changes (in the options) in the README too?

Comment on lines +77 to +78
.reduce((acc, val) => acc.concat(val), [])
.reduce((acc, val) => acc.concat(val), [])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

twice the same call to reduce?

@@ -1,338 +1,339 @@
define(['isSVG'], function(isSVG) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

that would be a thing: an update to html5shiv for es6 :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

???

Comment on lines +1 to +2
var isBrowser = typeof self !== 'undefined' && typeof self.document !== 'undefined';
export default isBrowser
Copy link
Contributor Author

Choose a reason for hiding this comment

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

some documentation when this should be used would be needed.

// Everyone supports fontSize
expect(testProps(['fontSize'])).to.be.equal(true);
expect(testProps(['fontSize'])).to.equal(true);
// kebab-case should work too
Copy link
Contributor Author

Choose a reason for hiding this comment

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

you dont like the "be"s? 🐝

@Markel
Copy link
Contributor Author

Markel commented Jan 19, 2021

Just looking for other things a found this little irony 😅 #1786 (comment)

Have a good day everyone and stay safe :)

@niksy
Copy link
Contributor

niksy commented Oct 1, 2021

Is this still active? What can we do to help move this along?

@Markel
Copy link
Contributor Author

Markel commented Oct 2, 2021

Is this still active? What can we do to help move this along?

Hi @niksy. Honesty, I had quite forgotten of the PR, there are merge conflicts should be easy to solve (as not too many commits have been done since). But honestly I don't really know what you could do to help apart from the top comments missing checkboxes 😅.

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.

None yet

4 participants