ui: cut Llama Chat's first-load JavaScript by 63%, load diagrams, math and PDFs on demand (#32555)
* ui: import Lucide icons by path in modules that run in Node Assisted-by: Claude (Opus 5.5 Medium) * ui: register highlight.js languages once, from lowlight's modules Assisted-by: Claude (Opus 5.5 Medium) * ui: load the pdf.js worker and nerdamer as files of their own Assisted-by: Claude (Opus 5.5 Medium) * ui: draw Mermaid diagrams with Pele Assisted-by: Claude (Opus 5.5 Medium) * ui: pin dependency versions and use one Svelte across the UI packages Assisted-by: Claude (Opus 5.5 Medium) * ui: build Llama Chat as split chunks Assisted-by: Claude (Opus 5.5 Medium) * ui: load KaTeX and pdf.js on first use Assisted-by: Claude (Opus 5.5 Medium)
This commit is contained in:
1 parent
39039aa27f
commit
80437488a4
35 files changed
+586
-1335
No files matched your search
@@ -41,7 +41,7 @@ function(mime_from_ext name out_var)
|
||||
set(m "text/html; charset=utf-8")
|
||||
elseif(ext_str STREQUAL "css")
|
||||
set(m "text/css")
|
||||
elseif(ext_str STREQUAL "js")
|
||||
elseif(ext_str STREQUAL "js" OR ext_str STREQUAL "mjs")
|
||||
set(m "application/javascript")
|
||||
elseif(ext_str STREQUAL "json")
|
||||
set(m "application/json")
|
||||
@@ -98,9 +98,12 @@ function(ui_validate_assets files in_dir)
|
||||
set(found_build_json TRUE)
|
||||
elseif(base STREQUAL "version.json")
|
||||
set(found_version_json TRUE)
|
||||
elseif(base MATCHES "^bundle.*\\.js$")
|
||||
# the app's entry: bundle[hash].js/.css from a single-bundle build (builds before the
|
||||
# split one, prebuilt archives included), or entry/start[hash].js and the CSS in
|
||||
# _app/immutable/assets from a split build
|
||||
elseif(base MATCHES "^bundle.*\\.js$" OR f MATCHES "(^|/)_app/immutable/entry/start\\.[^/]*\\.js$")
|
||||
set(found_bundle_js TRUE)
|
||||
elseif(base MATCHES "^bundle.*\\.css$")
|
||||
elseif(base MATCHES "^bundle.*\\.css$" OR f MATCHES "(^|/)_app/immutable/assets/[^/]*\\.css$")
|
||||
set(found_bundle_css TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -125,10 +128,10 @@ function(ui_validate_assets files in_dir)
|
||||
list(APPEND missing "version.json")
|
||||
endif()
|
||||
if(NOT found_bundle_js)
|
||||
list(APPEND missing "bundle[hash].js")
|
||||
list(APPEND missing "_app/immutable/entry/start[hash].js (or bundle[hash].js)")
|
||||
endif()
|
||||
if(NOT found_bundle_css)
|
||||
list(APPEND missing "bundle[hash].css")
|
||||
list(APPEND missing "_app/immutable/assets/[name][hash].css (or bundle[hash].css)")
|
||||
endif()
|
||||
|
||||
if(missing)
|
||||
|
||||
Reference in new issue
Block a user