You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(feedback): Inject preact from feedbackModal into feedbackScreenshot integration (#12535)
I believe the error we're seeing in
#12534 is from
having preact bundled twice: once into the Modal integration, and then
again into the Screenshot one.
This PR updates the Screenshot code so that it requires preact to be
injected into it, which should reduce the bundle size of that
integration, but also solve the bug because there will only be one
instance of preact and it's state within the sdk.
Fixes#12534
|`Sentry.getClient<BrowserClient>()?.getIntegration(Feedback)`|`const feedback = Sentry.getFeedback()`| Get a type-safe reference to the configured feedbackIntegration instance. |
20
-
|`feedback.getWidget()`|`const widget = feedback.createWidget(); widget.appendToDom()`| The SDK no longer maintains a stack of form instances. If you call `createWidget()` a new widget will be inserted into the DOM and an `ActorComponent` returned allows you control over the lifecycle of the widget. |
21
-
|`feedback.openDialog()`|`widget.open()`| Make the form inside the widget visible. |
22
-
|`feedback.closeDialog()`|`widget.close()`| Make the form inside the widget hidden in the page. Success/Error messages will still be rendered and will hide themselves if the form was recently submitted. |
23
-
|`feedback.removeWidget()`|`widget.removeFromDom()`| Remove the form and widget instance from the page. After calling this `widget.el.parentNode` will be set to null. |
24
-
|`feedback.attachTo()`|`const unsubscribe = feedback.attachTo(myButtonElem)`| The `attachTo()` method will create an onClick event listener to your html element that calls `appendToDom()` and `open()`. It returns a callback to remove the event listener. |
25
-
| - |`const form = await feedback.createForm()`| A new method `createForm()`, used internally by `createWidget()` and `attachTo()`, returns a `Promise<FeedbackDialog>` so you can control showing and hiding of the feedback form directly.|
|`Sentry.getClient<BrowserClient>()?.getIntegration(Feedback)`|`const feedback = Sentry.getFeedback()`| Get a type-safe reference to the configured feedbackIntegration instance. |
20
+
|`feedback.getWidget()`|`const widget = feedback.createWidget(); widget.appendToDom()`| The SDK no longer maintains a stack of form instances. If you call `createWidget()` a new widget will be inserted into the DOM and an `ActorComponent` returned allows you control over the lifecycle of the widget. |
21
+
|`feedback.openDialog()`|`widget.open()`| Make the form inside the widget visible. |
22
+
|`feedback.closeDialog()`|`widget.close()`| Make the form inside the widget hidden in the page. Success/Error messages will still be rendered and will hide themselves if the form was recently submitted. |
23
+
|`feedback.removeWidget()`|`widget.removeFromDom()`| Remove the form and widget instance from the page. After calling this `widget.el.parentNode` will be set to null. |
24
+
|`feedback.attachTo()`|`const unsubscribe = feedback.attachTo(myButtonElem)`| The `attachTo()` method will create an onClick event listener to your html element that calls `appendToDom()` and `open()`. It returns a callback to remove the event listener. |
25
+
| - |`const form = await feedback.createForm()`| A new method `createForm()`, used internally by `createWidget()` and `attachTo()`, returns a `Promise<ReturnType<FeedbackModalIntegration['createDialog']>>` so you can control showing and hiding of the feedback form directly. |
0 commit comments