-->
As part of our Smart TV development, we constantly face the reality of the non-standard browser environment. The platforms we work with often come with a custom browser build, which means that we sometimes have access to additional platform-specific APIs, but also lack support for some of the latest standards available in mainstream browsers.
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.
We decided to patch out the gap
property from the React TypeScript types. This means that if it’s in use, it will:
gap
property from the type system by editing the csstype
library and removing the declaration for the gap property.react
and csstype
, we opted to use the pnpm patch
tool.pnpm patch
, we have a [email protected]
file included in the project. This file contains changes that are automatically applied by pnpm
after the packages are installed.gap
property and marks it as unsupported: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;