Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Refactor browser data parsing to handle families #208

Merged
merged 2 commits into from Mar 14, 2017
Merged

Conversation

existentialism
Copy link
Member

@existentialism existentialism commented Mar 14, 2017

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!

@codecov-io
Copy link

codecov-io commented Mar 14, 2017

Codecov Report

Merging #208 into master will not change coverage.
The diff coverage is n/a.

@@           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.

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

@mgol
Copy link

mgol commented Mar 14, 2017

I haven't started preparing the actual PR yet, fortunately. :) I'll have a look at this one.

let bid;
let prevBid;

for (bid in rawBrowsers) {
Copy link

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.

@@ -118,31 +161,26 @@ const getLowestImplementedVersion = ({ features }, env) => {

const envTests = tests
.map(({ res: test, name, isBuiltIn }, i) => {

if (name === "const/basic support") {
Copy link

Choose a reason for hiding this comment

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

A debugging leftover?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep lol

@mgol
Copy link

mgol commented Mar 14, 2017

Overall looks good, I have some minor remarks.

Copy link
Member

@yavorsky yavorsky left a 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")
Copy link
Member

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.

@hzoo hzoo added the i: bug label Mar 14, 2017
Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

awesome

@existentialism existentialism merged commit ed59056 into master Mar 14, 2017
@existentialism existentialism deleted the issue207 branch March 15, 2017 16:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants