algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
177 stars 45 forks source link

Replace Object.fromEntries with reduce for better Node support #109

Closed prichey closed 3 years ago

prichey commented 3 years ago

When attempting to deploy to an older environment (Node v10.23.0), I got the following error:

Screen Shot 2020-12-07 at 4 04 16 PM

Looks like it's due to the fact that Object.fromEntries wasn't introduced until Node v12.

There are polyfills available, but reduce is used elsewhere in the same file so I figure it's probably a net gain to replace. Let me know if what you think, thanks!

prichey commented 3 years ago

@Haroenv Happy to! What do you think it should be? >=10.0.0?

Tbh I didn't even realize that requirement is there, which makes this PR maybe unnecessary. On my side I fixed the node engine requirements in our runtime so this is no longer an issue so up to you if you think it's a worthwhile change.

Haroenv commented 3 years ago

I'll close this for now, since nobody else has asked for it since, but we can reopen if someone asks!