From 946fa2c2fe9eb8cf9063d867cb40671e60f06429 Mon Sep 17 00:00:00 2001 From: amandaesmith333 Date: Tue, 25 Apr 2023 12:21:55 -0500 Subject: [PATCH] refactor(playground): remove unused angularModuleOptions feature --- src/components/global/Playground/index.tsx | 14 -------------- .../global/Playground/stackblitz.utils.ts | 15 --------------- 2 files changed, 29 deletions(-) diff --git a/src/components/global/Playground/index.tsx b/src/components/global/Playground/index.tsx index 209a0369971..2ef8505f1e0 100644 --- a/src/components/global/Playground/index.tsx +++ b/src/components/global/Playground/index.tsx @@ -85,17 +85,6 @@ interface UsageTargetOptions { files: { [key: string]: MdxContent; }; - angularModuleOptions?: { - /** - * The list of import declarations to add to the `AppModule`. - * Accepts value formatted as: `'import { FooComponent } from './foo.component';'`. - */ - imports: string[]; - /** - * The list of class name declarations to add to the `AppModule`. - */ - declarations?: string[]; - }; } /** @@ -331,9 +320,6 @@ export default function Playground({ // using outerText will preserve line breaks for formatting in Stackblitz editor codeBlock = codeRef.current.querySelector('code').outerText; } else { - const codeUsageTarget = code[usageTarget] as UsageTargetOptions; - editorOptions.angularModuleOptions = codeUsageTarget.angularModuleOptions; - editorOptions.files = Object.keys(codeSnippets[usageTarget]) .map((fileName) => ({ [fileName]: hostRef.current!.querySelector(`#${getCodeSnippetId(usageTarget, fileName)} code`) diff --git a/src/components/global/Playground/stackblitz.utils.ts b/src/components/global/Playground/stackblitz.utils.ts index 82d85c6010c..2b597c52a49 100644 --- a/src/components/global/Playground/stackblitz.utils.ts +++ b/src/components/global/Playground/stackblitz.utils.ts @@ -31,13 +31,7 @@ export interface EditorOptions { */ mode?: string; - angularModuleOptions?: { - imports: string[]; - declarations?: string[]; - }; - version?: number; - } const loadSourceFiles = async (files: string[], version: number) => { @@ -132,15 +126,6 @@ const openAngularEditor = async (code: string, options?: EditorOptions) => { const package_json = defaultFiles[11]; - if (options.angularModuleOptions) { - if (options.angularModuleOptions.imports) { - files[appModule] = `${options.angularModuleOptions.imports.join('\n')}\n${files[appModule]}`; - } - if (options.angularModuleOptions.declarations) { - files[appModule] = files[appModule].replace('/* CUSTOM_DECLARATIONS */', options.angularModuleOptions.declarations.map(d => `\n ${d}`).join(',')); - } - } - files[appModule] = files[appModule].replace('IonicModule.forRoot({})', `IonicModule.forRoot({ mode: '${options?.mode}' })`); let dependencies = {};