Skip to content

Commit 4862e14

Browse files
author
Ivan Franchin
committed
upgrade order-ui to react 18
1 parent 0376433 commit 4862e14

File tree

7 files changed

+2275
-2189
lines changed

7 files changed

+2275
-2189
lines changed

order-ui/package-lock.json

Lines changed: 2233 additions & 2030 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

order-ui/package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
"private": true,
55
"dependencies": {
66
"@testing-library/jest-dom": "^5.16.4",
7-
"@testing-library/react": "^12.1.4",
8-
"@testing-library/user-event": "^14.1.1",
9-
"axios": "^0.27.1",
10-
"react": "^17.0.2",
11-
"react-dom": "^17.0.2",
12-
"react-router-dom": "^5.3.0",
7+
"@testing-library/react": "^13.3.0",
8+
"@testing-library/user-event": "^14.2.0",
9+
"react": "^18.1.0",
10+
"react-dom": "^18.1.0",
1311
"react-scripts": "5.0.1",
14-
"semantic-ui-react": "^2.1.2"
12+
"web-vitals": "^2.1.4",
13+
"axios": "^0.27.2",
14+
"react-router-dom": "^5.3.0",
15+
"semantic-ui-react": "^2.1.3"
1516
},
1617
"scripts": {
1718
"start": "react-scripts start",
@@ -20,7 +21,10 @@
2021
"eject": "react-scripts eject"
2122
},
2223
"eslintConfig": {
23-
"extends": "react-app"
24+
"extends": [
25+
"react-app",
26+
"react-app/jest"
27+
]
2428
},
2529
"browserslist": {
2630
"production": [

order-ui/public/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

order-ui/src/index.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import React from 'react'
2-
import ReactDOM from 'react-dom'
2+
import ReactDOM from 'react-dom/client'
33
import './index.css'
44
import App from './App'
5-
import * as serviceWorker from './serviceWorker'
5+
import reportWebVitals from './reportWebVitals'
66

7-
ReactDOM.render(
7+
const root = ReactDOM.createRoot(document.getElementById('root'))
8+
root.render(
89
// <React.StrictMode>
9-
<App />
10+
<App />
1011
// </React.StrictMode>
11-
,
12-
document.getElementById('root')
1312
)
1413

15-
// If you want your app to work offline and load faster, you can change
16-
// unregister() to register() below. Note this comes with some pitfalls.
17-
// Learn more about service workers: https://bit.ly/CRA-PWA
18-
serviceWorker.unregister()
14+
// If you want to start measuring performance in your app, pass a function
15+
// to log results (for example: reportWebVitals(console.log))
16+
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17+
reportWebVitals()

order-ui/src/reportWebVitals.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const reportWebVitals = onPerfEntry => {
2+
if (onPerfEntry && onPerfEntry instanceof Function) {
3+
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4+
getCLS(onPerfEntry);
5+
getFID(onPerfEntry);
6+
getFCP(onPerfEntry);
7+
getLCP(onPerfEntry);
8+
getTTFB(onPerfEntry);
9+
});
10+
}
11+
};
12+
13+
export default reportWebVitals;

order-ui/src/serviceWorker.js

Lines changed: 0 additions & 141 deletions
This file was deleted.

order-ui/src/setupTests.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
2+
// allows you to do things like:
3+
// expect(element).toHaveTextContent(/react/i)
4+
// learn more: https://github.com/testing-library/jest-dom
5+
import '@testing-library/jest-dom';

0 commit comments

Comments
 (0)