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 API to use strongly typed generics and push/pop style model #336

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caseycrogers
Copy link
Contributor

📜 Description

  1. Better feedback now has a generic type for an input object (passed into show) and an output object (passed into hide, returned from show) that enforces end to end type safety
  2. Legacy simpleFeedback system was moved to a static method (necessary to set the default type params)
  3. simpleFeedback now runs the onSubmit callback before closing the feedback flow
  4. Custom feedback forms are passed a FeedbakcFormController that exposes the screenshot and scroll controllers
  5. Custom feedback forms are expected to take the screenshot, construct the feedback object, and call hide themselves

💡 Motivation and Context

There are three core goals with this rewrite:

  1. Maintain a backwards compatible API for users that don't want the new features/flexibility
  2. Provide end to end type safety for custom feedback forms
  3. Allow for custom feedback flows to get the screenshot from within the form so they can run async submit logic BEFORE closing the feedback form

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

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.

1 participant