Skip to content

Commit

Permalink
fix: ensure we do not double-process userland component types.
Browse files Browse the repository at this point in the history
  • Loading branch information
gumptious committed Nov 14, 2019
1 parent a474982 commit d569399
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/targets/src/ios/ios.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {getTempFileName, loadComponentModule, sourcesPath} from '../utils';
const coreIos = join(sourcesPath, 'ios');

interface IosOutput {
processedComponents: Set<string>;
imports: Set<string>;
sources: Set<string>;
dependencies: Set<IosDependency>;
Expand Down Expand Up @@ -65,6 +66,10 @@ const processComponentInstance = async (
output: IosOutput,
namedComponentMap: NamedComponentMap,
): Promise<boolean> => {
if (output.processedComponents.has(name)) {
return true;
}

const targetComponent = namedComponentMap.get(name);
if (!targetComponent) {
warning(`Unable to find component definition for ${name}!`);
Expand Down Expand Up @@ -149,6 +154,7 @@ const processComponentInstance = async (
output.sources.add(filename);
}

output.processedComponents.add(name);
return true;
};

Expand Down Expand Up @@ -177,6 +183,7 @@ export const iosHandler: CompilerTargetHandler = async (
) => {
const componentModule = await loadComponentModule(projectRoot);
const output: IosOutput = {
processedComponents: new Set(),
imports: new Set(['Foundation', 'WebKit']),
sources: new Set([
join(coreIos, 'Diez.swift'),
Expand Down

0 comments on commit d569399

Please sign in to comment.