github xdan/jodit 4.11.14

7 hours ago

🚀 New Feature

  • Add stream() method to Ajax class for SSE (Server-Sent Events) streaming over XMLHttpRequest. Returns an AsyncGenerator<string> that yields parsed data: fields incrementally via onprogress.

    const ajax = new Jodit.modules.Ajax({
      method: 'POST',
      url: '/api/ai/stream',
      contentType: 'application/json',
      data: { prompt: 'Hello' }
    });
    
    try {
      for await (const data of ajax.stream()) {
        const event = JSON.parse(data);
        editor.s.insertHTML(event.text);
      }
    } finally {
      ajax.destruct();
    }

📝 Documentation

  • Rewrite src/core/request/README.md with full API reference, usage examples, SSE streaming guide, AbortController integration, and real-world patterns (FileBrowser, Uploader, plugins).

Don't miss a new jodit release

NewReleases is sending notifications on new releases.