Roku and simulator code
Keep screens, application state and presentation in the same TypeScript application. The web simulator and Roku builds select their runtime implementation through existing @hs-platform aliases.
Compile-time flags
if (__ROKU__) {
console.info('Running on Roku');
}
if (__WEB__) {
console.info('Running in the web simulator');
}
Use build flags only inside flag-only conditions. Do not store them in variables, return them as runtime values or mix them with application state in the same expression. Nest runtime checks inside the selected branch instead.
Native Roku integration
Use typed SceneGraph interfaces and Roku components for native functionality. A browser mock can implement the same contract during simulator development. Keep those implementations at the framework or application host boundary, rather than scattering checks throughout screens.
See native Roku development, component libraries, and conditional compilation.