What's New in APL 2024.1
(This is not the most recent version of the APL change log. Use the Other Versions option to see the documentation for the most recent version of the APL change log)
Alexa Presentation Language (APL) 2024.1 introduces new features and capabilities for APL.
APL tooling updates
Debug APL documents with logging in the authoring tool
When you preview a document in the authoring tool, the preview now includes a log window. Use the log window to display logging messages sent with the Log
command. This can be useful for debugging your document.
For details about defining log messages, see Log Command. For details about using the log window, see Debug a document with the log window.
Use APL code snippets in Visual Studio Code
The Alexa Skills (ASK) Toolkit for Visual Studio Code (VS Code) now supports automatic completion of APL language constructs, including components and commands. The tool suggests APL properties as you type your APL document in the VS Code Editor. For more about the code snippets, see the pull request on GitHub.
Respond to changes in bound variables
Components, layouts, and Alexa Vector Graphics (AVG) support bound variables, which you define with the bind
property. A bound variable is a local variable that your document can access from the data-binding context of the component and its children.
For components and layouts, these bound variables now support an onChange
handler. You can define commands to run when the value of the variable changes. For details, see APL Bound Variables.
Bound variables on vector graphics don't support the onChange
handler.
Capture and respond to events when components change visibility
APL generates events when the visibility of a component changes. You can use a handleVisibilityChange
event handler to capture these events and run commands. For example, you can run commands in response to an item scrolling into view.
Visibility change events trigger for two types of changes: when the opacity of the item changes, or when the visible percentage of the item's bounding box changes.
For details, see Visibility Change Event Handlers.
Test your documents for localization issues up front
A new "pseudo-localization" mode for the document lets you test how UI elements in your document might appear when localized into different languages. Pseudo-localization is a mock translation which mimics the space required by a string after real world translation. For example, the pseudo-locale version of the string "Hello World" is "[Ħḗḗŀŀǿǿ Ẇǿǿřŀḓ]." The resulting string, although still readable, occupies more space and height than the original.
You can use pseudo-localization mode to identify any issues with UI layout, including truncation and overflow, that might occur when you actually translate the text into other languages.
To enable pseudo-localization mode, use the settings.pseudoLocalization
property in your document. For details, see Settings.
Other updates
- A new
Map.keys()
function returns an array the keys for a map. For details, see Map functions.
Updated APL cheat sheets
The APL cheat sheets provide a quick reference guide that provides information about the syntax and semantics of an APL document and its components, commands, and properties in a concise and digestible format. To download this reference for 2024.1, see APL Cheat Sheets.
APL versions and Amazon device support
For details about the APL versions available on Amazon devices, see APL versions and Amazon device support.
Work with APL versions
For details about how to check the APL version, see What's New in APL.
Related topics
Last updated: Dec 18, 2024