perf: use inline-style-expand-shorthand for expanding#1925
perf: use inline-style-expand-shorthand for expanding#1925layershifter merged 10 commits intomasterfrom
inline-style-expand-shorthand for expanding#1925Conversation
Changed dependencies are detected.Changed dependencies in
Perf comparison
Potential regressions comparing to master
Perf tests with no regressions
Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #1925 +/- ##
==========================================
+ Coverage 77.02% 79.12% +2.09%
==========================================
Files 158 156 -2
Lines 5459 4972 -487
Branches 1581 1479 -102
==========================================
- Hits 4205 3934 -271
+ Misses 1241 1025 -216
Partials 13 13
Continue to review full report at Codecov.
|
|
✅ robinweser/inline-style-expand-shorthand#11 solved |
960ec0f to
fe0e0bd
Compare
|
Closing as this has seen no activity for awhile. Please reopen if still relevant. Thanks! |
b231dc4 to
4529368
Compare
| felaPluginEmbedded(), | ||
| felaPluginPrefixer(), | ||
|
|
||
| felaExpandCssShorthandsPlugin(), |
There was a problem hiding this comment.
This move is valid as inline-style-expand-shorthand handles arrays on its side.
There was a problem hiding this comment.
How are we handling arrays exactly? As far as I can see, we are just spreading the array:
if (Array.isArray(cssPropertyValue)) {
return { ...acc, [cssPropertyName]: cssPropertyValue }
}
Is the expandProperty function handling arrays?
There was a problem hiding this comment.
expandProperty exactly, I added this functionality in robinweser/inline-style-expand-shorthand#13
inline-style-expand-shorthand for expanding
| }) | ||
| }) | ||
|
|
||
| test('should expand handle "undefined" and "null"', () => { |
There was a problem hiding this comment.
Can we add test for the array value scenario?
|
|
||
| // https://jsperf.com/array-indexof-vs-object-key-lookup2/12 | ||
| const handledCssProps: Partial<Record<keyof CSS.Properties, true>> = { | ||
| // 'font', Oops, is not supported by inline-style-expand-shorthand |
There was a problem hiding this comment.
Please add BREAKING CHANGE changelog entry
There was a problem hiding this comment.
Added and updated PR's description
BREAKING CHANGES
As
inline-style-expand-shorthanddoesn't support expanding offontCSS property this probably should be done manually in styles/overrides:Before
After
This PR replaces
css-shorthand-expand(we used compiled version of it) withinline-style-expand-shorthandwhich is used infela-plugin-expand-shorthand.We cannot use
fela-plugin-expand-shorthandas it introduced regressions due merging order so I just replacedcss-shorthand-expandwhich allows us to gain 10% performance and drop complied code.🏁 Measures
Performance diff is 9.71% for the example below.
Before
After