High-Performance UI Component Library for Enterprise Applications Forums Editor & Inputs Can Smart Editor work offline in a PWA using JavaScript?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113657
    linda05
    Participant

    Hi everyone, I am working on a scheduling screen for support teams with Editor. I am currently trying to solve this: Can Smart Editor work offline in a PWA using JavaScript? So far, I tried a couple of approaches from forum threads, but the UI behaves inconsistently after data updates. What approach would you recommend here?

    #113665
    admin
    Keymaster

    Hi,

    Smart Editor can work offline in a JavaScript PWA, but the recommended approach is to make the PWA responsible for offline support, not the editor itself. The Smart UI team recommends bundling all editor assets locally and using a Service Worker with a cache-first strategy so the editor loads without a network connection.

    Example setup:

    Register the Service Worker:
    
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('/sw.js');
    }
    
    A simple cache-first strategy:
    
    const CACHE = 'support-dashboard-v1';
    
    self.addEventListener('fetch', event => {
      event.respondWith(
        caches.match(event.request).then(cached => {
          return cached || fetch(event.request);
        })
      );
    });

    Regards,
    Markov

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.