microsoft / microsoft/fluentui
[Bug]: Interfaces for FabricConfig are misaligned throughout Fluent.
@khmakoto is already working on this.
Since Feb 2, 2023.
- Dominant language
- TypeScript
- Stars
- 20.3k
- Forks
- 2.9k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 46
Description
Library
React / v8 (@fluentui/react)
System Info
System:
OS: Windows 10 10.0.22000
CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Memory: 8.75 GB / 31.94 GB
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (106.0.1370.34)
Internet Explorer: 11.0.22000.120
NOTE: I'm on Win11 Pro not 10
Are you reporting Accessibility issue?
no
Reproduction
N/A - compiler error
Bug Description
Interfaces and uses of FabricConfig are not lined up properly. If a consumer imports font-icons-mdl2 they'll get the global defined within that file and this cannot be overridden (TS feature request: https://github.com/microsoft/TypeScript/issues/36146).
Actual Behavior
If font-icons-mdl2 is imported, the window.FabricConfig interface is set globally. Unfortunately, this then doesn't align with the expected interface that Stylesheet.ts uses. As a result teams downstream doing more complex things or attempting to pull this config are stuck just @ts-ignore'ing their own globals to get around the problem.
Global from Fluent:
Uses in Stylesheet and thus what consuming teams would need if they want to grab a config and align:
Results in this error:
TS2717: Subsequent property declarations must have the same type. Property 'FabricConfig' must be of type '{ fontBaseUrl?: string | undefined; iconBaseUrl?: string | undefined; } | undefined', but here has type '{ mergeStyles?: IStyleSheetConfig | undefined; } | undefined'.
Expected Behavior
FabricConfig uses IFabricConfig and all places within FluentUI React are aligned.
Logs
No response
Requested priority
Normal
Products/sites affected
MADS
Are you willing to submit a PR to fix?
yes
Validations
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.