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

feat: web worker based timers #2821

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

gavinbarron
Copy link
Member

Closes #2820

PR Type

  • Feature

Description of the changes

Adds a web worker based setInterval implementation

PR checklist

  • Project builds (yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)
  • All public APIs (classes, methods, etc) have been documented following the jsdoc syntax
  • Stories have been added and existing stories have been tested
  • Added appropriate documentation. Docs PR:
  • License header has been added to all new source files (yarn setLicense)
  • Contains NO breaking changes

Other information

Copy link
Contributor

Thank you for creating a Pull Request @gavinbarron.

This is a checklist for the PR reviewer(s) to complete before approving and merging this PR:

  • I have verified a documentation PR has been linked and is approved (or not applicable)
  • I have ran this PR locally and have tested the fix/feature
  • I have verified that stories have been added to storybook (or not applicable)
  • I have tested existing stories in storybook to verify no regression has occured
  • I have tested the solution in at least two browsers (Edge + 1 non-Chromium based browser)

Copy link

github-actions bot commented Nov 2, 2023

🚀 New react-contoso sample application deployed here

Copy link

github-actions bot commented Nov 2, 2023

Code Coverage

Package Line Rate Branch Rate Complexity Health
mgt-chat.src.statefulClient 100% 100% 0
mgt-chat.src.utils 96% 88% 0
mgt-components.src.components.mgt-person 56% 47% 0
mgt-components.src.components.mgt-theme-toggle 100% 100% 0
mgt-components.src.components.sub-components.mgt-flyout 30% 13% 0
mgt-components.src.components.sub-components.mgt-spinner 100% 100% 0
mgt-components.src.graph 19% 7% 0
mgt-components.src.styles 96% 64% 0
mgt-components.src.utils 40% 4% 0
mgt-element.src 39% 0% 0
mgt-element.src.components 30% 0% 0
mgt-element.src.mock 51% 42% 0
mgt-element.src.providers 39% 19% 0
mgt-element.src.utils 43% 26% 0
Summary 40% (791 / 1969) 20% (245 / 1209) 0

Copy link
Contributor

@musale musale left a comment

Choose a reason for hiding this comment

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

I've learnt a bunch of new APIs on this one. It looks good to go!

@gavinbarron
Copy link
Member Author

@musale I got to learn a bunch on it too. I used a SharedWorker so that there is only one background thread per origin running no matter how many chat instances are open. A regular worker would have sufficed too, but I wanted to try out a SharedWorker.

@gavinbarron gavinbarron merged commit 8eedbb5 into next/mgt-chat Nov 2, 2023
11 checks passed
@gavinbarron gavinbarron deleted the feat/worker-timer branch November 2, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[mgt-chat] setInterval gets throttled with the tab doesn't have focus
2 participants