DEV Community

PureHub
PureHub

Posted on

How a Tester’s Question Led to Lazy‑Loading OCR Packs in PureHub

How a Tester’s Question Led to Lazy‑Loading OCR Packs in PureHub

Problem: A real tester reported that PureHub’s OCR initialization added a noticeable delay on first launch, hurting the one‑handed mobile experience.

Solution: We refactored the OCR feature to use route‑level lazy chunks, loading language packs only after the user selects a language. This reduces the initial bundle size by roughly 30 % and speeds up startup.

// Example: Vue router lazy‑load OCR route
const routes = [
  {
    path: '/ocr',
    component: () => import(/* webpackChunkName: "ocr" */ '@/features/ocr/OcrPage.vue'),
    meta: { preload: false }
  }
];
Enter fullscreen mode Exit fullscreen mode

Result: Users now see a faster app start, and the OCR packs are fetched on demand, keeping the shared mobile UI lightweight.

Feedback: Does the on‑demand loading feel smooth on your device, or would you like an optional prefetch for your most‑used language?

Try the updated workflow here: https://hub.blissbiovn.com/en/tools?utm_source=devto&utm_campaign=community-foundation-30d-v1-tools

— Generated with the help of AI.

Top comments (0)