react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

Remove 'normalize-css-color' from 'react-native-web'

Open necolas opened this issue 2 years ago • 2 comments

Is there an existing request?

  • [x] I have searched for this request

Describe the feature request

Look into removing the dependency on 'normalize-css-color' to help reduce bundle size and runtime cost of color processing. Consequences:

  • React Native for Web will only support CSS colors.
  • Cross-platform apps will need to migrate any unsupported color values to CSS colors.
  • React Native for Web will not deduplicate the same color defined using different syntax, e.g., rgba(255,0,0,1) and rgb(255,0,0). This might slightly increase the size of generated CSS files.

In the longer-term, build-time generation of CSS can support color value normalization / deduplication. But for client-side purposes, the normalization code is non-essential overhead.

necolas avatar Jul 06 '22 23:07 necolas

It looks like this was removed in 0.19.6. Sadly this has broken at least one other project that was expecting normalise-css-color to be present: https://github.com/GeekyAnts/NativeBase/issues/5772

Of course, the library in question should have its own dependency on this package, but I guess this will cause issues for people using RNW with NativeBase (which I'd guess is a decent few) who are upgrading from 0.18 -> latest (as I have just been).

ts-candide avatar Sep 28 '23 08:09 ts-candide

I don't know how many times it has to be said that packages should not depend on private modules inside other packages

necolas avatar Sep 28 '23 15:09 necolas