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

refactor(theme-common): rename useDynamicCallback to useEvent #7671

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 24, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Follow-up of #7660

Rename useDynamicCallback to useEvent as it's more likely to be named that way in React core (see reactjs/rfcs#220)

Not considering this as a breaking change considering we just created the public API surface (+ it's mostly used internally in theme-common)

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@slorber slorber added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Jun 24, 2022
@slorber slorber requested review from lex111 and Josh-Cena as code owners June 24, 2022 09:30
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 24, 2022
@Josh-Cena
Copy link
Collaborator

It's likely slightly different from useEvent (in terms of update timing, for example; although I don't think that's finalized yet). Would it create confusion for external users?

@netlify
Copy link

netlify bot commented Jun 24, 2022

[V2]

Name Link
🔨 Latest commit 1bb42d7
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62b5842a0e58d800098c4570
😎 Deploy Preview https://deploy-preview-7671--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 70 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 84 🟢 100 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link

Size Change: 0 B

Total Size: 802 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.6 kB
website/build/assets/css/styles.********.css 107 kB
website/build/assets/js/main.********.js 604 kB
website/build/index.html 38.9 kB

compressed-size-action

@slorber
Copy link
Collaborator Author

slorber commented Jun 24, 2022

It's likely slightly different from useEvent (in terms of update timing, for example; although I don't think that's finalized yet). Would it create confusion for external users?

We'll replace it with useEvent() once released anyway and the small differences are for quite specific edge cases.

We can simply document this as a temporary userland implementation until the official hook is released. In any case the user should be aware of the potential limitations of the userland implementation, as explained in the RFC.

@slorber slorber merged commit 2c7012f into main Jun 24, 2022
@slorber slorber deleted the slorber/rename-useDynamicCallback branch June 24, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants