Skip to content

Flatten options#508

Merged
boopathi merged 5 commits intomasterfrom
options-1
Apr 21, 2017
Merged

Flatten options#508
boopathi merged 5 commits intomasterfrom
options-1

Conversation

@boopathi
Copy link
Copy Markdown
Member

@boopathi boopathi commented Apr 19, 2017

  • Removes Option Manager
  • Flattens options - having a tree of options is complex for the user as well as handling it
  • Now every plugin gets its own option name and it can be toggled or passed its own options

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2017

Codecov Report

Merging #508 into master will increase coverage by 0.41%.
The diff coverage is 90.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #508      +/-   ##
==========================================
+ Coverage   82.64%   83.06%   +0.41%     
==========================================
  Files          35       34       -1     
  Lines        2633     2521     -112     
  Branches      924      896      -28     
==========================================
- Hits         2176     2094      -82     
+ Misses        279      255      -24     
+ Partials      178      172       -6
Impacted Files Coverage Δ
packages/babel-preset-babili/src/index.js 92.59% <90.47%> (+15.31%) ⬆️

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 021eead...71cdac0. Read the comment docs.

@boopathi boopathi added Tag: Breaking Change Pull Request breaks the API Tag: Polish Pull Request for formatting, style changes, code cleanups, comments etc... labels Apr 19, 2017
proxy("keepFnName", [optionsMap.mangle, optionsMap.deadcode]),
// validate options
const validOptions = [...PLUGINS.map(p => p[0]), ...Object.keys(PROXIES)];
for (let name in opts) {
Copy link
Copy Markdown
Member

@vigneshshanmugam vigneshshanmugam Apr 20, 2017

Choose a reason for hiding this comment

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

of instead of in?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The accessor is opts[name] and opts is user passed. So better to validate all that we access instead of just accessing the own properties.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright.

@vigneshshanmugam
Copy link
Copy Markdown
Member

vigneshshanmugam commented Apr 20, 2017

Looks much cleaner and easier to validate/handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tag: Breaking Change Pull Request breaks the API Tag: Polish Pull Request for formatting, style changes, code cleanups, comments etc...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants