-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Consider making a common package for browser utility functions #1104
Comments
My two cents: the lack of such a package threw me for a loop when replacing Array.prototype.find here: 5aa2b6b#diff-ab2630d7dd0cee3811f920a34f5efc3b I felt like I should create a simple polyfill function (e.g. https://github.com/Spetnik/ie-Array.find/blob/master/README.md) but I really couldn't find a place where it made sense to add it. I would assume that this proposed package would be the perfect place for such a function. |
We don't use polyfills in MDC-Web because we don't want to conflict with other libs or create weird hard-to-trace bugs, but I would love to create a centralized set of ponyfills (similar to polyfills, but without monkey-patching global prototypes) and other common utilities like |
We now have Closing this. |
I noticed we currently have 3 packages (drawer, ripple, toolbar) that define
util.applyPassive
for detecting passive event support and making use of it, and at least 2 packages (dialog and ripple) that define a function to detect support for custom CSS properties.This leads to redundant implementation and test code, and in the latter case also has led to the two implementations skewing apart from each other.
We should consider putting common utilities like this in a centralized reusable package. We should also probably check whether there is a reason (other than an oversight) why
supportsCssCustomProperties
in dialog's util hasn't kept up with the edge cases added to ripple's util.The text was updated successfully, but these errors were encountered: