-
Notifications
You must be signed in to change notification settings - Fork 184
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
[LOOM-1609]: React 18 migration #3585
Conversation
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
1 similar comment
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
aec50ff
to
264ded0
Compare
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
1 similar comment
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
ef03a70
to
0416b2b
Compare
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
@@ -149,10 +149,11 @@ const reactRecogniseProp = ["React does not recognize"] | |||
const invalidTags = ["The tag <rect>", "The tag <g>", "The tag <text>"] | |||
const passingTests = ["✓"] | |||
const unknownEventHandler = ["Unknown event handler"] | |||
const propType = ["Failed prop type"] | |||
const propType = ["Failed prop type", "Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", 'A props object containing a "key" prop is being spread into JSX:'] |
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.
The first new addition has been added because we will need to ignore this until we have full conversion of components to Typescript.
For the second it shall be addressed in this PR or a separate one as this is new
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
const componentWillReceiveProps = ["componentWillReceiveProps"] | ||
const invalidCSSProperties = ["is an invalid value for the .* css style property."] | ||
const invalidProps = ["for a non-boolean attribute", "Invalid ARIA attribute"] | ||
const actTests = ["inside a test was not wrapped in act(...)"] |
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.
This is a newly introduced warning, tests still pass and there is a few conversations open for this
https://github.com/reactwg/react-18/discussions/102
As its not a blocker adding it here now and we should revisit in the future
d645a16
to
30070cb
Compare
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
// TODO: Address tests being wrapped in act | ||
const actTests = ["inside a test was not wrapped in act(...)"] | ||
// TODO: Convert components that use CSSTransition to functional components and allow for using refs | ||
const findDOMNode = ["findDOMNode is deprecated and will be removed in the next major release."]; |
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.
This is coming from the underlying react-transition-group
library
|
||
expect(view.result.all[0]).toBe(true); | ||
|
||
expect(view.result.current).toBe(true); |
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.
The structure of renderHook
returns a different object where the value is located
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.
Need to check where or what this has come from 🤔
I think it might have been an error thrown that there was no tests for this
> | ||
<div> | ||
Element 0 | ||
</div> | ||
<div> | ||
Element 1 | ||
</div> | ||
<div> | ||
Element 2 | ||
</div> | ||
<div> | ||
Element 3 | ||
</div> | ||
<div> | ||
Element 4 | ||
</div> | ||
</div> |
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.
🤔
This is probably also why snapshot testing is risky as a form of testing
themeAttributes, | ||
...rest | ||
} = this.props; | ||
const BpkThemeProvider = (props) => { |
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.
We change this to be a functional component as the getChildContext
is deprecated and will be removed in a future version.
@@ -19,6 +19,8 @@ | |||
import 'jest-axe/extend-expect'; | |||
import '@testing-library/jest-dom'; | |||
import 'raf/polyfill'; | |||
import { TextEncoder } from 'util' |
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.
This mock is required as part of the upgrade as in a newer version of jsdom this is not exposed/available to the environment so causes tests to fail due to underlying global not being available
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3585 to see this build running in a browser. |
Remember to include the following changes:
[KOA-123][BpkButton] Updating the colour
README.md
(If you have created a new component)README.md