🤖 Replace Object.fromEntries with Array.reduce
Rationale behind change:
Object.fromEntries needs to be polyfilled in any project using this right now
and the switch to Array.reduce removes this need. To me it makes sense not
to have dependencies like that. Sentry for the current project I work with is
filled with Object.fromEntries is not a function errors.
Thanks for the PR! Just out of curiosity, what platform are you running on? I believed that this was already implemented in major browsers.
We might also lower the ES version in the tsconfig if we want to support older platforms
Thanks for the PR! Just out of curiosity, what platform are you running on? I believed that this was already implemented in major browsers.
Hey! It's a node project. I am not affected personally since I run up-to-date browsers but our Sentry show that enough people are hit with this to require us to do something about it.
We might also lower the ES version in the tsconfig if we want to support older platforms
It doesn't really matter what direction is taken for me personally, as long as our project don't have to resort to a slower solution to solve it. What direction are you leaning towards? Keep Array.reduce but leave the fromEntries helper in there?
It doesn't really matter what direction is taken for me personally, as long as our project don't have to resort to a slower solution to solve it. What direction are you leaning towards? Keep Array.reduce but leave the fromEntries helper in there?
I would leave some sort of helper in there (fromEntries or mapValues). Also I would lower the "lib" version in tsconfig since otherwise it would be difficult for us to enforce those changes.
Do you mind sending the names and versions of affected browsers? Object.fromEntries might not be the only problem in that case.