1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00

refactor: remove craco and wdyr (#753)

This commit is contained in:
olav 2022-03-01 10:56:38 +01:00 committed by GitHub
parent 58667565f2
commit c7dedecf70
6 changed files with 4 additions and 248 deletions

View File

@ -1,21 +1,4 @@
# Developing
## Why did you render
This application is set up with [WDYR](https://github.com/welldone-software/why-did-you-render) and [craco](https://github.com/gsoft-inc/craco) in order to find, debug and remove uneccesary re-renders. This configuration can be found in /src/wdyr.ts.
In order to turn it on, change the configuration accordingly:
```
if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React, {
trackAllPureComponents: true,
});
}
```
Now you should be able to review rendering information in the console. If you do utilise this functionality, please remember to set the configuration back to spare other developers the noise in the console.
# unleash-frontend
## Run with a local instance of the unleash-api:

View File

@ -1,37 +0,0 @@
const presetReact = require('@babel/preset-react').default;
const presetCRA = require('babel-preset-react-app');
module.exports = {
babel: {
loaderOptions: (babelLoaderOptions, { env, paths }) => {
const origBabelPresetReactAppIndex = babelLoaderOptions.presets.findIndex(
preset => {
return preset[0].includes('babel-preset-react-app');
}
);
if (origBabelPresetReactAppIndex === -1) {
return babelLoaderOptions;
}
const overridenBabelPresetReactApp = (...args) => {
const babelPresetReactAppResult = presetCRA(...args);
const origPresetReact = babelPresetReactAppResult.presets.find(
preset => {
return preset[0] === presetReact;
}
);
Object.assign(origPresetReact[1], {
importSource: '@welldone-software/why-did-you-render',
});
return babelPresetReactAppResult;
};
babelLoaderOptions.presets[
origBabelPresetReactAppIndex
] = overridenBabelPresetReactApp;
return babelLoaderOptions;
},
},
};

View File

@ -56,12 +56,10 @@
"@types/react-router-dom": "5.3.3",
"@types/react-test-renderer": "17.0.1",
"@types/react-timeago": "4.1.3",
"@welldone-software/why-did-you-render": "6.2.3",
"chart.js": "3.7.1",
"chartjs-adapter-date-fns": "2.0.0",
"classnames": "2.3.1",
"copy-to-clipboard": "3.3.1",
"craco": "0.0.3",
"css-loader": "6.6.0",
"cypress": "9.5.1",
"date-fns": "2.28.0",

View File

@ -1,6 +1,4 @@
import './wdyr';
import 'whatwg-fetch';
import './app.css';
import ReactDOM from 'react-dom';
@ -9,7 +7,6 @@ import { ThemeProvider, CssBaseline } from '@material-ui/core';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { StylesProvider } from '@material-ui/core/styles';
import mainTheme from './themes/main-theme';
import { App } from './component/App';
import ScrollToTop from './component/scroll-to-top';

View File

@ -1,10 +0,0 @@
/// <reference types="@welldone-software/why-did-you-render" />
import React from 'react';
if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React, {
trackAllPureComponents: false,
});
}

View File

@ -28,11 +28,6 @@
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz"
integrity sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==
"@babel/compat-data@^7.13.15":
version "7.14.0"
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz"
integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==
"@babel/core@7.12.3":
version "7.12.3"
resolved "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz"
@ -76,27 +71,6 @@
semver "^6.3.0"
source-map "^0.5.0"
"@babel/core@^7.6.0":
version "7.14.0"
resolved "https://registry.npmjs.org/@babel/core/-/core-7.14.0.tgz"
integrity sha512-8YqpRig5NmIHlMLw09zMlPTvUVMILjqCOtVgu+TVNWEBvy9b5I3RRyhqnrV4hjgEK7n8P9OqvkWJAFmEL6Wwfw==
dependencies:
"@babel/code-frame" "^7.12.13"
"@babel/generator" "^7.14.0"
"@babel/helper-compilation-targets" "^7.13.16"
"@babel/helper-module-transforms" "^7.14.0"
"@babel/helpers" "^7.14.0"
"@babel/parser" "^7.14.0"
"@babel/template" "^7.12.13"
"@babel/traverse" "^7.14.0"
"@babel/types" "^7.14.0"
convert-source-map "^1.7.0"
debug "^4.1.0"
gensync "^1.0.0-beta.2"
json5 "^2.1.2"
semver "^6.3.0"
source-map "^0.5.0"
"@babel/generator@^7.12.1", "@babel/generator@^7.13.9":
version "7.13.9"
resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.13.9.tgz"
@ -106,15 +80,6 @@
jsesc "^2.5.1"
source-map "^0.5.0"
"@babel/generator@^7.14.0":
version "7.14.1"
resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz"
integrity sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==
dependencies:
"@babel/types" "^7.14.1"
jsesc "^2.5.1"
source-map "^0.5.0"
"@babel/helper-annotate-as-pure@^7.10.4", "@babel/helper-annotate-as-pure@^7.12.13":
version "7.12.13"
resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz"
@ -140,16 +105,6 @@
browserslist "^4.14.5"
semver "^6.3.0"
"@babel/helper-compilation-targets@^7.13.16":
version "7.13.16"
resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz"
integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==
dependencies:
"@babel/compat-data" "^7.13.15"
"@babel/helper-validator-option" "^7.12.17"
browserslist "^4.14.5"
semver "^6.3.0"
"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.13.0":
version "7.13.11"
resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.11.tgz"
@ -242,20 +197,6 @@
"@babel/traverse" "^7.13.13"
"@babel/types" "^7.13.14"
"@babel/helper-module-transforms@^7.14.0":
version "7.14.0"
resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz"
integrity sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==
dependencies:
"@babel/helper-module-imports" "^7.13.12"
"@babel/helper-replace-supers" "^7.13.12"
"@babel/helper-simple-access" "^7.13.12"
"@babel/helper-split-export-declaration" "^7.12.13"
"@babel/helper-validator-identifier" "^7.14.0"
"@babel/template" "^7.12.13"
"@babel/traverse" "^7.14.0"
"@babel/types" "^7.14.0"
"@babel/helper-optimise-call-expression@^7.12.13":
version "7.12.13"
resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz"
@ -313,11 +254,6 @@
resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz"
integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==
"@babel/helper-validator-identifier@^7.14.0":
version "7.14.0"
resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz"
integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==
"@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.12.17":
version "7.12.17"
resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz"
@ -342,15 +278,6 @@
"@babel/traverse" "^7.13.0"
"@babel/types" "^7.13.0"
"@babel/helpers@^7.14.0":
version "7.14.0"
resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz"
integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==
dependencies:
"@babel/template" "^7.12.13"
"@babel/traverse" "^7.14.0"
"@babel/types" "^7.14.0"
"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13":
version "7.13.10"
resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz"
@ -365,11 +292,6 @@
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz"
integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==
"@babel/parser@^7.14.0":
version "7.14.1"
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz"
integrity sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12":
version "7.13.12"
resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz"
@ -1235,20 +1157,6 @@
debug "^4.1.0"
globals "^11.1.0"
"@babel/traverse@^7.14.0":
version "7.14.0"
resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz"
integrity sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==
dependencies:
"@babel/code-frame" "^7.12.13"
"@babel/generator" "^7.14.0"
"@babel/helper-function-name" "^7.12.13"
"@babel/helper-split-export-declaration" "^7.12.13"
"@babel/parser" "^7.14.0"
"@babel/types" "^7.14.0"
debug "^4.1.0"
globals "^11.1.0"
"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.12.6", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.13", "@babel/types@^7.13.14", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0":
version "7.13.14"
resolved "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz"
@ -1258,14 +1166,6 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"
"@babel/types@^7.14.0", "@babel/types@^7.14.1":
version "7.14.1"
resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz"
integrity sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==
dependencies:
"@babel/helper-validator-identifier" "^7.14.0"
to-fast-properties "^2.0.0"
"@bcoe/v8-coverage@^0.2.3":
version "0.2.3"
resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
@ -1279,15 +1179,6 @@
exec-sh "^0.3.2"
minimist "^1.2.0"
"@craco/craco@^5.5.0":
version "5.9.0"
resolved "https://registry.npmjs.org/@craco/craco/-/craco-5.9.0.tgz"
integrity sha512-2Q8gIB4W0/nPiUxr9iAKUhGsFlXYN0/wngUdK1VWtfV2NtBv+yllNn2AjieaLbttgpQinuOYmDU65vocC0NMDg==
dependencies:
cross-spawn "^7.0.0"
lodash "^4.17.15"
webpack-merge "^4.2.2"
"@csstools/convert-colors@^1.4.0":
version "1.4.0"
resolved "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz"
@ -1940,7 +1831,7 @@
resolved "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.1.tgz"
integrity sha512-S6oPal772qJZHoRZLFc/XoZW2gFvwXusYUmXPXkgxJLuEk2vOt7jc4Yo6z/vtI0EBkbPBVrJJ0B+prLIKiWqHg==
"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.3", "@types/babel__core@^7.1.7":
"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7":
version "7.1.14"
resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz"
integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g==
@ -2263,18 +2154,6 @@
"@types/source-list-map" "*"
source-map "^0.7.3"
"@types/webpack@^4.39.2":
version "4.41.28"
resolved "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.28.tgz"
integrity sha512-Nn84RAiJjKRfPFFCVR8LC4ueTtTdfWAMZ03THIzZWRJB+rX24BD3LqPSFnbMscWauEsT4segAsylPDIaZyZyLQ==
dependencies:
"@types/anymatch" "*"
"@types/node" "*"
"@types/tapable" "^1"
"@types/uglify-js" "*"
"@types/webpack-sources" "*"
source-map "^0.6.0"
"@types/webpack@^4.41.8":
version "4.41.27"
resolved "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.27.tgz"
@ -2565,13 +2444,6 @@
"@webassemblyjs/wast-parser" "1.9.0"
"@xtuc/long" "4.2.2"
"@welldone-software/why-did-you-render@6.2.3":
version "6.2.3"
resolved "https://registry.yarnpkg.com/@welldone-software/why-did-you-render/-/why-did-you-render-6.2.3.tgz#cdd5e27cf25b7e767c1c0b0e8808f67d3f6be833"
integrity sha512-FQgi90jvC9uw2aALlonJfqaWOvU5UUBBVvdAnS2iryXwCc4YJkKsPJY5Y/LzaND3OIyk8XGUn1vTRn6hcem28Q==
dependencies:
lodash "^4"
"@xtuc/ieee754@^1.2.0":
version "1.2.0"
resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz"
@ -4166,17 +4038,6 @@ cosmiconfig@^7.0.0:
path-type "^4.0.0"
yaml "^1.10.0"
craco@0.0.3:
version "0.0.3"
resolved "https://registry.npmjs.org/craco/-/craco-0.0.3.tgz"
integrity sha512-eeibbwJm1CTf/j3xvNgNmsRS7abegp4Cfm5qtn5nE9/0JjZRas+FHj8IlT8FMFWR0XOyZFGcWZgzaTU19DNGoQ==
dependencies:
"@babel/core" "^7.6.0"
"@craco/craco" "^5.5.0"
"@types/babel__core" "^7.1.3"
"@types/webpack" "^4.39.2"
webpack "^4.41.0"
create-ecdh@^4.0.0:
version "4.0.4"
resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz"
@ -5030,7 +4891,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"
enhanced-resolve@^4.3.0, enhanced-resolve@^4.5.0:
enhanced-resolve@^4.3.0:
version "4.5.0"
resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz"
integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==
@ -8025,7 +7886,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
"lodash@>=3.5 <5", lodash@^4, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.7.0:
"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.7.0:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@ -12536,13 +12397,6 @@ webpack-manifest-plugin@2.2.0:
object.entries "^1.1.0"
tapable "^1.0.0"
webpack-merge@^4.2.2:
version "4.2.2"
resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz"
integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==
dependencies:
lodash "^4.17.15"
webpack-sources@^1.1.0, webpack-sources@^1.3.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
version "1.4.3"
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz"
@ -12580,35 +12434,6 @@ webpack@4.44.2:
watchpack "^1.7.4"
webpack-sources "^1.4.1"
webpack@^4.41.0:
version "4.46.0"
resolved "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz"
integrity sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==
dependencies:
"@webassemblyjs/ast" "1.9.0"
"@webassemblyjs/helper-module-context" "1.9.0"
"@webassemblyjs/wasm-edit" "1.9.0"
"@webassemblyjs/wasm-parser" "1.9.0"
acorn "^6.4.1"
ajv "^6.10.2"
ajv-keywords "^3.4.1"
chrome-trace-event "^1.0.2"
enhanced-resolve "^4.5.0"
eslint-scope "^4.0.3"
json-parse-better-errors "^1.0.2"
loader-runner "^2.4.0"
loader-utils "^1.2.3"
memory-fs "^0.4.1"
micromatch "^3.1.10"
mkdirp "^0.5.3"
neo-async "^2.6.1"
node-libs-browser "^2.2.1"
schema-utils "^1.0.0"
tapable "^1.1.3"
terser-webpack-plugin "^1.4.3"
watchpack "^1.7.4"
webpack-sources "^1.4.1"
websocket-driver@>=0.5.1, websocket-driver@^0.7.4:
version "0.7.4"
resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz"