Bug Report
- Package version(s): 5.96.0
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? (Yes, No)
Requested priority: (High)
Describe the issue:
In an effort to reduce bundle size on critical path rendering, we are trying to defer what is not required upfront.
One such control from Fabric for us is ContextualMenu, which is required for edit scenario mostly.
However What I learned is we cannot chunk this from core because we need BaseButton and It has hard dependency on IContextualMenuProps. Which is fine.
Unfortunately IContextualMenuProps have hard dependency on ContextualMenu which is not fine.
export interface IContextualMenuProps extends React.Props<ContextualMenu>, IWithResponsiveModeState {
We generally want to avoid Interfaces depending upon class.
Interfaces are zero code in JS once compiled from TS but as soon they depends upon class or non const enums, they are not free.
Even keeping enums and interfaces into separate files are required when chunking the code for deferred loading, otherwise chunking does not work.
We also encourage to use const enum over enum [whenever possible], as it churns zero code and reduce bundle size as well runtime cost.
Actual behavior:
Expected behavior:
If applicable, please provide a codepen repro:
Bug Report
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? (Yes, No)
Requested priority: (High)
Describe the issue:
In an effort to reduce bundle size on critical path rendering, we are trying to defer what is not required upfront.
One such control from Fabric for us is ContextualMenu, which is required for edit scenario mostly.
However What I learned is we cannot chunk this from core because we need BaseButton and It has hard dependency on IContextualMenuProps. Which is fine.
Unfortunately IContextualMenuProps have hard dependency on ContextualMenu which is not fine.
We generally want to avoid Interfaces depending upon class.
Interfaces are zero code in JS once compiled from TS but as soon they depends upon class or non const enums, they are not free.
Even keeping enums and interfaces into separate files are required when chunking the code for deferred loading, otherwise chunking does not work.
We also encourage to use const enum over enum [whenever possible], as it churns zero code and reduce bundle size as well runtime cost.
Actual behavior:
Expected behavior:
If applicable, please provide a codepen repro: