Repository navigation
Conversation
|
Technically this allows replacing the "under 700 bytes" claim with "under 600 bytes" 😉 |
| } | ||
| props += propsClose + ',' + field; | ||
| propsClose = ''; | ||
| else if (mode === MODE_WHITESPACE && buffer === '...') { |
There was a problem hiding this comment.
Just sanity-checking: if we're not in MODE_TEXT but are in MODE_WHITESPACE, we're guaranteed to be in a tag. Sound right?
There was a problem hiding this comment.
Yes, whenever we're not in MODE_TEXT then we're in a tag.
Thanks to @mikesherov for spotting this!
Thanks to @mikesherov for pointing this out!
|
The situation after the changes suggested by @mikesherov 🙌 Before this PR After this PR |
|
Caught one more thing that isn’t in the diff. Can replace the two instances of |
|
Yup, I tried that as well as replacing |
|
I've generally had good luck sticking with stricter equality for performance, and then just using it really consistently to ensure gzip compresses things effectively. |
|
Backported size optimizations from PR #53, the numbers are now the following (benchmarks executed without Jest): Before change After change |
|
Added multi-root support, benchmarks are not affected and the file sizes are: |
|
After the latest changes the code sizes are: Benchmarks seem to be unaffected. |
|
Closing this in favor of #62. Your size optimizations live on there, @mikesherov! 🙂 |
This pull request optimizes the size of the minified & compressed library. Mostly it's using the trick is collapsing a state flag and a appendable string together, like
propsClosepreviously.inTagby using themodevariable for it instead (we're not in a tag ifmode === MODE_TEXT).Object.assign.childCloseandtagClose.propHasValuewithfallbackPropValuethat can be stringified instead whenbufferis empty.These changes together have the following effect on the library size:
Before change:
After change: