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

[CCI] Add bluebird replaces for plugins/vis_type_tagcloud #4028

Closed

Conversation

Nicksqain
Copy link
Contributor

@Nicksqain Nicksqain commented May 14, 2023

Description

Issues Resolved

Check List

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

Nicksqain added 2 commits May 14, 2023 13:46
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

Merging #4028 (698f208) into main (b04e657) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #4028   +/-   ##
=======================================
  Coverage   66.43%   66.43%           
=======================================
  Files        3229     3229           
  Lines       62069    62069           
  Branches     9599     9599           
=======================================
  Hits        41234    41234           
  Misses      18531    18531           
  Partials     2304     2304           
Flag Coverage Δ
Linux 66.38% <ø> (+<0.01%) ⬆️
Windows 66.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@abbyhu2000 abbyhu2000 added the OSCI Open Source Contributor Initiative label May 16, 2023
Nicksqain added 3 commits May 17, 2023 10:47
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
@manasvinibs manasvinibs force-pushed the bluebird-vis_type_tagcloud branch from 649d8dc to ab39915 Compare May 17, 2023 17:47
@manasvinibs
Copy link
Member

@Nicksqain Can you add the missing changelog entry to the PR?

@Nicksqain
Copy link
Contributor Author

@Nicksqain Can you add the missing changelog entry to the PR?

Yes, of course.
I was waiting for an answer on how best to create a changelog for the current issue

@manasvinibs
Copy link
Member

@Nicksqain Can you add the missing changelog entry to the PR?

Yes, of course. I was waiting for an answer on how best to create a changelog for the current issue

I would say Maintenance or Refactoring is the best place to add changelog entry for this change.

@Nicksqain
Copy link
Contributor Author

I would say Maintenance or Refactoring is the best place to add changelog entry for this change.

Yes, thank you. I did, I added it to refactoring.
But I asked on the issue page if I needed to add an entry for each PR, or skip changelog

@manasvinibs
Copy link
Member

manasvinibs commented May 19, 2023

I would say Maintenance or Refactoring is the best place to add changelog entry for this change.

Yes, thank you. I did, I added it to refactoring. But I asked on the issue page if I needed to add an entry for each PR, or skip changelog

I would suggest change log for a PR is a good strategy as long as single PR solves one problem at a time or same problem within the scope of logical separated component. If your PR's are spread across to fix single issue of concern which is in this case I think, it's reasonable to include a changelog in one of the PR's as opposed to changelog in each PR as the primary intention of having changelog here is for the release tracker.
If this PR cleans all the usages of Bluebird modules in vis_type_tagcloud plugin, then it can have a changelog for plugin specific refactoring I think.

import { TagCloud } from './tag_cloud';
import { setHTMLElementOffset, setSVGElementGetBBox } from '../../../../test_utils/public';

function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
Copy link
Member

Choose a reason for hiding this comment

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

Are there any benefit in using setImmediate() over setTimeout()here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think there will be any difference in performance in this case.
setTimeout() has the same priority as delay from bluebird.
setImmediate() can be executed earlier, which can cause errors

Copy link
Member

Choose a reason for hiding this comment

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

As @AMoo-Miki suggested in ur other PR, this delay is used many times. We should move to a single place to avoid the redundance.

Comment on lines +155 to +159
await new Promise((resolve) => {
tagCloud.once('renderComplete', () => {
resolve();
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this piece is used so many times, I would recommend you pull it out into a function of its own; something like:

const waitForRenderCompletion = async (tagCloud) => 
  new Promise((resolve) => {
    tagCloud.once('renderComplete', resolve);
  });

Copy link
Member

Choose a reason for hiding this comment

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

+1 to both put this func out and use
tagCloud.once('renderComplete', resolve)); cuz (() => { resolve(); }) doesn't add anything in terms of functionality; it just calls resolve with no arguments.

@ananzh ananzh assigned ananzh and manasvinibs and unassigned manasvinibs May 31, 2023
@ananzh ananzh added the v2.9.0 label May 31, 2023
import { TagCloud } from './tag_cloud';
import { setHTMLElementOffset, setSVGElementGetBBox } from '../../../../test_utils/public';

function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
Copy link
Member

Choose a reason for hiding this comment

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

As @AMoo-Miki suggested in ur other PR, this delay is used many times. We should move to a single place to avoid the redundance.

Comment on lines +155 to +159
await new Promise((resolve) => {
tagCloud.once('renderComplete', () => {
resolve();
});
});
Copy link
Member

Choose a reason for hiding this comment

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

+1 to both put this func out and use
tagCloud.once('renderComplete', resolve)); cuz (() => { resolve(); }) doesn't add anything in terms of functionality; it just calls resolve with no arguments.

@ananzh ananzh added technical debt If not paid, jeapardizes long-term success and maintainability of the repository. backport 2.x labels Jun 1, 2023
@joshuarrrr joshuarrrr added the needs more info Requires more information from poster label Jun 13, 2023
@joshuarrrr joshuarrrr added v2.10.0 and removed v2.9.0 labels Jul 5, 2023
@abbyhu2000
Copy link
Member

Convert to draft for now, can be marked as ready again when the requested changes are resolved.

@abbyhu2000 abbyhu2000 marked this pull request as draft July 25, 2023 19:17
@ananzh
Copy link
Member

ananzh commented Jul 25, 2024

@Nicksqain Due to an extended period without updates, we're going to close this issue for now. We appreciate your contribution and understand that priorities and availability can change. Please feel free to reopen this issue when you have the opportunity to revisit it. Thank you for your understanding.

@ananzh ananzh closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Requires more information from poster OSCI Open Source Contributor Initiative repeat-contributor technical debt If not paid, jeapardizes long-term success and maintainability of the repository.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate Bluebird in favor of native async functionality
6 participants