Skip to content

Commit 431f2e0

Browse files
refactor(playground): remove unused angularModuleOptions feature (#2933)
1 parent 3da7c10 commit 431f2e0

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/components/global/Playground/index.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,6 @@ interface UsageTargetOptions {
8585
files: {
8686
[key: string]: MdxContent;
8787
};
88-
angularModuleOptions?: {
89-
/**
90-
* The list of import declarations to add to the `AppModule`.
91-
* Accepts value formatted as: `'import { FooComponent } from './foo.component';'`.
92-
*/
93-
imports: string[];
94-
/**
95-
* The list of class name declarations to add to the `AppModule`.
96-
*/
97-
declarations?: string[];
98-
};
9988
}
10089

10190
/**
@@ -331,9 +320,6 @@ export default function Playground({
331320
// using outerText will preserve line breaks for formatting in Stackblitz editor
332321
codeBlock = codeRef.current.querySelector('code').outerText;
333322
} else {
334-
const codeUsageTarget = code[usageTarget] as UsageTargetOptions;
335-
editorOptions.angularModuleOptions = codeUsageTarget.angularModuleOptions;
336-
337323
editorOptions.files = Object.keys(codeSnippets[usageTarget])
338324
.map((fileName) => ({
339325
[fileName]: hostRef.current!.querySelector<HTMLElement>(`#${getCodeSnippetId(usageTarget, fileName)} code`)

src/components/global/Playground/stackblitz.utils.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,7 @@ export interface EditorOptions {
3131
*/
3232
mode?: string;
3333

34-
angularModuleOptions?: {
35-
imports: string[];
36-
declarations?: string[];
37-
};
38-
3934
version?: number;
40-
4135
}
4236

4337
const loadSourceFiles = async (files: string[], version: number) => {
@@ -132,15 +126,6 @@ const openAngularEditor = async (code: string, options?: EditorOptions) => {
132126

133127
const package_json = defaultFiles[11];
134128

135-
if (options.angularModuleOptions) {
136-
if (options.angularModuleOptions.imports) {
137-
files[appModule] = `${options.angularModuleOptions.imports.join('\n')}\n${files[appModule]}`;
138-
}
139-
if (options.angularModuleOptions.declarations) {
140-
files[appModule] = files[appModule].replace('/* CUSTOM_DECLARATIONS */', options.angularModuleOptions.declarations.map(d => `\n ${d}`).join(','));
141-
}
142-
}
143-
144129
files[appModule] = files[appModule].replace('IonicModule.forRoot({})', `IonicModule.forRoot({ mode: '${options?.mode}' })`);
145130

146131
let dependencies = {};

0 commit comments

Comments
 (0)