diff --git a/app/soapbox/extra-polyfills.ts b/app/soapbox/extra-polyfills.ts index 47a1b6e33..c4f6da408 100644 --- a/app/soapbox/extra-polyfills.ts +++ b/app/soapbox/extra-polyfills.ts @@ -2,6 +2,3 @@ import 'intersection-observer'; import 'requestidlecallback'; -import objectFitImages from 'object-fit-images'; - -objectFitImages(); diff --git a/app/soapbox/load-polyfills.ts b/app/soapbox/load-polyfills.ts index cfd6f741f..70de8aa33 100644 --- a/app/soapbox/load-polyfills.ts +++ b/app/soapbox/load-polyfills.ts @@ -28,15 +28,13 @@ function loadPolyfills() { window.Symbol ); - // Latest version of Firefox and Safari do not have IntersectionObserver. - // Edge does not have requestIdleCallback and object-fit CSS property. + // Older versions of Firefox and Safari do not have IntersectionObserver. // This avoids shipping them all the polyfills. const needsExtraPolyfills = !( window.IntersectionObserver && window.IntersectionObserverEntry && 'isIntersecting' in IntersectionObserverEntry.prototype && - window.requestIdleCallback && - 'object-fit' in (new Image()).style + window.requestIdleCallback ); return Promise.all([ diff --git a/package.json b/package.json index 073c30773..4833d80d0 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,6 @@ "@types/leaflet": "^1.8.0", "@types/lodash": "^4.14.180", "@types/object-assign": "^4.0.30", - "@types/object-fit-images": "^3.2.3", "@types/qrcode.react": "^1.0.2", "@types/react-color": "^3.0.6", "@types/react-datepicker": "^4.4.2", @@ -150,7 +149,6 @@ "marky": "^1.2.4", "mini-css-extract-plugin": "^2.6.0", "object-assign": "^4.1.1", - "object-fit-images": "^3.2.3", "object.values": "^1.1.0", "path-browserify": "^1.0.1", "postcss": "^8.4.14", diff --git a/yarn.lock b/yarn.lock index fd31f55c1..96d15d4e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2732,11 +2732,6 @@ resolved "https://registry.yarnpkg.com/@types/object-assign/-/object-assign-4.0.30.tgz#8949371d5a99f4381ee0f1df0a9b7a187e07e652" integrity sha1-iUk3HVqZ9Dge4PHfCpt6GH4H5lI= -"@types/object-fit-images@^3.2.3": - version "3.2.3" - resolved "https://registry.yarnpkg.com/@types/object-fit-images/-/object-fit-images-3.2.3.tgz#aa17a1cb4ac113ba81ce62f901177c9ccd5194f5" - integrity sha512-kpBPy4HIzbM1o3v+DJrK4V5NgUpcUg/ayzjixOVHQNukpdEUYDIaeDrnYJUSemQXWX5mKeEnxDRU1nACAWYnvg== - "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -8708,11 +8703,6 @@ object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-fit-images@^3.2.3: - version "3.2.4" - resolved "https://registry.yarnpkg.com/object-fit-images/-/object-fit-images-3.2.4.tgz#6c299d38fdf207746e5d2d46c2877f6f25d15b52" - integrity sha512-G+7LzpYfTfqUyrZlfrou/PLLLAPNC52FTy5y1CBywX+1/FkxIloOyQXBmZ3Zxa2AWO+lMF0JTuvqbr7G5e5CWg== - object-hash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9"