segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.38k stars 830 forks source link

Warning: Assigning unhandled ui-box props to 'style': WebkitFontSmoothing, WebkitAppearance, MozAppearance #1601

Closed vadimcoder closed 1 year ago

vadimcoder commented 1 year ago

Hello, evergreen community and maintainers! I hope you're doing well. Thanks for all your hard work and dedication. Appreciate it a lot!

After updating to 7.0.1 we start getting red error messages in the console:

warning.js:4 Warning: Assigning unhandled ui-box props to 'style':
{
    "WebkitFontSmoothing": "antialiased",
    "WebkitAppearance": "none",
    "MozAppearance": "none"
}

coming from node_modules/evergreen-ui/esm/buttons/src/IconButton.js

Untitled

Code:

import { Button } from "evergreen-ui";

export default function App() {
  return (
    <Button>button</Button>
  );
}

Reproduce link: https://codesandbox.io/s/charming-swanson-o5rrg7?file=/src/App.js

Could you please take a look?

brandongregoryscott commented 1 year ago

Hey @vadimcoder -

This logging message was added during the refactor to remove glamor to help spot other css props that were unhandled by ui-box and falling back to glamor. We probably don't need it anymore since most of the css props we're using are supported (and the properties that are unhandled now are not widely supported in browsers anyway), but it should only appear in development and not really harm anything.

vadimcoder commented 1 year ago

Hi @brandongregoryscott,

Firstly, thanks for your hard work, it is really important.

Regarding these warnings, I just wanted to share our story that these red warnings are mixed up with application warnings and draw additional attention to the library. And raises questions to me as an initiator of the update to v7. This is kind of stressful since I cannot do much about it. But I totally understand the motivation. Is it possible maybe to hide the warnings if unhandled pros are coming to ui-box from evergreen ui specifically?

brandongregoryscott commented 1 year ago

I'll open up a PR to remove it. It was primarily for internal debugging since external consumers won't be able to pass unhandled ui-box props except through the style prop anyway.

vadimcoder commented 1 year ago

Oh that would be really awesome! Thank you a lot!

brandongregoryscott commented 1 year ago

Should be resolved in v7.1.0!

vadimcoder commented 1 year ago

Hi @brandongregoryscott!

That was incredibly fast. I didn't expect that! )) Thank you so much.