From 6cbeb4ddf95322233bb22d16197bbac9831e47b7 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 29 May 2025 21:46:45 -0400 Subject: [PATCH 1/4] Add support for offline lottie In air gapped, lotties won't load because the WASM player is fetched from CDN. This PR bundles the player so we can fetch it directly from file system --- frontend/src/main.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 779c21bd8..87b7682dd 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -2,6 +2,8 @@ import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; import { createRouter, RouterProvider } from "@tanstack/react-router"; import NProgress from "nprogress"; +import { setWasmUrl } from '@lottiefiles/dotlottie-react'; +import lottieWasmUrl from '@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm?url'; import { ContentLoader } from "./components/v2"; import { queryClient } from "./hooks/api/reactQuery"; @@ -22,6 +24,9 @@ import "./translation"; // have a look at the Quick start guide // for passing in lng and translations on init/ +// Configure Lottie player to use local WASM file +setWasmUrl(lottieWasmUrl); + // Create a new router instance NProgress.configure({ showSpinner: false }); From ff7ff06a6a7305f4c81199e5c3299aca6edfb8c5 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 29 May 2025 21:55:12 -0400 Subject: [PATCH 2/4] add dotlottie-web as direct import --- frontend/package-lock.json | 9 ++++++++- frontend/package.json | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 121dcd094..65f0db06a 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -25,6 +25,7 @@ "@hookform/resolvers": "^3.9.1", "@lexical/react": "^0.29.0", "@lottiefiles/dotlottie-react": "^0.12.0", + "@lottiefiles/dotlottie-web": "^0.44.0", "@octokit/rest": "^21.0.2", "@peculiar/x509": "^1.12.3", "@radix-ui/react-accordion": "^1.2.2", @@ -1838,12 +1839,18 @@ "react": "^17 || ^18 || ^19" } }, - "node_modules/@lottiefiles/dotlottie-web": { + "node_modules/@lottiefiles/dotlottie-react/node_modules/@lottiefiles/dotlottie-web": { "version": "0.38.2", "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.38.2.tgz", "integrity": "sha512-01d+UjJ8NG7ZStYQxtb8FPzknzGmauG7gEkcH+wHfSdiSQJY9PoBNVSTB9V6F5hAnmFqOxaocTtd7TIEEnzMnA==", "license": "MIT" }, + "node_modules/@lottiefiles/dotlottie-web": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.44.0.tgz", + "integrity": "sha512-IUWKVciDJI/BMWDWnh7j0Ngd0N8q9ySRAwm84aDqIE07qpmdZ7x1rkIpBaU1yHSNqNYHeh1Rxsl+LC3CY4f0KA==", + "license": "MIT" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index 7cd636343..0d7385370 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,6 +29,7 @@ "@hookform/resolvers": "^3.9.1", "@lexical/react": "^0.29.0", "@lottiefiles/dotlottie-react": "^0.12.0", + "@lottiefiles/dotlottie-web": "^0.44.0", "@octokit/rest": "^21.0.2", "@peculiar/x509": "^1.12.3", "@radix-ui/react-accordion": "^1.2.2", From 4261281b0ff7a02889254f5e5ef62e1208f27d1a Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 29 May 2025 21:55:44 -0400 Subject: [PATCH 3/4] address lint --- frontend/src/main.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 87b7682dd..f5958c028 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,9 +1,9 @@ import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; +import { setWasmUrl } from "@lottiefiles/dotlottie-react"; +import lottieWasmUrl from "@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm?url"; import { createRouter, RouterProvider } from "@tanstack/react-router"; import NProgress from "nprogress"; -import { setWasmUrl } from '@lottiefiles/dotlottie-react'; -import lottieWasmUrl from '@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm?url'; import { ContentLoader } from "./components/v2"; import { queryClient } from "./hooks/api/reactQuery"; From 709773153981496d034dad53a9c3a8cf9ef3b30c Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 29 May 2025 22:05:19 -0400 Subject: [PATCH 4/4] downgrade dolottie-web to match dotlottie-react --- frontend/package-lock.json | 10 ++-------- frontend/package.json | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 65f0db06a..d435cf0d7 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -25,7 +25,7 @@ "@hookform/resolvers": "^3.9.1", "@lexical/react": "^0.29.0", "@lottiefiles/dotlottie-react": "^0.12.0", - "@lottiefiles/dotlottie-web": "^0.44.0", + "@lottiefiles/dotlottie-web": "^0.38.2", "@octokit/rest": "^21.0.2", "@peculiar/x509": "^1.12.3", "@radix-ui/react-accordion": "^1.2.2", @@ -1839,18 +1839,12 @@ "react": "^17 || ^18 || ^19" } }, - "node_modules/@lottiefiles/dotlottie-react/node_modules/@lottiefiles/dotlottie-web": { + "node_modules/@lottiefiles/dotlottie-web": { "version": "0.38.2", "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.38.2.tgz", "integrity": "sha512-01d+UjJ8NG7ZStYQxtb8FPzknzGmauG7gEkcH+wHfSdiSQJY9PoBNVSTB9V6F5hAnmFqOxaocTtd7TIEEnzMnA==", "license": "MIT" }, - "node_modules/@lottiefiles/dotlottie-web": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.44.0.tgz", - "integrity": "sha512-IUWKVciDJI/BMWDWnh7j0Ngd0N8q9ySRAwm84aDqIE07qpmdZ7x1rkIpBaU1yHSNqNYHeh1Rxsl+LC3CY4f0KA==", - "license": "MIT" - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index 0d7385370..9a2cc2ba4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,7 +29,7 @@ "@hookform/resolvers": "^3.9.1", "@lexical/react": "^0.29.0", "@lottiefiles/dotlottie-react": "^0.12.0", - "@lottiefiles/dotlottie-web": "^0.44.0", + "@lottiefiles/dotlottie-web": "^0.38.2", "@octokit/rest": "^21.0.2", "@peculiar/x509": "^1.12.3", "@radix-ui/react-accordion": "^1.2.2",