-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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-storybook-addon): transform decorator to function in withAriaLive() #32011
Merged
Conversation
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
📊 Bundle size report✅ No changes found |
fabricteam
reviewed
Jul 16, 2024
packages/react-components/react-storybook-addon/src/decorators/withAriaLive.tsx
Show resolved
Hide resolved
layershifter
force-pushed
the
fix/decorators
branch
4 times, most recently
from
July 16, 2024 13:39
b67556e
to
1f2491c
Compare
can we postpone this until #31939 lands as there seems to be a lot of VR diffs caused by this change ? |
Hotell
changed the title
fix(storybook-addon): fix decorators to functions
fix(react-storybook-addon): fix decorators to functions
Jul 16, 2024
layershifter
changed the title
fix(react-storybook-addon): fix decorators to functions
fix(react-storybook-addon): transform decorator to function in withAriaLive()
Jul 16, 2024
Hotell
reviewed
Jul 16, 2024
packages/react-components/react-storybook-addon/src/decorators/withAriaLive.tsx
Outdated
Show resolved
Hide resolved
layershifter
force-pushed
the
fix/decorators
branch
from
July 18, 2024 14:11
1f2491c
to
8235c55
Compare
layershifter
force-pushed
the
fix/decorators
branch
from
July 18, 2024 14:27
8235c55
to
3d58924
Compare
Hotell
reviewed
Jul 19, 2024
packages/react-components/react-storybook-addon/src/decorators/withFluentProvider.tsx
Outdated
Show resolved
Hide resolved
Hotell
reviewed
Jul 19, 2024
Hotell
approved these changes
Jul 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added some suggestion but overall
LGTM
ty
layershifter
force-pushed
the
fix/decorators
branch
from
July 23, 2024 13:43
ae92534
to
e5257ff
Compare
marcosmoura
added a commit
to marcosmoura/fluentui
that referenced
this pull request
Jul 25, 2024
* master: (77 commits) chore(react-examples): replace storybook deprecated api with static stories (microsoft#32074) [chore]: create base class for accordion item and remove style and layout specific api (microsoft#32102) release: applying package updates - web-components chore(web-components): add test for complex focus management (microsoft#32009) [chore]: create base class for avatar and remove style and layout specific api (microsoft#32083) [chore]: create base class for text input and remove style and layout specific api (microsoft#32080) release: applying package updates - web-components chore:(react-nav-preview) Scaffold AppItem (microsoft#32088) docs(`react-teaching-popover`): Adding subcomponents' API to `TeachingPopover` documentation page (microsoft#32084) feat(web-components): relax setTheme() argument type to allow custom tokens (microsoft#32087) release: applying package updates - react-components [Chore]: Create Spinner base class to abstract out style and layout specific api. (microsoft#32067) [Chore]: Create Progress Bar base class to abstract out style and layout specific api. (microsoft#32066) fix(react-storybook-addon): transform decorator to function in withAriaLive() (microsoft#32011) fix(motion): improve Web Animations API detection in tests (microsoft#32029) chore(eslint-plugin): removes type dependency on @fluentui/react-utilities internals in ban-instanceof-html-element rule (microsoft#32072) release: applying package updates - react v8 release: applying package updates - web-components Chore: Create Divider base class to abstract out style and layout specific api (microsoft#32065) fix(TimePicker): Clear text when date value changes to null (microsoft#31626) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous Behavior
#31794 added a new decorator
withAriaLive()
. That decorator has conditional rendering:fluentui/packages/react-components/react-storybook-addon/src/decorators/withAriaLive.tsx
Line 16 in 1c2c200
The problem is that it's implemented according to Storybook 6 docs and stories as a function:
fluentui/packages/react-components/react-storybook-addon/src/decorators/withAriaLive.tsx
Line 6 in 1c2c200
That causes an issue with a conditional rendering due effect order:
This issue breaks stories that rely on
useEffect(fn, [])
as they are executed in wrong order.New Behavior
The PR changes decorators to be called as React components. The same is suggested in Storybook 7 & 8 docs (https://storybook.js.org/docs/writing-stories/decorators#component-decorators).The PR updateswithAriaLive()
with an explicit condition for VR tests as VR tooling will fail to get stories for steps otherwise (seefindSteps()
innode_modules/storywright/src/StoryWrightProcessor/GetStories.js
)This fixed the order or effects:
Related Issue(s)
Fixes #32010.