Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(fela): plugin order, invokeKeyframes #1741

Merged
merged 25 commits into from
Aug 8, 2019
Merged

Conversation

lucivpav
Copy link
Contributor

@lucivpav lucivpav commented Jul 31, 2019

plugin order

This PR resolves and tests a problem with felaRenderer. The order of plugins being executed actually matters. The problem is that felaPluginFallbackValue() comes before felaInvokeKeyframesPlugin().

felaPluginFallbackValue() does the following:
Input
{
color: [ 'rgba(0, 0, 0, 0.5)', '#ccc']
}
Output
{
color: 'rgba(0, 0, 0, 0.5);color:#ccc'
}

But if we have, say, an Animation with keyframeParams=[ '0%', '50%', '100%' ], the array would be processed felaPluginFallbackValue(). If the keyframe function expects an array, we get an error, because the keyFrameParams is no longer an array.

invokeKeyframes

The checkboxStyles definition contains root: display: ['inline-grid', '-ms-inline-grid']. This gets processed by felaInvokeKeyframesPlugin incorrectly, rendering it as root: display: { 0: 'inline-grid', 1: '-ms-inline-grid' }.

@vercel vercel bot temporarily deployed to staging August 1, 2019 09:40 Inactive
@vercel vercel bot temporarily deployed to staging August 1, 2019 09:44 Inactive
@lucivpav lucivpav changed the title fix(fela): animation fix(fela): plugin order Aug 1, 2019
@lucivpav
Copy link
Contributor Author

lucivpav commented Aug 1, 2019

This PR is to be merged after #1744

@lucivpav lucivpav changed the title fix(fela): plugin order fix(fela): plugin order, felaInvokeKeyframesPlugin Aug 2, 2019
@@ -56,4 +56,12 @@ describe('felaRenderKeyframesPlugin', () => {
animationDuration: '2s',
})
})

test('does not transform a list of strings', () => {
Copy link
Contributor Author

@lucivpav lucivpav Aug 2, 2019

Choose a reason for hiding this comment

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

Maybe the felaInvokeKeyframesPlugin fix and test should be moved into a separate commit? The reason for this fix is that screener tests are failing, if the order of plugins is changed.

Copy link
Contributor Author

@lucivpav lucivpav Aug 2, 2019

Choose a reason for hiding this comment

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

The checkboxStyles definition contains root: display: ['inline-grid', '-ms-inline-grid']. This gets processed by felaInvokeKeyframesPlugin incorrectly, rendering it as root: display: { 0: 'inline-grid', 1: '-ms-inline-grid' }.

@lucivpav lucivpav changed the title fix(fela): plugin order, felaInvokeKeyframesPlugin fix(fela): plugin order, invokeKeyframes Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants