-
Notifications
You must be signed in to change notification settings - Fork 10
Revert "feat: Remove plugins related code, which is not used (#123)"
#133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,6 +109,7 @@ function record<T = eventWithTime>( | |
| userTriggeredOnInput = false, | ||
| collectFonts = false, | ||
| inlineImages = false, | ||
| plugins, | ||
| keepIframeSrcFn = () => false, | ||
| ignoreCSSAttributes = new Set([]), | ||
| errorHandler, | ||
|
|
@@ -197,7 +198,11 @@ function record<T = eventWithTime>( | |
| let incrementalSnapshotCount = 0; | ||
|
|
||
| const eventProcessor = (e: eventWithTime): T => { | ||
| // We ignore plugins here, as we do not have any | ||
| for (const plugin of plugins || []) { | ||
| if (plugin.eventProcessor) { | ||
| e = plugin.eventProcessor(e); | ||
| } | ||
| } | ||
| if ( | ||
| packFn && | ||
| // Disable packing events which will be emitted to parent frames. | ||
|
|
@@ -319,8 +324,16 @@ function record<T = eventWithTime>( | |
|
|
||
| /** | ||
| * Exposes mirror to the plugins | ||
| * We ignore plugins here, as we don't use any | ||
| */ | ||
| for (const plugin of plugins || []) { | ||
| if (plugin.getMirror) | ||
| plugin.getMirror({ | ||
| nodeMirror: mirror, | ||
| crossOriginIframeMirror: iframeManager.crossOriginIframeMirror, | ||
| crossOriginIframeStyleMirror: | ||
| iframeManager.crossOriginIframeStyleMirror, | ||
| }); | ||
| } | ||
|
Comment on lines
+328
to
+336
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not used |
||
|
|
||
| const processedNodeManager = new ProcessedNodeManager(); | ||
|
|
||
|
|
@@ -598,7 +611,23 @@ function record<T = eventWithTime>( | |
| processedNodeManager, | ||
| canvasManager, | ||
| ignoreCSSAttributes, | ||
| plugins: [], | ||
| plugins: | ||
| plugins | ||
| ?.filter((p) => p.observer) | ||
| ?.map((p) => ({ | ||
| observer: p.observer!, | ||
| options: p.options, | ||
| callback: (payload: object) => | ||
| wrappedEmit( | ||
| wrapEvent({ | ||
| type: EventType.Plugin, | ||
| data: { | ||
| plugin: p.name, | ||
| payload, | ||
| }, | ||
| }), | ||
| ), | ||
| })) || [], | ||
|
Comment on lines
+614
to
+630
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could probably remove this |
||
| }, | ||
| {}, | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1315,7 +1315,12 @@ export function initObservers( | |
| const customElementObserver = initCustomElementObserver(o); | ||
|
|
||
| // plugins | ||
| // we ignore plugins here, as we don't have any | ||
| const pluginHandlers: listenerHandler[] = []; | ||
| for (const plugin of o.plugins) { | ||
| pluginHandlers.push( | ||
| plugin.observer(plugin.callback, currentWindow, plugin.options), | ||
| ); | ||
| } | ||
|
Comment on lines
+1318
to
+1323
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not used |
||
|
|
||
| return callbackWrapper(() => { | ||
| mutationBuffers.forEach((b) => b.reset()); | ||
|
|
@@ -1332,6 +1337,7 @@ export function initObservers( | |
| fontObserver(); | ||
| selectionObserver(); | ||
| customElementObserver(); | ||
| pluginHandlers.forEach((h) => h()); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not used |
||
| }); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used