forked from microsoft/fast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: removes circular dependencies from web-component packages (micro…
…soft#3037) * add process to detect circular dependencies * fix fast-element circular dependencies * fix fast-element circular dependencies * fixing slider circular dependencies * fixing design-system-provider circular dependencies * fail on error in test * cleanup * pretty pretty * fixing lockfile
- Loading branch information
1 parent
3147f70
commit 0f84942
Showing
11 changed files
with
90 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/web-components/fast-components/src/design-system-consumer/design-system-consumer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...es/web-components/fast-components/src/design-system-provider/is-design-system-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DesignSystemProvider } from "./design-system-provider"; | ||
|
||
/** | ||
* Type-safe checking for if an HTMLElement is a DesignSystemProvider. | ||
* @param el The element to test | ||
*/ | ||
export function isDesignSystemProvider( | ||
el: HTMLElement | DesignSystemProvider | ||
): el is DesignSystemProvider { | ||
return ( | ||
(el as any).isDesignSystemProvider || el.tagName === "FAST-DESIGN-SYSTEM-PROVIDER" | ||
); | ||
} |
18 changes: 0 additions & 18 deletions
18
packages/web-components/fast-components/src/slider/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/web-components/fast-element/src/fast-definitions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ElementViewTemplate } from "./template"; | ||
import { ElementStyles } from "./styles"; | ||
import { AttributeConfiguration, AttributeDefinition } from "./attributes"; | ||
|
||
export class FASTElementDefinition { | ||
public constructor( | ||
public readonly name: string, | ||
public readonly attributes: ReadonlyArray<AttributeDefinition>, | ||
public readonly propertyLookup: Record<string, AttributeDefinition>, | ||
public readonly attributeLookup: Record<string, AttributeDefinition>, | ||
public readonly template?: ElementViewTemplate, | ||
public readonly styles?: ElementStyles, | ||
public readonly shadowOptions?: ShadowRootInit, | ||
public readonly elementOptions?: ElementDefinitionOptions | ||
) {} | ||
} | ||
|
||
export type PartialFASTElementDefinition = { | ||
readonly name: string; | ||
readonly template?: ElementViewTemplate; | ||
readonly styles?: ElementStyles; | ||
readonly attributes?: (AttributeConfiguration | string)[]; | ||
readonly shadowOptions?: Partial<ShadowRootInit> | null; | ||
readonly elementOptions?: ElementDefinitionOptions; | ||
}; | ||
|
||
export const fastDefinitions = new Map<Function, FASTElementDefinition>(); | ||
|
||
export function getDefinition<T extends Function>( | ||
Type: T | ||
): FASTElementDefinition | undefined { | ||
return fastDefinitions.get(Type); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters