Skip to content

Developer Tools ​

The Uhuu editor has built-in tools for working on a template while it runs inside the editor: switching between template versions, connecting a development server, editing the payload and watching the messages between the editor and the template.

Template commands ​

Press ⌘K (macOS) or Ctrl+K (Windows, Linux), or click the ⌘ button in the editor header, to open Template commands: one searchable list of what you can do with the open document and template.

GroupCommands
DocumentSave, Export PDF, Open PDF, Rename, Save as, Version history
Template versionSwitch to the deployed version or to a declared version, Copy link to this version
DeveloperShow or hide the developer tools, Edit payload, Show messages, Reload template, Copy debug info, Connect to URL

Commands that do not apply to you or to the template are left out.

TIP

While the cursor is inside the template itself, the shortcut goes to the template, not the editor. Click the ⌘ button instead.

The developer tools dock ​

The developer tools sit in the bottom-left corner of the editor. Minimized, they show a status dot and the template version on screen:

  • Green: the template answered the editor's handshake.
  • Pulsing: the template is loading.
  • Red: the template did not answer within 10 seconds.

The dock is hidden until you turn it on: press ⌘K and choose Show developer tools. It then stays on in that browser until you hide it again from its ⋯ menu. Click the minimized dock to open the panel; it does not block the template, so you can keep editing while it is open.

While a version other than the deployed one is on screen, the minimized dock always shows, so nobody tests the wrong build by accident.

Everyone who can edit documents can switch between declared versions. Connecting a URL, the payload editor, the message log and debug info are for template developers (workspace admins and developers).

Template versions ​

Testers often need to compare the deployed template with a new build, for example during a redesign. Declare the other builds in uhuu_dynamic_options.dev_versions, and anyone who can edit documents of the template can switch between them in one click.

Add the versions to the template's base data so every document has them:

json
{
  "uhuu_dynamic_options": {
    "dev_versions": {
      "sandbox": "https://templates.example.com/sandbox/my-template/",
      "modern": "https://templates.example.com/modern/my-template/"
    }
  }
}
  • The key is the name testers see. Use letters, digits, -, _ or . (up to 40 characters).
  • The value must be an https:// URL. Other values are ignored and listed as invalid in the developer tools.
  • A document's own dev_versions add to the template's list; a key in both uses the document's URL.
  • UHUU_TIMESTAMP in a version URL is replaced with a fresh value on every switch, like in the template URL, to bypass caches.
  • Versions apply to templates the editor loads from a URL (SDK templates).

Switching. Open the dock's Version tab, or use the version commands in Template commands. The editor loads the selected build and sends it the same document data, so both versions show the same document. Switching does not reload the editor and keeps unsaved changes.

Sharing. The address bar carries the selection as ?dev_version=modern. Copy the link (the link icon next to each version, or Copy link to this version) to open the same document in the same version. A link to a version the template no longer declares opens the deployed one.

Saving and exporting. While a declared version is selected, Save and Export PDF store its URL in the document as uhuu_dynamic_options.remote_url, with dev_version naming the version, and the PDF is rendered from that version. Back on the deployed version, the next save removes both again, so a document never stays on a test build. A development URL is never stored, so its exports use the deployed version.

Public HTTPS versions only

The renderer fetches the version itself. A version URL that is not public https:// (for example localhost, a private network address, or a host built from a placeholder) is ignored when rendering, and the PDF comes from the template's own URL. A document saved on a version keeps rendering from it, including print orders, until it is saved on the deployed version.

Exports of URL templates still use the deployed version

The renderer uses the template's own URL first and reads remote_url only for templates without one. For SDK templates, PDFs, rendering and print orders therefore still come from the deployed URL: deploy a build as the template URL before you compare its PDFs.

When the new build replaces the deployed one, remove its entry, or keep the old build as a version (for example "legacy") for a while to check differences after the release.

Connecting to a development URL ​

Template developers can load any https:// URL in place of the template, typically a local development server such as https://localhost:5173 (see Serving Locally with HTTPS). Without declared versions, the Version tab folds the deployed version into one collapsed line, so Connect to URL is the first thing you see.

  1. Open the dock's Version tab (or Connect to URL in Template commands).
  2. Enter the URL under Connect to URL and press Connect.
  3. The editor loads your development build with the current document. Pick Deployed to go back.

The URL is kept in the address bar as ?dev_remote_url=…, so reloading the page keeps it. The editor only accepts it for template developers and only over HTTPS.

Payload ​

The Payload tab shows the document data the editor sends to the template, as JSON.

  • Apply to document replaces the document data with your JSON. Keys you remove are removed from the document. Save the document to keep the change.
  • Send to template only sends the JSON to the template as its payload without changing the document. Use it to try edge cases; the next change in the document sends the real data again.
  • Format, Copy, Download JSON and Revert help with editing. Both actions stay disabled until the JSON is a valid object.

Messages ​

The Messages tab logs the messages between the editor and the template (the SDK protocol): direction, action, size and time. Click a row to see its JSON. Filter by action, pause or clear the log.

Messages the editor ignored, for example an unknown action, are marked Ignored. That is usually the first thing to check when the template does not react as expected.

Batch and Info ​

  • Batch shows the batch rows last sent to the template (see Batch Export).
  • Info shows which URL is loaded, how (directly or through the template proxy), the document and the editor language. Copy debug info copies all of it as JSON for a support request; it never includes the document data.

Public developer documentation for Uhuu.