https://lukeb42.github.io/vertex-manual.html Float64Vertex Contents 1. Obtaining vertex.js 2. Loading in the 3. Setting a templates directory 4. DOM layer -- V$ / VQuery 5. AJAX 6. Fiber reconciler -- createElement & render 7. Hooks -- useState, useEffect, useRef, useMemo, useContext 8. Template engine -- Vertex.template / Mustache 9. Hash router -- Backbone style 10. useHash -- router meets reconciler 11. jQuery compatibility 12. Quick API reference 01. Obtaining vertex.js Vertex is a 1kloc SPA framework containing everything you need from React, Ractive-Load and jQuery while still being jQuery-compatible. vertex.js is a single, self-contained file with no build step and no dependencies. Download it from the Gist below and drop it wherever your project serves static assets. gist gist.githubusercontent.com/LukeB42/.../vertex.js Or fetch it from the command line: # save to your project's static directory curl -o static/vertex.js \ https://gist.githubusercontent.com/LukeB42/ef5b142325fc2bcd4915ba9b452f6230/raw/867cf609e8ec6bcb6700eda7f81c7c60e9ee01c9/vertex.js It ships as a UMD module, so it works equally as a plain
After loading, the following globals are available: Global Description Vertex Full namespace -- all features live here V$ Shorthand DOM wrapper -- always available $ Also set to the DOM wrapper only when jQuery is absent 03. Setting a templates directory Set Vertex.template.load.baseUri once at startup and every subsequent load() call that receives a relative path will automatically prepend it. Absolute URLs (starting with http://, https://, or /) are always used as-is, so fully-qualified paths continue to work unchanged. // main.js -- set the base once, then use short names everywhere Vertex.template.load.baseUri = "/static/templates/"; // "user-card" resolves to /static/templates/user-card Vertex.template.load("user-card", { el: "#sidebar", data: { name: "Alice", role: "Engineer" } }).then(instance => { instance.on("change", e => console.log("changed:", e)); }); // Absolute paths bypass baseUri entirely Vertex.template.load("/other/path/special.html", { el: "#special" }); Vertex.template.load("https://cdn.example.com/tmpl.html", { el: "#remote" }); A template file at /static/templates/user-card.html is just a regular HTML fragment wrapped in a