Remove web-vitals (#429)

This commit is contained in:
Franck R 2022-01-24 18:19:11 +11:00 committed by GitHub
parent a037b79294
commit 41b7ef17e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 3417 deletions

View File

@ -15,8 +15,7 @@
"protons": "^2.0.3", "protons": "^2.0.3",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-scripts": "5.0.0", "react-scripts": "5.0.0"
"web-vitals": "^2.1.3"
}, },
"devDependencies": { "devDependencies": {
"cra-webpack-rewired": "^1.0.1" "cra-webpack-rewired": "^1.0.1"
@ -15696,11 +15695,6 @@
"minimalistic-assert": "^1.0.0" "minimalistic-assert": "^1.0.0"
} }
}, },
"node_modules/web-vitals": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.3.tgz",
"integrity": "sha512-+ijpniAzcnQicXaXIN0/eHQAiV/jMt1oHGHTmz7VdAJPPkzzDhmoYPSpLgJTuFtUh+jCjxCoeTZPg7Ic+g8o7w=="
},
"node_modules/webidl-conversions": { "node_modules/webidl-conversions": {
"version": "6.1.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
@ -27875,11 +27869,6 @@
"minimalistic-assert": "^1.0.0" "minimalistic-assert": "^1.0.0"
} }
}, },
"web-vitals": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.3.tgz",
"integrity": "sha512-+ijpniAzcnQicXaXIN0/eHQAiV/jMt1oHGHTmz7VdAJPPkzzDhmoYPSpLgJTuFtUh+jCjxCoeTZPg7Ic+g8o7w=="
},
"webidl-conversions": { "webidl-conversions": {
"version": "6.1.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",

View File

@ -10,8 +10,7 @@
"protons": "^2.0.3", "protons": "^2.0.3",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-scripts": "5.0.0", "react-scripts": "5.0.0"
"web-vitals": "^2.1.3"
}, },
"scripts": { "scripts": {
"start": "cra-webpack-rewired start", "start": "cra-webpack-rewired start",

View File

@ -25,7 +25,7 @@ function App() {
setWakuStatus('Starting'); setWakuStatus('Starting');
Waku.create({ bootstrap: true }).then((waku) => { Waku.create({ bootstrap: { default: true } }).then((waku) => {
setWaku(waku); setWaku(waku);
setWakuStatus('Connecting'); setWakuStatus('Connecting');
waku.waitForConnectedPeer().then(() => { waku.waitForConnectedPeer().then(() => {
@ -103,7 +103,7 @@ function sendMessage(message, waku, timestamp) {
// Encode to protobuf // Encode to protobuf
const payload = proto.SimpleChatMessage.encode({ const payload = proto.SimpleChatMessage.encode({
timestamp: time, timestamp: time,
text: message text: message,
}); });
// Wrap in a Waku Message // Wrap in a Waku Message

View File

@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import './index.css'; import './index.css';
import App from './App'; import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>
@ -10,8 +9,3 @@ ReactDOM.render(
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById('root')
); );
// 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();

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
"assert": "^2.0.0", "assert": "^2.0.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"crypto-browserify": "^3.12.0", "crypto-browserify": "^3.12.0",
"js-waku": "^0.14.2", "js-waku": "../../build/esm",
"protons": "^2.0.3", "protons": "^2.0.3",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",

View File

@ -22,7 +22,7 @@ function App() {
setWakuStatus('Starting'); setWakuStatus('Starting');
Waku.create({ bootstrap: true }).then((waku) => { Waku.create({ bootstrap: { default: true } }).then((waku) => {
setWaku(waku); setWaku(waku);
setWakuStatus('Connecting'); setWakuStatus('Connecting');
}); });

View File

@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import './index.css'; import './index.css';
import App from './App'; import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>
@ -10,8 +9,3 @@ ReactDOM.render(
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById('root')
); );
// 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();

View File

@ -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;