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

[DeAngular][visualization][vislib] remove angular from vislib #2138

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Aug 12, 2022

Description

  • remove angular import and $scope from Binder class since there is
    no usage in the code

Issue resolved

#2137

Check List

  • New functionality includes testing.
    • All tests pass
      • yarn test:jest
      • yarn test:jest_integration
      • yarn test:ftr
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

@ananzh ananzh added visualizations Issues and PRs related to visualizations technical debt If not paid, jeapardizes long-term success and maintainability of the repository. de-angular de-angularize work labels Aug 12, 2022
@ananzh ananzh self-assigned this Aug 12, 2022
@ananzh ananzh requested a review from a team as a code owner August 12, 2022 16:19
@ashwin-pc
Copy link
Member

Can you give more context on why we are doing this change? You have removed the constructor from the Binder class. How did you decide that it wasn't necessary.

* remove angular import and $scope from Binder class since there is
no usage in the code

Issue resolved:
opensearch-project#2137

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
@codecov-commenter
Copy link

Codecov Report

Merging #2138 (e5060c9) into main (4dd7f14) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2138   +/-   ##
=======================================
  Coverage   67.23%   67.23%           
=======================================
  Files        3100     3100           
  Lines       59566    59564    -2     
  Branches     9063     9062    -1     
=======================================
  Hits        40047    40047           
+ Misses      17332    17331    -1     
+ Partials     2187     2186    -1     
Impacted Files Coverage Δ
...lugins/vis_type_vislib/public/vislib/lib/binder.ts 58.82% <ø> (+6.19%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ananzh
Copy link
Member Author

ananzh commented Aug 16, 2022

Can you give more context on why we are doing this change? You have removed the constructor from the Binder class. How did you decide that it wasn't necessary.

Hi @ashwin-pc I put the details in the issue (#2137) . Should point it here. Do you think this is good enough?

@ananzh ananzh requested review from joshuarrrr and ashwin-pc August 16, 2022 18:41
@ashwin-pc
Copy link
Member

Yeah i saw that. My only concern is if $scope is passed in as a side effect. I'm not too familiar with angular and how the data binding $scope is passed into the component. And what this code appears to do is destroy the bind when the scope is destroyed. Have you verified that in both these instances that we never end up with $scope in the constructor?

@ananzh
Copy link
Member Author

ananzh commented Aug 24, 2022

#2137

@ashwin-pc For the two uses, I don't see any of them passing the @scope as the parameter to the constructor. There is no side effect or other places to call @scope.

@scope is a middle layer between view (html page) and controller ( to control behavior on the view, like state in react).
destroy is to remove the current scope (and all of its children) from the parent scope. and there is nothing to destroy here since all the scopes are cleaned.

I think it is safe to remove this part.

@ananzh ananzh requested a review from kavilla August 24, 2022 17:39
@kavilla
Copy link
Member

kavilla commented Aug 25, 2022

#2137

@ashwin-pc For the two uses, I don't see any of them passing the @scope as the parameter to the constructor. There is no side effect or other places to call @scope.

@scope is a middle layer between view (html page) and controller ( to control behavior on the view, like state in react). destroy is to remove the current scope (and all of its children) from the parent scope. and there is nothing to destroy here since all the scopes are cleaned.

I think it is safe to remove this part.

Makes sense to me, probably before merging we can update the pull request (via github) to include these details.

@ashwin-pc
Copy link
Member

Yeah sorry for getting back to this so late, thanks for the explanation @ananzh. That makes sense 😄

@ananzh ananzh added the v2.3.0 label Aug 25, 2022
@ananzh ananzh merged commit 730a75a into opensearch-project:main Aug 25, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 6, 2022
* remove angular import and $scope from Binder class since there is
no usage in the code

Issue resolved:
#2137

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit 730a75a)
joshuarrrr pushed a commit that referenced this pull request Sep 6, 2022
…#2270)

* remove angular import and $scope from Binder class since there is
no usage in the code

Issue resolved:
#2137

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit 730a75a)

Co-authored-by: Anan Zhuang <ananzh@amazon.com>
@ananzh ananzh deleted the deangular_vislib branch September 18, 2022 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x de-angular de-angularize work technical debt If not paid, jeapardizes long-term success and maintainability of the repository. v2.3.0 visualizations Issues and PRs related to visualizations
Projects
Development

Successfully merging this pull request may close these issues.

[DeAngular][visualization][vislib] clean angular code in vis_type_vislib
4 participants