Lazy loading (level 3) for a browser host: load later parts through the host
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Read docs/design/lazy-loading.md decision 2, then trace load(chunk) in viewport.js, HtmlService::write(path), and the wasm binding in wasm/src/wasm_html.cpp (to_html_config) and wasm/js/index.d.ts. The report describes the host bridge, per-document path writing, wasm config, and sandbox constraints; completion means browser hosts can load later parts on demand while file and HTTP loading still work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is missing
With HtmlConfig::lazy_loading, a page loads each later part of a view as a script beside it: text-chunks/<n>.js, sheet<n>-chunks/<m>.js, pdf-pages/<n>.js, and the search index (*-search/<n>.js). viewport.js adds a <script src> with a relative path (docs/design/lazy-loading.md decision 2). That works from file:// and over the HTTP server.
A browser host cannot use it. The website (opendocument.app, on @opendocument/odr-core through wasm) renders into a sandboxed srcdoc iframe:
sandbox="allow-scripts"withoutallow-same-origin, so the frame has no origin- CSP
script-src 'self' 'wasm-unsafe-eval' 'unsafe-inline',connect-src 'self' - no file server
A relative <script src> has nowhere to load from there. The wasm binding also does not read lazyLoading (wasm/src/wasm_html.cpp, to_html_config; wasm/js/index.d.ts). So in 7.6.x a browser host gets level 1 (lazyLayout) only.
What it would take
- A host hook in
viewport.js. When the page has a host to ask,load(chunk)asks the host for the part named bydata-odr-chunk-src(anddata-odr-chunk-textfor the index) instead of adding a<script src>. For example: post{type: "loadPart", path}through the host bridge, and accept the answer as the script text, or as the html of the part, passed toodr.chunks.fillandodr.chunks.text. The script tag stays the default, sofile://and HTTP do not change. - A wasm call that writes a path. C++ has
HtmlService::write(path)(andexists,mimetype), and it renders a part on demand. The wasm binding does not expose it. Something likedoc.write(path)returning the text, kept per open document, so the host can answer the hook. lazyLoadingin the wasm config, with the hook as its precondition. The README andindex.d.tsshould say so.- The sandbox: the answer must reach the frame without
allow-same-origin.postMessageinto the frame andeval-free insertion fit the site's CSP, becauseodr.chunks.filltakes html, not code.
Why
The site caps a sheet at 50,000 cells, because the whole markup goes into srcdoc as one string. Level 3 would let it show far larger files: the page holds only the first part, and the rest comes from the open document on demand. It is the same win as on the server: for Core_v5.1.pdf, 1.4 MB instead of 127 MB.
Reported by the website session after moving the site to 7.6.0.
- Lingua principale
- C++
- Stelle
- 41
- Fork
- 10
- Merge medio
- 10h 30m
- PR unite (30g)
- 342
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opendocument-app/OpenDocument.core
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
opendocument-app/OpenDocument.core#1281 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
opendocument-app/OpenDocument.core#1280 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
opendocument-app/OpenDocument.core#1279 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
opendocument-app/OpenDocument.core#1221 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
opendocument-app/OpenDocument.core#1214 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opendocument-app/OpenDocument.core
Issue simili
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700Forse già presa @metis-sprock l’ha presa oggi. Apertabacklog bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EchoTools/nevr-runtime#1471 ·
I maintainer di solito rispondono entro 1 giorno
-
.NET ep:WebGPU platform:web
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/onnxruntime#33755 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
grumpycoders/pcsx-redux#2530 ·
-
A-tools P-medium S-ready-to-start studio task
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Status: Needs confirmation Status: Needs triage Type: Code Quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno