From 777e20fd1993c6191e6bbe00485630f8cb6d660d Mon Sep 17 00:00:00 2001 From: Benjamin Gerber Date: Tue, 17 Sep 2024 13:47:41 +0200 Subject: [PATCH] Remove more dependencies Remove core-js: It looks to be a bunch of pollyfill. I would like to remove it, and then ev. patch the issues with dedicated well-know pollyfill regenerator-runtime: Was imported in src/controllers/bootstrap.js, but probably not used anymore. Cheerio Is probably not worth to fix it as subdependencies resize-observer-polyfill Should not be necessary anymore in 2024 --- package-lock.json | 21 +-------------------- package.json | 8 +++----- src/controllers/bootstrap.js | 2 -- src/map/swipe.js | 2 -- tsconfig.json | 3 +-- 5 files changed, 5 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d07e3ebb783..657a78224fc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "angular-ui-date": "1.1.1", "angular-ui-slider": "0.4.0", "bootstrap": "4.6.2", - "core-js": "3.38.1", "corejs-typeahead": "1.3.4", "d3": "7.9.0", "file-saver": "2.0.5", @@ -47,8 +46,6 @@ "ol-mapbox-style": "12.3.5", "proj4": "2.12.0", "qruri": "0.0.4", - "regenerator-runtime": "0.14.1", - "resize-observer-polyfill": "1.5.1", "rxjs": "7.8.1", "tinycolor2": "1.6.0" }, @@ -89,7 +86,7 @@ "@types/jquery": "3.5.30", "@types/jquery.ui.datetimepicker": "0.3.35", "@types/jqueryui": "1.12.23", - "@types/jsts": "^0.17.24", + "@types/jsts": "0.17.24", "@types/node": "20.16.3", "@types/offscreencanvas": "2019.7.3", "@types/proj4": "2.5.5", @@ -166,7 +163,6 @@ "ol-cesium": "2.14.0" }, "peerDependencies": { - "cheerio": "1.0.0", "color-rgba": "3.0.0", "color-space": "2.0.1" } @@ -9717,16 +9713,6 @@ "node": ">=10.13.0" } }, - "node_modules/core-js": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.38.1.tgz", - "integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/core-js-compat": { "version": "3.38.1", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", @@ -18853,11 +18839,6 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "node_modules/resize-observer-polyfill": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", - "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" - }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", diff --git a/package.json b/package.json index 4c56662817b3..15359307f732 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,6 @@ "angular-ui-date": "1.1.1", "angular-ui-slider": "0.4.0", "bootstrap": "4.6.2", - "core-js": "3.38.1", "corejs-typeahead": "1.3.4", "d3": "7.9.0", "file-saver": "2.0.5", @@ -98,16 +97,15 @@ "ol-mapbox-style": "12.3.5", "proj4": "2.12.0", "qruri": "0.0.4", - "regenerator-runtime": "0.14.1", - "resize-observer-polyfill": "1.5.1", "rxjs": "7.8.1", "tinycolor2": "1.6.0" }, + "_peerDependenciesComment_": "Dep. to fix sub-dependencies. Not used directly", "peerDependencies": { - "cheerio": "1.0.0", "color-rgba": "3.0.0", "color-space": "2.0.1" }, + "_optionalDependenciesComment_": "Dep. for plugins", "optionalDependencies": { "jsts": "2.11.3", "localforage": "1.10.0", @@ -146,7 +144,7 @@ "@types/jquery": "3.5.30", "@types/jquery.ui.datetimepicker": "0.3.35", "@types/jqueryui": "1.12.23", - "@types/jsts": "^0.17.24", + "@types/jsts": "0.17.24", "@types/node": "20.16.3", "@types/offscreencanvas": "2019.7.3", "@types/proj4": "2.5.5", diff --git a/src/controllers/bootstrap.js b/src/controllers/bootstrap.js index fcae74d49ff6..d7585a2f5c96 100644 --- a/src/controllers/bootstrap.js +++ b/src/controllers/bootstrap.js @@ -21,8 +21,6 @@ import $ from 'jquery'; import angular from 'angular'; -import 'core-js/stable'; -import 'regenerator-runtime/runtime'; import {setupI18n} from 'ngeo/localize/i18n'; import config from 'gmfapi/store/config'; import 'ngeo/auth/index'; diff --git a/src/map/swipe.js b/src/map/swipe.js index 9c1544827553..0fa10a1af0a1 100644 --- a/src/map/swipe.js +++ b/src/map/swipe.js @@ -22,8 +22,6 @@ import angular from 'angular'; import {listen, unlistenByKey} from 'ol/events'; import RenderEvent from 'ol/render/Event'; -import {getRenderPixel} from 'ol/render.js'; -import ResizeObserver from 'resize-observer-polyfill'; import 'jquery-ui/ui/widgets/draggable'; import htmlTemplate from './swipe.html'; /** diff --git a/tsconfig.json b/tsconfig.json index a14a43ec044c..8c5c9dd00c72 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,8 +29,7 @@ "mapillary-js/*": ["node_modules/mapillary-js/dist/mapillary.d.ts"], "moment": ["node_modules/moment/moment.d.ts"], "jsts/*": ["node_modules/@types/jsts/index.d.ts"], - "localforage/*": ["node_modules/localforage/*"], - "resize-observer-polyfill": ["node_modules/resize-observer-polyfill/src/index.d.ts"] + "localforage/*": ["node_modules/localforage/*"] } }, "include": ["src/**/*.js", "src/**/*.ts", "srcapi/**/*.ts", "lib/**/*.js", "api/src/**/*.js"],