marko-js / htmljs-parser

An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values
MIT License
135 stars 20 forks source link

perf: optimize parser constructor #136

Closed DylanPiercey closed 2 years ago

DylanPiercey commented 2 years ago

Description

Small parser performance improvement by optimizing the base parser constructor to not initialize undefined properties.

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 0ba0cde0584ae1005912f897db1578d2522c4147

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------- | ----- | | htmljs-parser | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 2 years ago

Codecov Report

Merging #136 (0ba0cde) into main (cdbc6b2) will decrease coverage by 0.00%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
- Coverage   92.14%   92.13%   -0.01%     
==========================================
  Files          26       26              
  Lines         802      801       -1     
  Branches      268      268              
==========================================
- Hits          739      738       -1     
  Misses         48       48              
  Partials       15       15              
Impacted Files Coverage Δ
src/core/Parser.ts 90.10% <100.00%> (-0.11%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.