Versions and contracts

View as MarkdownOpen the editor

How a wrun indicator changes over time for someone who writes it in the chart: the contract a package runs under, the compiler the editor pins, and what a new version of your indicator does and does not change.

A wrun indicator has no language versions, only a contract that each published package carries and the versions you publish.

What moves, and what never does

text
The contract        abi_version in the sheet Run derives from your declarations
Your versions       0.1.0 on the first publish, then Patch, Minor or Major
The compiler        AssemblyScript 0.27.37, loaded by the editor's Run

wrun-1

What it adds
the first contract, frozen forever
Your file is on it when it declares
nothing the rows below name

wrun-2

What it adds
celled inputs, text slots, renderers and declared drawings
Your file is on it when it declares
a celled input, a text slot, a renderer or a declared drawing

wrun-3

What it adds
drawing handles, strategies and the last-bar flag
Your file is on it when it declares
a handle, a strategy(...) or bar.isLast()

wrun-4

What it adds
frames: level profiles, panels and widgets
Your file is on it when it declares
a frame

wrun-5

What it adds
text settings: the typed words, read by the file
Your file is on it when it declares
a text setting

wrun-6

What it adds
the bar count: how many bars the run holds
Your file is on it when it declares
a bar.count() read
  • The contract. You never pick it: Run derives it from what your declarations use (reading bar.count() makes the sheet wrun-6; a text setting makes it wrun-5; a frame makes it wrun-4; a handle, a strategy(...) or bar.isLast() makes it wrun-3; a celled input, a text slot, a renderer or a declared drawing makes it wrun-2; anything else stays on wrun-1). The first contract is frozen: its behavior never changes, and every package written under it keeps computing bit-identically. Each later contract adds to the one before and freezes in turn, so an indicator written today keeps computing the same way.
  • Your versions. The first publish is 0.1.0, and every later publish is a new version you pick as Patch, Minor or Major, with a one-line "What changed" (Publishing). A published version never changes. A chart that added your indicator keeps the exact version it added and reloads that version, so a new release reaches a chart when its owner adds the new version. Where an indicator runs (the browser, or OpenMarket's servers for Protected code) is fixed by its first version.
  • The compiler. Run compiles in your browser with the AssemblyScript version the kit pins, so the same source always builds the same module.

When the chart updates

The chart's editor and OpenMarket's alerts engine ship on their own schedule, and an update can let the editor accept new declarations, draw new kinds of shapes, serve new sources, or accept a new file shape (a file with onBar() beside the four-function form). It never rewrites a published version: the module a chart loads is the one you published, under its frozen contract, and a package that does not use a new feature is unaffected by it.

What we publish

PagePurpose
What is wrunWhat wrun is, how a file runs and where, in one read.
PublishingVersions, sharing and where a published indicator runs.