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

Improve comparison by using internal typescript methods #433

Merged
merged 7 commits into from
Apr 24, 2024

Conversation

academo
Copy link
Member

@academo academo commented Feb 29, 2024

What this PR does / why we need it:

This PR is similar to #361 but it doesn't put all the trust in the typescript internal checker.

In the previous PR, the internal ts checker would report errors between two identical packages because of internal ts nuances that created fake incompatible types.

The newer approach is to trust the typescript internal methods if it says two types are compatible but, if it says they are not, we always fallback to text comparison.

Additionally I added a test case to track an edge case with typescript autogenerated types suffixes.

Which issue(s) this PR fixes:

It closes #380

Fixes #

Special notes for your reviewer:

@academo academo requested a review from a team as a code owner February 29, 2024 14:58
@academo academo requested review from mckn, jackw and leventebalogh and removed request for a team and mckn February 29, 2024 14:58
Copy link
Member Author

Choose a reason for hiding this comment

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

big fixture file extracted from a grafana/ui PR to test an edge case

Copy link
Member Author

Choose a reason for hiding this comment

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

big fixture file extracted from a grafana/ui PR to test an edge case

Copy link
Collaborator

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

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

Great enhancements 🙌
Left one question regarding the positional arguments.

src/commands/compare/compare.ts Outdated Show resolved Hide resolved
src/commands/compare/classes.test.ts Outdated Show resolved Hide resolved
src/commands/compare/classes.test.ts Show resolved Hide resolved
src/commands/compare/classes.test.ts Outdated Show resolved Hide resolved
src/commands/compare/compare.test.ts Show resolved Hide resolved
src/commands/compare/functions.test.ts Show resolved Hide resolved
byronholldorf added a commit to HewlettPackard/hpe-grafana-clusterview-panel that referenced this pull request Mar 21, 2024
initial clusterview plugin cleaned up for public release.

compatibility check failing due to bug. Expected to be fixed shortly grafana/levitate#433
Copy link
Collaborator

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

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

🚢🇮🇹

@academo academo merged commit 3f99d21 into main Apr 24, 2024
2 checks passed
@academo academo deleted the academo/prevent-declare-removal-error branch April 24, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Compatibility check finds something that doesn’t exist in my project
2 participants