Roku and simulator runtime model
The application has one deployment target: Roku. The web simulator provides a browser implementation of the Roku-facing contracts used during development.
Runtime identity
PlatformType.Roku identifies the native application and PlatformType.Web identifies the browser simulator. Keep application state, screens and services in TypeScript; isolate execution-specific code in the existing Roku and simulator implementation modules.
__ROKU__ and __WEB__ are compile-time flags. Use them only in conditions containing build flags, so the compiler can remove the other execution path.
Display and input
The simulator offers Roku display profiles, including SD, HD and FHD. Television layouts use the Roku design coordinate space and directional focus. Keyboard and pointer controls let you exercise the application from a development computer.
Read layout measurements through the framework device services. Validate the final interface and remote input on physical Roku hardware.
Configuration
AppConfig owns presentation, fragments and translations. BuildConfig owns environment settings and development flags. Keep device credentials in ignored local configuration.
The browser and Roku builds select their implementation with TypeScript aliases and the project build configuration. See Roku and simulator code.
Config variants
Use the TV expression for Roku layouts. Keep simulator-specific debugging values in the web BuildConfig and device values in the Roku BuildConfig. AppConfig owns presentation values shared by the simulator and the Roku application.