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

Extend JSX Binary Operations Evaluation #546

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

poteboy
Copy link
Contributor

@poteboy poteboy commented Aug 20, 2023

Please describe the changes this PR makes and why it should be merged:

This PR extends the existing JSX binary operations evaluation functionality.

Changes:

  • Added evaluation support for relational operators (<, >, <=, >=).
  • Added evaluation support for equality operators (==, !=, ===, !==).

Status

  • Code changes have been tested against prettier, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the codebase
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
    • This PR changes the internal workings with no modifications to the external API (bug fixes, performance improvements)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@vercel
Copy link

vercel bot commented Aug 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
million-kitchen-sink ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2023 5:32am
sink ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2023 5:32am

@coveralls
Copy link

coveralls commented Aug 20, 2023

Pull Request Test Coverage Report for Build 5915634433

  • 1 of 41 (2.44%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 26.579%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/compiler/react/evaluator.ts 1 41 2.44%
Totals Coverage Status
Change from base Build 5913624994: -0.1%
Covered Lines: 1267
Relevant Lines: 4950

💛 - Coveralls

@poteboy poteboy requested a review from aidenybai August 20, 2023 04:43
@aidenybai
Copy link
Owner

aidenybai commented Aug 20, 2023

maybe it will be a smart idea here to extract the repeated code into a reusable function? unless it is better to have this explicit

for example, you could extract the left and right evaluation into something like "evaluateLeftAndRight" or "evaluateBasic"

@poteboy
Copy link
Contributor Author

poteboy commented Aug 20, 2023

@aidenybai
I've refactored the logic a bit. How about this one?
Edited: Sorry, I jumped into the implementation before seeing your comment.

@aidenybai aidenybai merged commit 2c356cd into main Aug 21, 2023
@aidenybai aidenybai deleted the feature/jsx-binary-operations-evaluation branch August 21, 2023 05:22
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.

3 participants