diff --git a/compiler/apps/playground/components/Editor/Output.tsx b/compiler/apps/playground/components/Editor/Output.tsx index bf7bd3eb65078..ae8154f589efa 100644 --- a/compiler/apps/playground/components/Editor/Output.tsx +++ b/compiler/apps/playground/components/Editor/Output.tsx @@ -64,12 +64,16 @@ type Props = { async function tabify( source: string, compilerOutput: CompilerOutput, + showInternals: boolean, ): Promise> { const tabs = new Map(); const reorderedTabs = new Map(); const concattedResults = new Map(); // Concat all top level function declaration results into a single tab for each pass for (const [passName, results] of compilerOutput.results) { + if (!showInternals && passName !== 'Output' && passName !== 'SourceMap') { + continue; + } for (const result of results) { switch (result.kind) { case 'hir': { @@ -225,10 +229,10 @@ function Output({store, compilerOutput}: Props): JSX.Element { } useEffect(() => { - tabify(store.source, compilerOutput).then(tabs => { + tabify(store.source, compilerOutput, store.showInternals).then(tabs => { setTabs(tabs); }); - }, [store.source, compilerOutput]); + }, [store.source, compilerOutput, store.showInternals]); const changedPasses: Set = new Set(['Output', 'HIR']); // Initial and final passes should always be bold let lastResult: string = ''; @@ -248,7 +252,7 @@ function Output({store, compilerOutput}: Props): JSX.Element { return ( <> React Compiler Playground

+
+ + Show Internals +