[clang-tools-extra] [clang-doc] add async loading (PR #93276)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 29 09:51:57 PDT 2024


================
@@ -80,8 +80,8 @@ function createIndex(Index) {
 
 // Runs after DOM loads
 document.addEventListener("DOMContentLoaded", function() {
-  // JsonIndex is a variable from another file that contains the index
-  // in JSON format
-  var Index = JSON.parse(JsonIndex);
-  createIndex(Index);
+  // LoadIndex is an asynchronous function that will be generated clang-doc
+  // it ensures that the function call will not blocked as soon the page loads
+  // since the index object are often huge and can contain thousands of lines
+  LoadIndex().then((Index) => { createIndex(Index); });
----------------
ilovepi wrote:

@PeterChou1, once this comment is fixed, I'm happy to land this.

https://github.com/llvm/llvm-project/pull/93276


More information about the cfe-commits mailing list