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

Site Migration: Add a documentation for the useFlowNavigator hook #94591

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

valterlorran
Copy link
Contributor

Related to #

Proposed Changes

  • Add documentation to the useFlowNavigator hook, as I found it difficult to understand without looking at the definition.

Why are these changes being made?

Testing Instructions

  • Visual inspection is enough, as it only adds documentation.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@valterlorran valterlorran requested a review from a team September 16, 2024 18:26
@valterlorran valterlorran self-assigned this Sep 16, 2024
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 16, 2024
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@valterlorran valterlorran force-pushed the add/documentation-use-flow-navigator branch from 41c6bb7 to 4f68183 Compare September 16, 2024 18:47
@matticbot
Copy link
Contributor

matticbot commented Sep 16, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/documentation-use-flow-navigator on your sandbox.

@@ -8,14 +8,52 @@ interface Options {
persistedUrlParams: string[];
}

/**
* Custom hook for managing navigation within a flow, handling query parameters and step transitions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Using typescript, we don't need to describe the type; you can just explain what the prop does directly over the property definition, like this example. The reason of this approach is we will have the best of both worlds, the type checking and the editor describing the type and our comment describing the intent.

The same idea is applicable to the return type, we can have another interface just describing the output.

The same for the return, we can have another interface describing the type.

@gabrielcaires
Copy link
Contributor

Add documentation to the useFlowNavigator hook, as I found it difficult to understand without looking at the definition.

Thanks for the feedback and contribution.
@renatho and I were exploring ways to reduce the required work to manage a flow, but I agree some decisions are unclear without a doc.

I just left a suggestion regarding the format.

@valterlorran
Copy link
Contributor Author

@gabrielcaires, I removed the type from the hook parameters. However, I left it for the functions provided by the hook. I also left the return types. Let me know what you think about it.

@valterlorran valterlorran merged commit 806bf9f into trunk Oct 15, 2024
11 checks passed
@valterlorran valterlorran deleted the add/documentation-use-flow-navigator branch October 15, 2024 15:45
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants