Skip to content

Commit 1ae228d

Browse files
chore(compiler): delete an unused function (stenciljs#3414)
this removes an unused function from `src/compiler/transformers/component-native/tranform-to-native-component.ts`
1 parent 9fe3f15 commit 1ae228d

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

src/compiler/transformers/component-native/tranform-to-native-component.ts

+1-50
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,12 @@ import type * as d from '../../../declarations';
22
import { addImports } from '../add-imports';
33
import { addLegacyApis } from '../core-runtime-apis';
44
import { addModuleMetadataProxies } from '../add-component-meta-proxy';
5-
import { getComponentMeta, getModuleFromSourceFile, getScriptTarget } from '../transform-utils';
6-
import { catchError, loadTypeScriptDiagnostics } from '@utils';
5+
import { getComponentMeta, getModuleFromSourceFile } from '../transform-utils';
76
import { defineCustomElement } from '../define-custom-element';
8-
import { STENCIL_CORE_ID } from '../../bundle/entry-alias-ids';
97
import { updateNativeComponentClass } from './native-component';
108
import { updateStyleImports } from '../style-imports';
119
import ts from 'typescript';
1210

13-
export const transformToNativeComponentText = (
14-
config: d.Config,
15-
compilerCtx: d.CompilerCtx,
16-
buildCtx: d.BuildCtx,
17-
cmp: d.ComponentCompilerMeta,
18-
inputJsText: string
19-
) => {
20-
let outputText: string = null;
21-
22-
try {
23-
const tsCompilerOptions: ts.CompilerOptions = {
24-
module: ts.ModuleKind.ESNext,
25-
target: getScriptTarget(),
26-
};
27-
28-
const transformOpts: d.TransformOptions = {
29-
coreImportPath: STENCIL_CORE_ID,
30-
componentExport: null,
31-
componentMetadata: null,
32-
currentDirectory: config.sys.getCurrentDirectory(),
33-
proxy: null,
34-
style: 'static',
35-
styleImportData: 'queryparams',
36-
};
37-
38-
const transpileOpts: ts.TranspileOptions = {
39-
compilerOptions: tsCompilerOptions,
40-
fileName: cmp.jsFilePath,
41-
transformers: {
42-
after: [nativeComponentTransform(compilerCtx, transformOpts)],
43-
},
44-
};
45-
46-
const transpileOutput = ts.transpileModule(inputJsText, transpileOpts);
47-
48-
buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(transpileOutput.diagnostics));
49-
50-
if (!buildCtx.hasError && typeof transpileOutput.outputText === 'string') {
51-
outputText = transpileOutput.outputText;
52-
}
53-
} catch (e: any) {
54-
catchError(buildCtx.diagnostics, e);
55-
}
56-
57-
return outputText;
58-
};
59-
6011
export const nativeComponentTransform = (
6112
compilerCtx: d.CompilerCtx,
6213
transformOpts: d.TransformOptions

0 commit comments

Comments
 (0)