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

OpenedTracesWidget: modernize method binding #1175

Merged

Conversation

williamsyang-work
Copy link
Contributor

What it does

Modernizes method binding patterns in OpenedTracesWidget as part of #1173.

How to test

  1. Run the existing test suite
  2. Verify REFACTORED_COMPONENT functionality remains unchanged
  3. Review code changes to confirm all delegation patterns and .bind(this) calls have been replaced with arrow functions

Follow-ups

No technical debt introduced. This PR reduces existing technical debt by simplifying the codebase.

Review checklist

  • As an author, I have thoroughly tested my changes and carefully followed the instructions in this template

Remove redundant method delegation patterns and explicit .bind(this)
usage in favor of arrow functions. This modernization aligns with
TypeScript best practices and reduces unnecessary code complexity while
maintaining identical functionality.

Changes:

Replace method delegation pattern with direct arrow function implementation
Remove explicit .bind(this) calls where arrow functions are used
Maintain existing behavior and functionality
Improve code readability

Related to eclipse-cdt-cloud#1173

Signed-off-by: Will Yang <william.yang@ericsson.com>
@williamsyang-work williamsyang-work marked this pull request as ready for review February 11, 2025 21:17
Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

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

It looks good to me. Thanks for the update.

One note about renaming public/protect methods. This is actually API changing. However, at this stage of the project (pre v1.0) I think it's ok to do such clean-up code. The vscode-trace-extension, for example, doesn't override such methods and is not impacted.

Copy link
Contributor

@marcdumais-work marcdumais-work left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @williamsyang-work !

@bhufmann bhufmann merged commit 135bbb4 into eclipse-cdt-cloud:master Feb 13, 2025
8 checks passed
@bhufmann
Copy link
Collaborator

@williamsyang-work do you plan to update the other components as well, e.g. ReactAvailableViewsWidget? Please let me know.

@williamsyang-work
Copy link
Contributor Author

It looks good to me. Thanks for the update.

One note about renaming public/protect methods. This is actually API changing. However, at this stage of the project (pre v1.0) I think it's ok to do such clean-up code. The vscode-trace-extension, for example, doesn't override such methods and is not impacted.

Ah, I didn't realize this. I will keep this in mind when making future changes.

@williamsyang-work
Copy link
Contributor Author

@williamsyang-work do you plan to update the other components as well, e.g. ReactAvailableViewsWidget? Please let me know.

Yes, I was planning on it. I wanted to do one component at a time for an easier review process. But if someone else makes a change before me that's fine too.

It seems like a possible good first issue.

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.

4 participants