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

fix: added operand type to ConditionalStudioComponentProperty #335

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

kpranoto-aws
Copy link
Contributor

Description of changes:

  • Added operandType in ConditionalStudioComponentProperty
  • Parsing string values of operand to match type with operandType
  • Non-breaking change. Backwards-compatible with previous behavior (treated value as string)

@kpranoto-aws kpranoto-aws requested a review from a team January 11, 2022 22:57
@alharris-at alharris-at self-requested a review January 11, 2022 23:21
} from '../react-component-render-helper';

import { assertASTMatchesSnapshot } from './__utils__/snapshot-helpers';

Error.stackTraceLimit = Infinity;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can probably remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

default:
return factory.createStringLiteral(operand);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd prefer to leave this behavior as-is for now. Is there a need to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

default behavior restored. There was no particular need for the change

return valueToJsxLiteral(operand);
}

function valueToCorrectLiteral(value: any, valueType: string): PrimaryExpression {
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps rename to typedValueToLiteral?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed naming to distinguish between the two functions better

@alharris-at
Copy link
Contributor

Looks good Kevin, once our functional tests complete I'll merge into develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants