diff --git a/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts b/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts index ec5c2ac7ba52..9533a472fa05 100644 --- a/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts +++ b/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts @@ -201,7 +201,7 @@ export abstract class AbstractRenderer { const currentStoryRender = { storyFnAngular, - moduleMetadataSnapshot: stringify(moduleMetadata), + moduleMetadataSnapshot: stringify(moduleMetadata, { allowFunction: false }), }; this.previousStoryRenderInfo.set(targetDOMNode, currentStoryRender); diff --git a/code/frameworks/angular/template/stories/basics/component-with-provider/di.component.ts b/code/frameworks/angular/template/stories/basics/component-with-provider/di.component.ts index 11335b4131c8..e3e8a28ac18f 100644 --- a/code/frameworks/angular/template/stories/basics/component-with-provider/di.component.ts +++ b/code/frameworks/angular/template/stories/basics/component-with-provider/di.component.ts @@ -23,6 +23,6 @@ export class DiComponent { } elRefStr(): string { - return stringify(this.elRef, { maxDepth: 1 }); + return stringify(this.elRef, { maxDepth: 1, allowFunction: false }); } } diff --git a/code/lib/channels/src/postmessage/index.ts b/code/lib/channels/src/postmessage/index.ts index e1c7332121b6..267e8a34f18a 100644 --- a/code/lib/channels/src/postmessage/index.ts +++ b/code/lib/channels/src/postmessage/index.ts @@ -20,7 +20,7 @@ const { document, location } = global; export const KEY = 'storybook-channel'; -const defaultEventOptions = { allowFunction: true, maxDepth: 25 }; +const defaultEventOptions = { allowFunction: false, maxDepth: 25 }; // TODO: we should export a method for opening child windows here and keep track of em. // that way we can send postMessage to child windows as well, not just iframe diff --git a/code/lib/channels/src/websocket/index.ts b/code/lib/channels/src/websocket/index.ts index b4530de965c9..a46df1c28610 100644 --- a/code/lib/channels/src/websocket/index.ts +++ b/code/lib/channels/src/websocket/index.ts @@ -60,7 +60,11 @@ export class WebsocketTransport implements ChannelTransport { } private sendNow(event: any) { - const data = stringify(event, { maxDepth: 15, allowFunction: true }); + const data = stringify(event, { + maxDepth: 15, + allowFunction: false, + ...global.CHANNEL_OPTIONS, + }); this.socket.send(data); } diff --git a/code/ui/blocks/src/blocks/SourceContainer.tsx b/code/ui/blocks/src/blocks/SourceContainer.tsx index c24b320c4330..fbb019a6bd32 100644 --- a/code/ui/blocks/src/blocks/SourceContainer.tsx +++ b/code/ui/blocks/src/blocks/SourceContainer.tsx @@ -11,7 +11,7 @@ import { stringify } from 'telejson'; type ArgsHash = string; export function argsHash(args: Args): ArgsHash { - return stringify(args); + return stringify(args, { allowFunction: false }); } export interface SourceItem {