Closed mihai-ro closed 2 years ago
Thanks a lot for your hard work @mihai-ro! I'll probably need long time to review it, because there many changes and I don't work with react for several years, then I'm not really aware of the latest changes š
However, without looking at the code in details, here is a 1st quick review:
In general:
However, I know this code is pretty old and I saw interesting ideas in your PR to avoid the code duplication. So, feel free to open another PR only with your code refactoring, and I'll be glad to review it!
I admit, I got carried away with the refactoring, and the linting config is too much š
I will revert the lint config changes and push again.
testing-library
changes the mindset for testing, as the DX is to focus more on the actual behaviour that you want to test, rather than on how the engine works; e.g. I removed the whole wrapper refresh part, as that is just a flaw that enzyme patched with the wrapper update; additionally, it has full compatibility and no 3rd party non-official plugins are needed to make it actually run. Also, if you look through the syntax, it is actually cleaner and more intuitive; e.g. we don't have to google what keycode is that one that the test executes. I would argue testing-library is the better way to test integrations in react applications.hasDefaultStyle
to component); using that boolean we can dynamically import that css
file with variables; if not, they will just provide their own variables in :root
or whatever component they have their variables attached to. Also, we can check whether the browser supports variables. I am aware that variables do not have full coverage over all of the browsers, at the same time I would like to ask whether you intend to continue providing support to browsers such as IE (which is a dead project), or smaller Chinese browsers that actually fell back with their implementations. If not, we can safely use variables.I would argue bumping dependencies and keeping your application up-to-date is a good practice, and refactoring is not a bad thing, as long as it does not turn the project upside down. On the opposite, failing to update dependencies would potentially expose security flaws. Regarding the bugs - there is no software that is absolutely bug-less, that is why we test and gradually improve the application to make it more sturdy and reliable to the users. With the second bit - I concur:) but that does not mean we just have to lay back and expect things to just work, as this is how we grow, by revisiting our projects and understanding what can be improved.
As I mentioned above, I will try to squeeze some time to get some updates up; it will most likely not be this week, but I will do my best in the near time.
Sorry for the long silence, I really had no time to work on personal projects š©
Work done:
defaultValue
,value
andonChange
Close #44 Close #53