Closed StefanusChristian closed 1 year ago
@StefanusChristian Also do we have the example of buttonRipple not working properly on the IOS? curious what's the actual result of these bug
Great work @StefanusChristian! We might need to update the repo settings before merging your changes because right now it's blocked by a dead circleci check.
@ikusa @darcien
Here's the video showing the ButtonRipple
problem on iOS. The button onPress
is invoked but didn't show the ripple animation at all.
Let's not block the upgrade PR on the button ripple issue. I'm keen to ship this B I G P R ASAP and address the minor issues separately.
For the repo setting (remove/bypass the circleci check), do you have the authority for that @darcien? I think I don't have the permission, so I can't adjust the setting
I've removed the required CircleCI check for merging the PR. In the future, we will need to migrate the CI.
@StefanusChristian can you try running the tests locally and see if it passes? After that is checked, we should be good to go
For the repo setting (remove/bypass the circleci check), do you have the authority for that @darcien? I think I don't have the permission, so I can't adjust the setting
I've removed the required CircleCI check for merging the PR. In the future, we will need to migrate the CI.
@StefanusChristian can you try running the tests locally and see if it passes? After that is checked, we should be good to go
It seems the jest preset is error for getBaseWebPreset
, since the jest-preset
is removed from the latest react-native-web
(0.18.xx
). Reference: https://github.com/necolas/react-native-web/issues/2312
Do you guys have any idea on how to fix the jest-preset
? @ikusa @darcien
@ikusa @darcien Web jest & test finally adjusted πππ
I'll list the changes for making the web test work in here:
getBaseWebPreset
(web platform jest-preset) to use module mapper based on latest rnw docs and set testEnvironment
to jsdom
for web.@testing-library/react
& react-dom
to match our current react
version.testID
on some component that will turn into data-testid
when rendered on our web test. Reference.@testing-library/react
: wait
into waitFor
and fireEvent.click
usage. For fireEvent
adjustment, somehow the fireEvent.click
call doesn't trigger the mock function, so I use below form instead and it works. This might need more time to investigate but I think the adjustment is good for now
From:
fireEvent.click(getByTestId('button'));
Into:
fireEvent( getByTestId('button'), new MouseEvent('click', { bubbles: true, cancelable: true, }), );
Changes:
Package & Example app changes:
react
,react-native
,react-native-web
,react-native-paper
,react-native-collapsible
version.react-native-calendars
from Yoan repository into latest version. (changes from @JonathanRadotski https://github.com/StefanusChristian/infra/pull/1/files)example
directory. Since the previous one was still in SDK40, it is easier to create a new one instead of updating it to SDK47.patch-package
to bothexoflex
(patchreact-native-collapsible
) &exoflex/new-example
(patchreact-navigation-drawer
).react-native-collapsible
: Adding the fix that has been merged to the package but not released yet. commitreact-navigation-drawer
: This package is deprecated now and have been included intoreact-navigation
instead. But I think it was introduced in version5.x.x
(docs) and we still use4.x.x
(docs). So for a quick fix, I follow this guide for the error: https://github.com/react-navigation/react-navigation/issues/9665#issuecomment-880711983Adjusted Component:
Accordion
: AdduseNativeRiver
props touseAnimation()
Badge
: AddtextStyle
typingButton
:ButtonOpacity
:RefObject<TouchableOpacity>
sinceButtonProp
types based onreact-native-paper
types and the ref wasRefObject<View>
(from Surface component).accessibilityTraits
&accessibilityComponentType
intoaccessibilityStates
. (Reference)Icon
props naming fromcolor
toiconColor
.ButtonRipple
:accessibilityTraits
&accessibilityComponentType
intoaccessibilityStates
.Icon
props naming fromcolor
toiconColor
.Calendar
: AdjustCalendarProps
to follow latest version of the package.Chip
: AdjustIcon
props naming fromcolor
toiconColor
.Collapsible
: AdduseNativeRiver
props touseAnimation()
DateTimePicker
: AdjustDateTimePicker.web
type fromDateObject
intoDateData
.Menu
: AdjustPaperMenu.Item
props naming fromicon
toleadingIcon
.SegmentedControl
: AddStyleProp<ViewStyle>
in bothIndicator
&SegmentedControl
.Switch
: AddStyleProp<ViewStyle>
types.Toast
: AdjustIcon
props naming fromcolor
toiconColor
.Contants, Helper & Types Changes:
Theme
: Add 2 new color key as part of the Theme:notification
&tooltip
.getPaperTheme
: Adjust import naming fromTheme
intoMD2Theme
and adjust the props needed.Colors
types: Add new keytooltip
as Colors type.react-native-color-slider
types: Changenumber[]
intoArray<number>
How to test:
packages/exoflex
and runyarn install
to install dependencies.packages/exoflex/example
and also runyarn install
. Once it's done, runyarn start
to test the component.Notes:
Based on testing, the only component that has problem is
ButtonRipple
. The button didn't work properly on iOS simulator, but animation run properly on Android (cc: @JonathanRadotski @Udayawibawamukti).