-
Container ID mismatch
src/lib.rs::run()expects an element with ideditor-container(error string still mentionsapp).tests/web.rscreates a container with idapp– all browser tests will fail.- Packaging wrapper
public/js/terraphim-editor.jsdynamically assigns a random id to the passed container, then invokesrun(), which will not find#editor-container⇒ runtime failure in bundled build.
-
Duplicate / competing rendering layers
- Rust/WASM already renders full editor UI via
Rinjatemplate (templates/editor.html). public/js/terraphim-editor.jsalso builds its own DOM subtree & later calls the samerun()again.- Leads to double DOM, duplicate listeners, BROKEN separation of concerns.
- Rust/WASM already renders full editor UI via
-
Markdown preview update strategy
src/lib.rs::setup_markdown_conversion()converts on everyinputevent; that's fine, but JS wrapper callsrun()on every keystroke which re-initialises everything – very expensive and probably broken.
-
Packaging scripts
vite.config.jscopiespkg/terraphim_editor.js&.wasmintopublicbefore every build – OK, but we must ensurewasm-pack buildran first.build.shassumesdist/exists and contains CSS namedstyle.css; Vite renames it toterraphim-editor.cssviaassetFileNames, but only when css is part of bundle. Need to confirm CSS pipeline or copy frompublic/css/terraphim-editor.css.
-
Examples
- All examples expect global constructor
TeraphimEditorthat works; because of (1) & (2) they currently fail to render.
- All examples expect global constructor
- Decide single source of truth for editor UI (Rust vs JS).
- Align container id across Rust code, tests, and JS wrapper.
- Expose a lightweight
render_markdown(input: &str) -> Stringfunc from WASM for JS to use instead of callingrun(). - Simplify JS wrapper & use
render_markdown()for live preview & toolbar actions. - Fix build.sh CSS handling & verify
package/examples afternpm pack(tarball inspected, CSS + wasm present).
- Update panic message in
run()