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

perf(dom): Improve DOM utils code for minification & tree-shaking #1284

Merged
merged 6 commits into from Nov 5, 2017

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented Nov 4, 2017

Move polyfill functions into respective dom utility and avoid polyfilling native prototype

Rather than polyfill, use native where available, and fallback to emulation function
@codecov-io
Copy link

codecov-io commented Nov 4, 2017

Codecov Report

Merging #1284 into dev will decrease coverage by 0.61%.
The diff coverage is 15.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1284      +/-   ##
==========================================
- Coverage   42.44%   41.83%   -0.62%     
==========================================
  Files         130      130              
  Lines        2721     2701      -20     
  Branches      858      858              
==========================================
- Hits         1155     1130      -25     
- Misses       1252     1255       +3     
- Partials      314      316       +2
Impacted Files Coverage Δ
src/utils/dom.js 23.37% <15.21%> (-20.96%) ⬇️

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 037ad08...ff513b2. Read the comment docs.

@tmorehouse tmorehouse changed the title perf(dom): Improve code for minification & tree-shaking perf(dom): Improve code for minification & tree-shaking of DOM utilities Nov 4, 2017
@tmorehouse tmorehouse changed the title perf(dom): Improve code for minification & tree-shaking of DOM utilities perf(dom): Improve DOM utils code for minification & tree-shaking Nov 4, 2017
Since we do not support IE 8 (or 9 for that matter), we can use the faster polyfill that uses the 'Element..matches' function.

But since Element.matches may be a prefixed function in some browsers, we use our own `matches` handler
@tmorehouse tmorehouse merged commit e1e701b into dev Nov 5, 2017
@tmorehouse tmorehouse deleted the tmorehouse/dom branch November 5, 2017 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants