Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-shared-contexts): exposes internal leaks used in the API surface #25405

Conversation

bsunderhus
Copy link
Contributor

Current Behavior

As described in #25319

We have some internal leaks due to wrongly usage of @internal annotation, the newest API extraction tool will break on those scenarios

New Behavior

This PR solves internal leakages from @fluentui/react-shared-contexts by making their leaking internal typings and methods that are leaking to the API surface external.

  • useThemeClassName_unstable (✅ Make it external, it's exported at react-components)
  • useTooltipVisibility_unstable (✅ Make it external, it's exported at react-components)
  • TooltipVisibilityContextValue_unstable (✅ Make it external)
  • ThemeContextValue_unstable (✅ Make it external, it's part of react-provider surface API)

@bsunderhus bsunderhus self-assigned this Oct 27, 2022
@size-auditor
Copy link

size-auditor bot commented Oct 27, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 2a210557ea6c23470d7cf803df0f01a3f5dbc307 (build)

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 10f497c:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-accordion
Accordion (including children components)
79.243 kB
24.436 kB
react-alert
Alert
84.688 kB
21.233 kB
react-avatar
Avatar
48.874 kB
13.864 kB
react-avatar
AvatarGroup
14.996 kB
6.013 kB
react-avatar
AvatarGroupItem
68.842 kB
19.205 kB
react-button
Button
36.849 kB
9.907 kB
react-button
CompoundButton
43.874 kB
11.123 kB
react-button
MenuButton
39.543 kB
10.807 kB
react-button
SplitButton
46.989 kB
12.192 kB
react-button
ToggleButton
52.716 kB
11.381 kB
react-card
Card - All
67.664 kB
19.635 kB
react-card
Card
63.346 kB
18.539 kB
react-card
CardFooter
8.607 kB
3.622 kB
react-card
CardHeader
9.65 kB
3.962 kB
react-card
CardPreview
8.708 kB
3.678 kB
react-combobox
Combobox (including child components)
75.85 kB
24.632 kB
react-combobox
Dropdown (including child components)
75.579 kB
24.594 kB
react-components
react-components: Button, FluentProvider & webLightTheme
62.94 kB
17.663 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
189.603 kB
52.909 kB
react-components
react-components: FluentProvider & webLightTheme
33.446 kB
11.033 kB
react-dialog
Dialog (including children components)
83.147 kB
24.799 kB
react-link
Link
11.852 kB
4.888 kB
react-menu
Menu (including children components)
116.78 kB
36.112 kB
react-menu
Menu (including selectable components)
119.849 kB
36.635 kB
react-persona
Persona
53.992 kB
15.25 kB
react-popover
Popover
103.342 kB
31.82 kB
react-portal
Portal
10.628 kB
3.899 kB
react-portal-compat
PortalCompatProvider
5.857 kB
1.978 kB
react-positioning
usePositioning
19.724 kB
7.415 kB
react-progress
Progress
13.131 kB
5.039 kB
react-provider
FluentProvider
15.807 kB
5.909 kB
react-radio
Radio
36.436 kB
12.126 kB
react-radio
RadioGroup
14.294 kB
5.723 kB
react-slider
Slider
31.805 kB
10.085 kB
react-switch
Switch
33.388 kB
10.578 kB
react-tooltip
Tooltip
41.718 kB
14.687 kB
🤖 This report was generated against 2a210557ea6c23470d7cf803df0f01a3f5dbc307

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1276 1286 5000
Button mount 928 938 5000
FluentProvider mount 1515 1512 5000
FluentProviderWithTheme mount 576 581 10
FluentProviderWithTheme virtual-rerender 537 544 10
FluentProviderWithTheme virtual-rerender-with-unmount 577 589 10
MakeStyles mount 1958 1993 50000
SpinButton mount 2330 2335 5000

@bsunderhus bsunderhus marked this pull request as ready for review October 27, 2022 12:27
@bsunderhus bsunderhus requested a review from a team as a code owner October 27, 2022 12:27
Copy link
Member

@ling1726 ling1726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really strange that these are actually exported by react-components 🤔🤔🤔

@bsunderhus bsunderhus merged commit 81f33ef into microsoft:master Oct 28, 2022
@bsunderhus bsunderhus deleted the fix(react-shared-contexts)--exposes-internal-methods-and-types branch October 28, 2022 09:16
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Oct 31, 2022
* master: (22 commits)
  fix(react-menu): removes exposing of internal type FluentTriggerComponent (microsoft#25410)
  fix(react-popover): removes exposing of internal type FluentTriggerComponent (microsoft#25411)
  applying package updates
  fix(react-tooltip): removes exposing of internal type FluentTriggerComponent (microsoft#25409)
  chore: Reducing bundle size of Stack by moving selector used in multiple places to local const (microsoft#25429)
  docs(rfcs): Simple component implementation (microsoft#25139)
  Fix migration publishing (microsoft#25422)
  Integrate storywright for story tests - As part of exploring screener alternative (microsoft#25399)
  fix(react-utilities): exposes internal methods used in API surface (microsoft#25406)
  fix(react-dialog): removes exposing of internal type FluentTriggerComponent (microsoft#25408)
  fix(react-context-selector): exposes internal type ContextSelector (microsoft#25404)
  fix(react-aria): exposes internal leaking types (microsoft#25403)
  fix(react-shared-contexts): exposes internal leaks used in the API surface (microsoft#25405)
  fix(react-positioning): exposes new typings to avoid exposing internal methods (microsoft#25407)
  applying package updates
  fix: Allowing DatePicker to be focusable within FocusZones by default (microsoft#25428)
  fix: Pad in slider so the thumb does not render outside the bounds of the root element (microsoft#25378)
  feat: Add enableScopedSelectors prop to Stack that, when true, makes the Stack styles selectors be more scoped to not be as expensive in style recalculation (microsoft#25397)
  fix(react-avatar): Remove gaps between AvatarGroupItem/OveflowButton and its outline (microsoft#25382)
  fix: Combobox text attribute ignored when empty string is passed (microsoft#24665)
  ...
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants