Browse Source

feat: clean code and upgrade react version

feat_video_fine
kone-net 9 months ago
parent
commit
e4ec52d4b1
  1. 43333
      package-lock.json
  2. 16
      package.json
  3. 8
      src/App.test.js
  4. 18
      src/index.js
  5. 13
      src/reportWebVitals.js
  6. 5
      src/setupTests.js
  7. 12743
      yarn.lock

43333
package-lock.json generated

File diff suppressed because it is too large Load Diff

16
package.json

@ -3,22 +3,20 @@ @@ -3,22 +3,20 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4",
"antd": "^4.16.13",
"axios": "^0.24.0",
"js-audio-recorder": "^1.0.7",
"protobufjs": "^6.11.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"socket.io-client": "^4.3.2",
"react-infinite-scroll-component": "^6.1.0",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"redux-thunk": "^2.4.0",
"socket.io-client": "^4.3.2",
"web-vitals": "^1.0.1"
"react-router-dom": "^5.3.0"
},
"scripts": {
"start": "react-scripts start",

8
src/App.test.js

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

18
src/index.js

@ -1,15 +1,16 @@ @@ -1,15 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import './index.css';
import Login from './chat/Login';
import Panel from './chat/Panel';
import { Switch, Route, BrowserRouter } from 'react-router-dom';
import reportWebVitals from './reportWebVitals';
import { Provider } from 'react-redux';
import store from './chat/redux/module/index'
import store from './chat/redux/module/index';
ReactDOM.render(
<Provider store={store}>
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<Provider store={store}>
<BrowserRouter>
<Switch>
<Route path="/login" component={Login} />
@ -18,10 +19,5 @@ ReactDOM.render( @@ -18,10 +19,5 @@ ReactDOM.render(
</Switch>
</BrowserRouter>
</Provider>,
document.getElementById('root')
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

13
src/reportWebVitals.js

@ -1,13 +0,0 @@ @@ -1,13 +0,0 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

5
src/setupTests.js

@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

12743
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save