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(usePerformanceObserver): new function #2736

Merged
merged 10 commits into from Mar 4, 2023

Conversation

LockingReal
Copy link
Contributor

提交获取当前页面常见性能指标参数的hook

Additional context


What is the purpose of this pull request?

  • [X ] Bug fix
  • [ √] New Feature
  • [ X] Documentation update
  • [ X] Other

Before submitting the PR, please make sure you do the following

  • [√ ] Read the Contributing Guidelines.
  • [ √] Read the Pull Request Guidelines.
  • [ √] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • [ √] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • [ √] Ideally, include relevant tests that fail without this PR but pass with it.

@vaakian
Copy link
Contributor

vaakian commented Feb 7, 2023

直接用 reactive 包裹 performance.timing 对象应该是不行的,你可能需要 PerformanceObserver 来实现响应式。

@LockingReal
Copy link
Contributor Author

直接用 reactive 包裹 performance.timing 对象应该是不行的,你可能需要 PerformanceObserver 来实现响应式。

ok,感谢感谢,我这看着改一下

@LockingReal
Copy link
Contributor Author

LockingReal commented Feb 7, 2023

老哥,我又提交了一个版本,算是wip,麻烦帮忙看一下,这个思路是对的不,packages/core/usePerformanceRecorder/index.ts,感谢感谢 @vaakian ,我这把新增的属性文档也补全了,直接调用对象身上的clear就可以清除监听了,todo是我看看有个type是resource,监听静态资源,我准备对静态资源较大的给与console.warn提示

@okxiaoliang4
Copy link
Member

@LockingReal I created a PR in your repo, I think we should keep the feature simple to focus the one thing. other feature can wrapper it.

LockingReal#1

@okxiaoliang4 okxiaoliang4 self-assigned this Feb 17, 2023
okxiaoliang4
okxiaoliang4 previously approved these changes Feb 17, 2023
@okxiaoliang4 okxiaoliang4 changed the title feat(usePerformanceRecorder): new function feat(usePerformanceObserver): new function Feb 17, 2023
@antfu
Copy link
Member

antfu commented Feb 17, 2023

If we have a stop function - shouldn't we also have a start or resume function to restart? (with an immediate option to lazy start)

@antfu antfu added the direction: approved The direction of feature/change is approved by the team. May require some small changes. label Feb 18, 2023
@antfu antfu added this to the 10.0 milestone Mar 4, 2023
@antfu antfu merged commit 21536a2 into vueuse:main Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
direction: approved The direction of feature/change is approved by the team. May require some small changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants