Skip to content

Conversation

@bsunderhus
Copy link
Contributor

@bsunderhus bsunderhus commented May 30, 2022

Current Behavior

New Behavior

  1. updates dependencies
  2. removes re-export from react-provider
  3. adds re-export from react-components
  4. marks Provider, Type and hooks as unstable

Related Issue(s)

Fixes #23321

1. updates dependencies
2. removes re-export from react-provider
3. adds re-export from react-components
4. marks Provider, Type and hooks as unstable
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 30, 2022

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 cd8e73e:

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

@fabricteam
Copy link
Collaborator

fabricteam commented May 30, 2022

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-accordion
Accordion (including children components)
74.036 kB
22.588 kB
74.053 kB
22.6 kB
17 B
12 B
react-avatar
Avatar
45.454 kB
13.251 kB
45.471 kB
13.265 kB
17 B
14 B
react-card
Card - All
61.928 kB
17.65 kB
61.945 kB
17.666 kB
17 B
16 B
react-card
Card
57.213 kB
16.465 kB
57.23 kB
16.48 kB
17 B
15 B
react-combobox
Combobox
61.243 kB
20.906 kB
61.28 kB
20.924 kB
37 B
18 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
181.023 kB
50.536 kB
181.061 kB
50.558 kB
38 B
22 B
react-components
react-components: FluentProvider & webLightTheme
33.944 kB
11.043 kB
33.976 kB
11.069 kB
32 B
26 B
react-menu
Menu (including children components)
111.457 kB
33.972 kB
111.491 kB
33.993 kB
34 B
21 B
react-menu
Menu (including selectable components)
114.632 kB
34.44 kB
114.666 kB
34.466 kB
34 B
26 B
react-popover
Popover
103.59 kB
31.473 kB
103.625 kB
31.503 kB
35 B
30 B
react-portal
Portal
6.272 kB
2.17 kB
6.302 kB
2.188 kB
30 B
18 B
react-positioning
usePositioning
23.828 kB
8.283 kB
23.846 kB
8.29 kB
18 B
7 B
react-provider
FluentProvider
13.993 kB
5.248 kB
14.025 kB
5.271 kB
32 B
23 B
react-slider
Slider
25.156 kB
8.113 kB
25.173 kB
8.123 kB
17 B
10 B
react-tooltip
Tooltip
43.503 kB
14.968 kB
43.56 kB
14.993 kB
57 B
25 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-button
Button
32.846 kB
8.967 kB
react-button
CompoundButton
39.753 kB
10.198 kB
react-button
MenuButton
35.018 kB
9.724 kB
react-button
SplitButton
42.259 kB
11.018 kB
react-button
ToggleButton
47.329 kB
10.513 kB
react-card
CardFooter
7.737 kB
3.266 kB
react-card
CardHeader
9.302 kB
3.776 kB
react-card
CardPreview
7.709 kB
3.287 kB
react-link
Link
11.358 kB
4.58 kB
react-radio
Radio
29.397 kB
10.043 kB
react-radio
RadioGroup
13.595 kB
5.42 kB
react-switch
Switch
25.37 kB
8.201 kB
🤖 This report was generated against 4ed24c29ddf8de037e4402d67c820b7398eaa265

@fabricteam
Copy link
Collaborator

fabricteam commented May 30, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1282 1240 5000
Button mount 788 801 5000
FluentProvider mount 2289 2374 5000
FluentProviderWithTheme mount 420 442 10
FluentProviderWithTheme virtual-rerender 370 361 10
FluentProviderWithTheme virtual-rerender-with-unmount 450 444 10
MakeStyles mount 2037 2041 50000

@size-auditor
Copy link

size-auditor bot commented May 30, 2022

Asset size changes

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

Baseline commit: 4ed24c29ddf8de037e4402d67c820b7398eaa265 (build)

@ling1726
Copy link
Contributor

@bsunderhus let's hold off on publishing this until we get to an agreement of our public API

@bsunderhus bsunderhus force-pushed the chore-mark-react-shared-context-exports-unstable branch from 3402b54 to 5a3a8f3 Compare May 30, 2022 17:55
@bsunderhus bsunderhus force-pushed the chore-mark-react-shared-context-exports-unstable branch from 5a3a8f3 to 86972a8 Compare May 31, 2022 10:03
@miroslavstastny miroslavstastny marked this pull request as ready for review May 31, 2022 16:23
} from '@fluentui/react-theme';
export { useThemeClassName } from '@fluentui/react-shared-contexts';
export {
useFluent_unstable as useFluent,
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we exporting those unstable apis from "stable" package ?

Copy link
Member

Choose a reason for hiding this comment

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

Those are part of react-components public API but we plan to refactor/remove react-shared-contexts - therefore unstable in react-shared-contexts but stable in react-components.
This PR has been created before we discussed @internal exports so we used the unstable pattern.

import type { ProviderContextValue } from './ProviderContext.types';

export const ProviderContext = React.createContext<ProviderContextValue>({
export type ProviderContextValue = {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Did we need to get rid of the types.ts file? We usually separate types into their own files.

@@ -1 +0,0 @@
export * from './TooltipContext/index';
Copy link
Member

Choose a reason for hiding this comment

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

PR shows the only line of this file was deleted, but the file was not deleted.

export type { TooltipContextType } from './TooltipContext';
export { ProviderContext, useFluent } from './ProviderContext';
export type { ProviderContextValue } from './ProviderContext';
export { ThemeContext as ThemeContext_unstable, ThemeProvider as ThemeProvider_unstable } from './ThemeContext';
Copy link
Member

Choose a reason for hiding this comment

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

Future: We should follow up with a discussion of the best way to export unstable. Do we rename in the index to add the unstable suffix, or add to the item itself. What helps devs reading the code understand it best?

import * as React from 'react';
import { clamp, useControllableState, useEventCallback } from '@fluentui/react-utilities';
import { useFluent } from '@fluentui/react-shared-contexts';
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
Copy link
Member

Choose a reason for hiding this comment

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

as slider uses useFluent to get the theme dir, what is the plan for getting this in the future?

Copy link
Member

@micahgodbolt micahgodbolt left a comment

Choose a reason for hiding this comment

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

other than being curious how we should get dir in the future, this is fine with me

@spmonahan spmonahan merged commit 335ebfc into microsoft:master May 31, 2022
@bsunderhus bsunderhus deleted the chore-mark-react-shared-context-exports-unstable branch June 1, 2022 08:14
marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
* chore: mark react-shared-context exports as unstable
1. updates dependencies
2. removes re-export from react-provider
3. adds re-export from react-components
4. marks Provider, Type and hooks as unstable

* Change

* Updates vr-tests stories

* re-exports as stable

* Update packages/react-components/react-components/etc/react-components.api.md

* Update packages/react-components/react-components/src/index.ts

Co-authored-by: Oleksandr Fediashov <[email protected]>

* Update packages/react-components/react-components/etc/react-components.api.md

* update react-provider api snapshot

Co-authored-by: ling1726 <[email protected]>
Co-authored-by: Oleksandr Fediashov <[email protected]>
Co-authored-by: Sean Monahan <[email protected]>
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.

chore: mark react-shared-context exports as unstable

9 participants