Documentation
Browse documentation

DocumentationReference

Limits

Everything in a PlayerVox OverCrow widget is bounded: the size of its files, the number of elements of its view, the time of a turn of its logic, the bytes of a response. The bounds keep a widget small and keep one widget from slowing the game or the others. This page lists the ones a widget author meets.

TEXT
error[view.too_many_children]: the view exceeds a size bound of the schema
  --> view.ocml:15:14375
   = help: split long static content, or render repeated content with <for>
check: 1 error(s), 0 warning(s)

An element with more than 1024 children: check names the bound, the place and a way out.

What happens at a limit

  • In the project's files, a limit is an error of overcrow-widget check, with a code that names it (view.too_many_elements, style.too_many_rules, project.file_size…). Nothing is truncated.
  • In a service call, a parameter out of bounds fails with invalid_request, a full quota with quota_exceeded, and too many requests at once with busy. See errors.
  • While the logic runs, exceeding a budget of the VM (the time of a turn, the heap, the messages of a turn) stops the widget; PlayerVox OverCrow restarts it a few times. See what happens on a failure.
  • In what the widget shows, a value out of bounds (a text too long for an attribute, too many nodes) is refused by PlayerVox OverCrow and stops the widget too: bound what you show, for example the number of rows of a list.

Lengths are logical pixels at 100 % content scale. Text limits count UTF-8 bytes unless the unit says characters. KiB and MiB are 1024 and 1024² bytes. The limits that the logic can read are also constants of the SDK: see limit constants.

Limits by topic

Project files and package

LimitValueMeaning
MAX_VIEW_SOURCE_BYTES256 KiBview.ocml source size.
MAX_STYLE_SOURCE_BYTES128 KiBstyle.ocss source size.
MAX_LOGIC_BYTES512 KiBThe logic.js script, compiled code of the view included.
MAX_LOCALE_ENTRIES2048Messages in one locales/<locale>.json file.
MAX_LOCALE_KEY_BYTES128 bytesLength of one message key.
MAX_LOCALE_VALUE_BYTES4 KiBLength of one message text.
MAX_LOCALE_FILE_BYTES256 KiBOne locales/<locale>.json file.
MAX_MANIFEST_BYTES64 KiBmanifest.json size.
MAX_LICENSE_BYTES64 KiBLICENSE text.
MAX_COMPILED_VIEW_BYTES512 KiBview.json, the compiled view.
MAX_PACKAGE_BYTES16 MiBSize of one .ocpkg archive.
MAX_PACKAGE_FILES256Entries in one archive, manifest.json and ledger.json included.
MAX_PACKAGE_PATH_BYTES128 bytesPath of one archive entry.
MAX_ASSET_PATH_SEGMENTS4Path segments below assets/, the file name included.

Manifest and options menu

LimitValueMeaning
MIN_WIDGET_ID_BYTES3 bytesShortest widget ID.
MAX_WIDGET_ID_BYTES128 bytesLongest widget ID; each dot-separated segment is at most 63 bytes.
MAX_VERSION_BYTES64 bytesPackage version text.
MAX_WIDGET_NAME_CHARS48 charactersOne English or French widget name in the manifest.
MAX_WIDGET_EDGE_PX4096 pxWidth or height of a widget's frame.
MIN_CONTENT_SCALE500 ‰Smallest content scale (50 %).
MAX_CONTENT_SCALE1750 ‰Largest content scale (175 %).
MAX_GAME_EVENTS32Semantic game events declared by one package.
MAX_MENU_ROWS16Widget rows in wrapper.menu, group rows and their children included.
MAX_MENU_DEPTH1Submenu levels: a group cannot contain another group.
MAX_MENU_LABEL_CHARS80 charactersOne English or French label of a row or choice.
MAX_MENU_ID_BYTES48 bytesRow ID and choice value.
MIN_MENU_CHOICES2Choices of one choice row, lower bound.
MAX_MENU_CHOICES16Choices of one choice row, upper bound.
MAX_MENU_NUMBER1000000 absolute valueAbsolute value of a slider bound, step or default.
MAX_SLIDER_STEPS10000(max - min) / step of one slider row.

Network rules

LimitValueMeaning
MAX_NETWORK_RULES32Network rules declared by one package.
MAX_NETWORK_PATH_BYTES1 KiBpath template of one network rule.
MAX_PATH_PARAMS8pathParams of one network rule.
MAX_QUERY_PARAMS16queryParams of one network rule.
MAX_ENUM_VALUES32Values of one enum parameter constraint.
MAX_ENUM_VALUE_BYTES128 bytesOne enum parameter value.
MAX_PARAMETER_NAME_BYTES32 bytesName of one path or query parameter.
MAX_SLUG_PARAMETER_BYTES128 bytesLargest maxLength of a slug parameter constraint.
MAX_STRING_PARAMETER_BYTES256 bytesLargest maxLength of a string query parameter constraint.
MAX_DNS_LABEL_BYTES63 bytesOne dot-separated label of a network origin host or of a widget ID.
MAX_DNS_NAME_BYTES253 bytesHost name of one network origin.
MAX_REQUEST_URL_BYTES2 KiBURL text of one request.
MAX_HTTP_REQUEST_BYTES256 KiBBody of one outgoing request.
MAX_HTTP_RESPONSE_BYTES1 MiBBody of one response delivered to the widget when its network rule declares no maxResponseBytes, and of every as: "image" response.
MAX_HTTP_DECLARED_RESPONSE_BYTES3 MiBLargest maxResponseBytes of one network rule: the body of one response the rule allows, delivered to the widget.
MAX_HTTP_RESPONSE_BYTES_PER_WIDGET4 MiBResponse bytes one widget's requests in flight may reserve, each the bound of its rule; busy beyond. Equals MAX_HTTP_CONCURRENT_PER_WIDGET × MAX_HTTP_RESPONSE_BYTES, so rules without maxResponseBytes never reach it.
MAX_HTTP_RESPONSE_BYTES_GLOBAL64 MiBResponse bytes all widgets' requests in flight may reserve; busy beyond. Equals MAX_HTTP_CONCURRENT_GLOBAL × MAX_HTTP_RESPONSE_BYTES.
MAX_HTTP_CONCURRENT_PER_WIDGET4Requests in flight for one widget.
MAX_HTTP_CONCURRENT_GLOBAL64Requests in flight for all widgets.
HTTP_TIMEOUT_MS30000 msTotal duration of one request.

Listing

LimitValueMeaning
MAX_LISTING_LOCALIZATIONS16Localized texts of one listing.
MAX_LISTING_NAME_BYTES128 bytesMarketplace name of one localization.
MAX_LISTING_DESCRIPTION_BYTES512 bytesMarketplace description of one localization.
MAX_AUTHOR_BYTES128 bytesAuthor shown in a listing.
MAX_SPDX_LICENSE_BYTES64 bytesSPDX license expression of a listing.
MAX_CATALOG_URL_BYTES2 KiBSource URL of a listing.
MAX_PREVIEW_BYTES256 KiBPNG preview image of a listing.

View

LimitValueMeaning
MAX_VIEW_ELEMENTS4096Elements written in view.ocml, components included.
MAX_COMPONENTS64Local components declared in one view.
MAX_COMPONENT_PROPS32Declared properties of one local component.
MAX_VIEW_EXPRESSIONS4096Compiled expressions of one view, handlers included.
MAX_EXPRESSION_BYTES1 KiBSource length of one {expr} expression.
MAX_EXPRESSION_DEPTH32Nesting of operators, calls, members and literals in one expression.
MAX_CALL_ARGUMENTS8Arguments of one call, and entries of one object or array literal, in an expression.
MAX_SCENE_NODES4096Elements present in the view of a running widget, list items included.
MAX_TREE_DEPTH32Depth of the view's tree below its root, also the nesting limit of if, for and components.
MAX_CHILDREN1024Children of one element.
MAX_NODE_TEXT_BYTES16 KiBText content of one text, span, badge or option element.
MAX_ATTRIBUTE_TEXT_BYTES1 KiBAny text attribute not bounded more tightly.
MAX_LABEL_BYTES256 byteslabel, tooltip and placeholder attributes.
MAX_IDENTIFIER_BYTES64 bytesClass names, component names, field names, @keyframes names and similar identifiers.
MAX_INITIALS_BYTES16 bytesinitials fallback of an avatar.
MAX_CLASSES_PER_NODE16Classes on one element.
MAX_FIELD_TEXT_BYTES16 KiBContent of one field or textarea, and of one input or change event.
MAX_CHART_POINTS1024Values in one chart series.
MAX_CHART_SERIES4series children of one chart.
MAX_KEY_BYTES32 byteskey of one keydown event: one printable character or a named key.

Style

LimitValueMeaning
MAX_STYLE_RULES1024Rules in one style sheet, @keyframes blocks excluded.
MAX_SELECTORS_PER_RULE8Comma-separated selectors of one rule.
MAX_COMPOUNDS_PER_SELECTOR4Compound selectors joined by combinators in one selector.
MAX_SIMPLE_SELECTORS_PER_COMPOUND6Type, class and state selectors in one compound selector.
MAX_DECLARATIONS_PER_RULE64Declarations in one rule or @keyframes stop.
MAX_KEYFRAMES32@keyframes blocks in one style sheet.
MAX_KEYFRAME_STOPS16Stops in one @keyframes block.
MAX_SHADOWS2Layers in one box-shadow value.
MAX_SHADOW_BLUR_PX64 pxBlur and spread radius of one shadow.
MAX_GRADIENT_STOPS8Colour stops in one linear-gradient().
MAX_GRID_TRACKS24Tracks in one grid-template-rows or grid-template-columns.
MAX_GRID_FRACTION1000 absolute valueLargest <fr> factor of one grid track.
MAX_TRANSITIONS8Entries in one transition or animation list.
MAX_ANIMATION_MS300000 msDuration or delay of one transition or animation.
MAX_ACTIVE_ANIMATIONS64Transitions and animations running at once in one widget; extra ones jump to their end state.
ANIMATION_RATE_HZ60 HzMaximum repaint rate while an animation runs; nothing repaints when nothing changes.
MAX_LENGTH_PX16384 pxAbsolute value of any length, offset or coordinate.
MIN_FONT_SIZE_PX6 pxSmallest font-size before content scale.
MAX_FONT_SIZE_PX96 pxLargest font-size before content scale.
MAX_PERCENT1000 absolute valueAbsolute value of any <percent> in a style value.
MAX_ANGLE_DEG3600 absolute valueAbsolute value of any <angle>, in degrees (ten turns).
MAX_TRANSFORM_FUNCTIONS4Functions in one transform value.
MAX_TRANSFORM_SCALE8 absolute valueLargest scale() factor; the smallest is 0.
MAX_EASING_STEPS60Steps of one steps() easing.
MAX_ANIMATION_ITERATIONS10000Finite iteration count of one animation; infinite stays allowed.

Drawing and images

LimitValueMeaning
MAX_CANVASES8canvas elements in one widget.
MAX_DRAW_COMMANDS4096Commands in one call of draw, replacing the canvas content.
MAX_PATH_POINTS16384Vertices the host draws for one call of draw, all paths included, counted with a fixed ceiling per command: moveTo and lineTo 1, quadTo 8, cubicTo 16, arc and circle 64, rect 36, other commands 0.
MAX_DRAW_STATE_DEPTH16Nested save commands.
MAX_IMAGE_EDGE_PX2048 pxWidth or height of one decoded image.
MAX_IMAGE_ENCODED_BYTES2 MiBEncoded size of one PNG, JPEG or WebP image before decoding.

Logic

LimitValueMeaning
VM_HEAP_BYTES16 MiBHeap ceiling of the VM when the manifest requests none.
VM_MAX_HEAP_BYTES48 MiBLargest heap ceiling a manifest may request.
VM_STACK_BYTES256 KiBStack ceiling of the VM.
VM_PROCESS_MEMORY_BYTES64 MiBHard memory ceiling of one widget's process.
VM_CPU_PERCENT25 % of one coreCPU ceiling of one widget's process.
VM_TURN_BUDGET_MS50 msWall time of one turn of the logic before the VM interrupts it.
VM_JOBS_PER_TURN1024Promise jobs run in one turn; a longer queue is a resource failure.
VM_MESSAGES_PER_TURN64Messages the widget may emit during one turn.
MAX_VM_MESSAGES_PER_SECOND120 per secondSustained rate of messages from the widget to the host.
MAX_VM_MESSAGE_BURST240Burst of messages allowed above that rate.
MAX_PATCH_BYTES256 KiBSize of what the widget sends at once: one change of the view or one call of draw.
MAX_PATCH_OPS4096Operations in one change of the view (elements created, removed, moved or changed) after a turn.
MAX_TIMERS16Active timers of one widget.
MIN_TIMER_INTERVAL_MS100 msShortest timer period; animation belongs to style, not to timers.
CLOCK_RESOLUTION_MS1 msGranularity of Date.now() inside the VM.
MAX_LOG_BYTES4 KiBText of one log call.

Services

LimitValueMeaning
MAX_SERVICE_CALLS_IN_FLIGHT16Unanswered service calls of one widget, subscriptions excluded.
MAX_SUBSCRIPTIONS16Open service subscriptions of one widget.
STORAGE_QUOTA_BYTES256 KiBKeys and values stored by one widget.
MAX_STORAGE_KEYS512Keys stored by one widget.
MAX_STORAGE_KEY_BYTES128 bytesLength of one storage key.
MAX_STORAGE_VALUE_BYTES64 KiBSerialized JSON size of one storage value.
MAX_CLIPBOARD_BYTES16 KiBText of one clipboard write.
MAX_OBJECT_ID_BYTES128 bytesOpaque object ID or cursor exchanged with a capability service.

Notes, reviews and chat

LimitValueMeaning
MAX_NOTES8Notes in the user's notes document; notes.create fails beyond it.
MAX_NOTE_TITLE_BYTES96 bytesNote title, non-empty after trimming.
MAX_NOTE_BODY_BYTES8 KiBNote body.
MAX_NOTE_ITEMS64Checklist items of one note.
MAX_NOTE_ITEM_BYTES256 bytesOne checklist item.
MAX_REVIEW_CHARS2000 charactersPlayerVox review text.
MAX_CHAT_MESSAGE_CHARS500 charactersTwitch chat message, the Twitch limit; not empty or whitespace-only, no control characters.
MAX_CHAT_FRAGMENTS16Text and emote runs of one delivered chat message; the host merges the rest into text.
MAX_CHAT_FAVORITES20Favourite Twitch channels kept by the host.
MAX_CHAT_CHANNEL_BYTES25 bytesTwitch channel login after normalization: ASCII letters, digits and _, lowercased.

Reference images

LimitValueMeaning
PARITY_CHANNEL_TOLERANCE2 levels of 255Largest per-channel difference for a pixel to count as equal to the reference image's.
PARITY_MAX_DIFFERENT_PIXELS100 ppmShare of pixels allowed beyond the channel tolerance. One wrong 10 px letter in a 360 × 260 widget is 385 ppm.