From: Daniel Karbach Date: Sun, 3 Sep 2023 11:09:36 +0000 (+0200) Subject: lazy load some stuff X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=237ebc69c5eb4fbfe226c4dcdc9711d7b18ddcd2;p=alttp.git lazy load some stuff --- diff --git a/.gitignore b/.gitignore index 8ef008d..39965bf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,15 +5,7 @@ /public/css/app.css.map /public/doortracker /public/hot -/public/js/app.js -/public/js/app.js.LICENSE.txt -/public/js/app.js.map -/public/js/manifest.js -/public/js/manifest.js.LICENSE.txt -/public/js/manifest.js.map -/public/js/vendor.js -/public/js/vendor.js.LICENSE.txt -/public/js/vendor.js.map +/public/js /public/media /public/mix-manifest.json /public/storage diff --git a/package-lock.json b/package-lock.json index b92c8c2..7f1726c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "yup": "^0.32.11" }, "devDependencies": { + "@babel/eslint-parser": "^7.22.11", "@babel/preset-react": "^7.13.13", "@popperjs/core": "^2.10.2", "@tailwindcss/forms": "^0.4.0", @@ -121,6 +122,33 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/eslint-parser": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.11.tgz", + "integrity": "sha512-YjOYZ3j7TjV8OhLW6NCtyg8G04uStATEUe5eiLuCZaXz2VSDQ3dsAtm2D+TuQyAqNMUK2WacGo0/uma9Pein1w==", + "dev": true, + "dependencies": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || >=14.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0", + "eslint": "^7.5.0 || ^8.0.0" + } + }, + "node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@babel/generator": { "version": "7.17.3", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", @@ -2087,6 +2115,15 @@ "@lezer/common": "^1.0.0" } }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "dependencies": { + "eslint-scope": "5.1.1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -10481,9 +10518,9 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -12456,6 +12493,25 @@ "semver": "^6.3.0" } }, + "@babel/eslint-parser": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.11.tgz", + "integrity": "sha512-YjOYZ3j7TjV8OhLW6NCtyg8G04uStATEUe5eiLuCZaXz2VSDQ3dsAtm2D+TuQyAqNMUK2WacGo0/uma9Pein1w==", + "dev": true, + "requires": { + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", + "eslint-visitor-keys": "^2.1.0", + "semver": "^6.3.1" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, "@babel/generator": { "version": "7.17.3", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", @@ -13869,6 +13925,15 @@ "@lezer/common": "^1.0.0" } }, + "@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "requires": { + "eslint-scope": "5.1.1" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -20329,9 +20394,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, "send": { diff --git a/package.json b/package.json index d035282..1618bb2 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,16 @@ "plugin:import/recommended", "plugin:react/recommended" ], + "parser": "@babel/eslint-parser", "parserOptions": { + "babelOptions": { + "presets": ["@babel/preset-react"] + }, + "ecmaFeatures": { + "jsx": true + }, "ecmaVersion": 2018, + "requireConfigFile": false, "sourceType": "module" }, "rules": { @@ -49,6 +57,7 @@ } }, "devDependencies": { + "@babel/eslint-parser": "^7.22.11", "@babel/preset-react": "^7.13.13", "@popperjs/core": "^2.10.2", "@tailwindcss/forms": "^0.4.0", diff --git a/resources/js/components/common/PngDialog.js b/resources/js/components/common/PngDialog.js index dbd030f..1984848 100644 --- a/resources/js/components/common/PngDialog.js +++ b/resources/js/components/common/PngDialog.js @@ -2,7 +2,9 @@ import PropTypes from 'prop-types'; import React from 'react'; import { Modal } from 'react-bootstrap'; -import PngPlayer from './PngPlayer'; +import Loading from './Loading'; + +const PngPlayer = React.lazy(() => import('./PngPlayer')); const PngDialog = ({ onHide, show, src, title }) => {title ? @@ -13,7 +15,9 @@ const PngDialog = ({ onHide, show, src, title }) => : null} - + }> + + ; diff --git a/resources/js/components/techniques/Dialog.js b/resources/js/components/techniques/Dialog.js index b3181e2..eefa9d7 100644 --- a/resources/js/components/techniques/Dialog.js +++ b/resources/js/components/techniques/Dialog.js @@ -3,9 +3,11 @@ import React from 'react'; import { Modal } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; -import Form from './Form'; +import Loading from '../common/Loading'; import LanguageSwitcher from '../../app/LanguageSwitcher'; +const Form = React.lazy(() => import('./Form')); + const Dialog = ({ content, language, @@ -24,12 +26,14 @@ const Dialog = ({ -
+ }> + + ; }; diff --git a/resources/js/components/tournament/ScoreChartDialog.js b/resources/js/components/tournament/ScoreChartDialog.js index 958fced..2a04d1d 100644 --- a/resources/js/components/tournament/ScoreChartDialog.js +++ b/resources/js/components/tournament/ScoreChartDialog.js @@ -3,9 +3,11 @@ import React from 'react'; import { Button, Modal } from 'react-bootstrap'; import { withTranslation } from 'react-i18next'; -import ScoreChart from './ScoreChart'; +import Loading from '../common/Loading'; import i18n from '../../i18n'; +const ScoreChart = React.lazy(() => import('./ScoreChart')); + const ScoreChartDialog = ({ onHide, show, @@ -18,7 +20,9 @@ const ScoreChartDialog = ({ - + }> + +