Sandbox globals
What JavaScript is available inside the isolate, and what is not.
Standard built-ins kept
Object, Function, Boolean, Symbol, Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError, Number, BigInt, Math, Date, RegExp, JSON, Promise, Map, Set, WeakMap, WeakSet, Array, ArrayBuffer, SharedArrayBuffer, DataView, Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array, String, isNaN, parseInt, parseFloat, encodeURI, decodeURI, encodeURIComponent, decodeURIComponent, escape, unescape, globalThis
Injected by the hub
console, EntityWrapper, settings, location, state, <every hydrated input key> plus every global function.
Absent
- import / export (modules)
- require
- fetch
- XMLHttpRequest
- setTimeout / setInterval
- Intl
- process
- Buffer
- filesystem
- sockets
Use runIn instead of timers, httpRequest instead of fetch, and formatDateParts instead of Intl.
Input hydration
| Input type | Hydrated as |
|---|---|
entity | EntityWrapper (one pick) or a Proxy array of EntityWrappers (2+ picks, fans every service call out to all members) |
number | number literal |
boolean | boolean literal |
string | string |
text | string |
password | string |
email | string |
time | string |
date | string |
enum | string |
array | JSON array (rows are plain objects) |
thermostatSchedule | JSON array (rows are plain objects) |
Platform events
The hub fires the location event systemStart (value boot) once per boot, after schedules and subscriptions are restored.