-
Notifications
You must be signed in to change notification settings - Fork 7
Home
- This project ask-sdk-jsx-for-apl is a React-based APL templating framework that allows developers to define APL document within the code. By using the React-style JSX/TSX file format, developers can include Vesper components as XML-style definition for the APL and shorten the APL definition code length, making the development more manageable.
- Ask-Sdk-Jsx-For-Apl has many benefits over standard JSON-based APL templates, such as the following aspects.
- Ask-Sdk-Jsx-For-Apl uses React-based components to define each APL document. By using JSX files to include XML-based APL document declaration and defining the document in an encapsulated React component, skill developers can simply import and include the component into the response as a natural Javascript/Typescript code.
-
By leveraging React's component render lifecycle, ask-sdk-jsx-for-apl can dynamically change the custom component's behaviour and minimize the returned APL document size.
-
For example, suppose a chess game skill is developed using APL. In traditional JSON-based APL definition, the positions and padding for each board slot must be defined most likely in datasource section and each piece will need to refer to the spacing definition in the datasource. With ask-sdk-jsx-for-apl, the complexity is reduced since the spacing calculation is done on the Lambda, freeing up the APL document for more details.
- In the traditional JSON-based APL, a reuse of components can get complicated. Without use of layouts, multiple copies of same structure can exist and code change management can get very complex. With ask-sdk-jsx-for-apl, however, the reusability issue is resolved by simply creating new instances of a defined component class, making changes very fast and reliable.
- IDEs like Visual Studio code or IntelliJ IDEA provides auto-completion feature since ask-sdk-jsx-for-apl provides APL React components with the relevant properties.
- Primitive APL Components: Container, Frame, Image, Pager, ScrollView, Sequence, Text, TouchWrapper, VectorGraphic, Video
Note: Ask-Sdk-Jsx-For-Apl provides APL 1.3 features.
- APL Commands: AnimateItem, AutoPage, ClearFocus, ControlMedia,PlayMedia, Finish, Idle, OpenURL, Parallel, Scroll, ScrollToComponent, ScrollToIndex, Select, SendEvent, Sequential, SetFocus, SetPage, SetState, SetValue, SpeakItem, SpeakList
Note: Because commands are not React Components but defined interfaces, to utilize APL Commands fully using typescript is recommended.
- ARL Components (Responsive): AlexaBackground, AlexaButton, AlexaDivider, AlexaFooter, AlexaHeader, AlexaIconButton, AlexaImage, AlexaImageListItem, AlexaOrdinal, AlexaPageCounter, AlexaRating, AlexaTextListItem, AlexaTransportControls, AlexaHeadline, AlexaImageList, AlexaLists, AlexaPaginatedList, AlexaTextList
Note: Ask-Sdk-Jsx-For-Apl provides alexa-layouts-1.1.0.