Refactor browser data parsing to handle families #208
Conversation
Codecov Report
@@ Coverage Diff @@
## master #208 +/- ##
=======================================
Coverage 92.85% 92.85%
=======================================
Files 3 3
Lines 196 196
Branches 59 59
=======================================
Hits 182 182
Misses 9 9
Partials 5 5 Continue to review full report at Codecov.
|
I haven't started preparing the actual PR yet, fortunately. :) I'll have a look at this one. |
scripts/build-data.js
Outdated
let bid; | ||
let prevBid; | ||
|
||
for (bid in rawBrowsers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be for (const bid in rawBrowsers)
and then the above let bid
declaration is not needed.
scripts/build-data.js
Outdated
@@ -118,31 +161,26 @@ const getLowestImplementedVersion = ({ features }, env) => { | |||
|
|||
const envTests = tests | |||
.map(({ res: test, name, isBuiltIn }, i) => { | |||
|
|||
if (name === "const/basic support") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A debugging leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep lol
Overall looks good, I have some minor remarks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, agree with @mgol with his remarks
.shift(); | ||
.filter((t) => t.startsWith(env)) | ||
// Babel assumes strict mode | ||
.filter((test) => tests[i].res[test] === true || tests[i].res[test] === "strict") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could merge 2 filters in 1 for perf, but it's just a nit and could be changed in separate PR aimed to optimize things like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome
Fixes #207.
And by refactor, it just means I just adapted compat-table's code for interpolating environments (essentially what #86 was doing).
One nice side effect is that this allows us to drop the
invertedEqualsEnv
stuff, and may allow for some additional cleanup/hacks but will wait on that./cc: @mgol hope you weren't too far towards a fix, I was just looking at some code and realized it was a quick fix, would appreciate your eyes on this for a review!