Restricting Unsupported CSS on Smart TV Devices with TypeScript

Navigating Smart TV’s unique browser environments poses challenges with non-standard builds and varying support. Discover how we address unsupported CSS properties like the ‘gap’ in Tizen 5.0 through TypeScript.

This means we need to be mindful in our development process to avoid using unsupported functionality.

We strive to have solutions that catch errors as soon as possible, ideally during the development cycle while writing code, before we test on the device.

Let’s take an example, Tizen 5.0 (2019) doesn’t support the Flexbox Gap property.

Samsung web engine specifications: gap

Error Reporting For Unsupported CSS ‘gap’ Property With Type Script Integration In IDE, Build System And CI

We Are Already Using

We decided to patch out the gap property from the React TypeScript types. This means that if it’s in use, it will:

The Implementation We Chose

diff --git a/index.d.ts b/index.d.ts
+   /*
+   * @deprecated This style prop is unsupported on Tizen 5.0 (2019)
+   */
-  gap?: Property.Gap<TLength> | undefined;
+  gap?: never;