Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(lodash): remove isFinite usage #3709

Merged

Conversation

francoischalifour
Copy link
Member

This removes lodash/isFinite usage.

@francoischalifour francoischalifour requested a review from a team April 19, 2019 13:14
@algobot
Copy link
Contributor

algobot commented Apr 19, 2019

Deploy preview for instantsearchjs ready!

Built with commit d0e0f2c

https://deploy-preview-3709--instantsearchjs.netlify.com

@Haroenv
Copy link
Contributor

Haroenv commented Apr 19, 2019

Number.isFinite isn't supported in IE11, where should we add a note for this? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Browser_compatibility

Otherwise this is fine, because lodash "polyfills" Number.isFinite: https://github.com/lodash/lodash/blob/4.17.11/lodash.js#L11628

@francoischalifour
Copy link
Member Author

Since I read that Lodash's isFinite relies on Number.isFinite, I thought that would be fine. Good catch.

We can use the top-level isFinite function which is supported on IE.

src/lib/utils/isFiniteNumber.ts Outdated Show resolved Hide resolved
src/lib/utils/isFiniteNumber.ts Outdated Show resolved Hide resolved
@francoischalifour francoischalifour requested a review from a team April 23, 2019 08:21
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks equivalent to the lodash one

@francoischalifour francoischalifour merged commit c60291a into refactor/lodash-removal Apr 23, 2019
@francoischalifour francoischalifour deleted the refactor/lodash-removal-isFinite branch April 23, 2019 11:51
@@ -0,0 +1,5 @@
function isFiniteNumber(value: any): value is number {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a comment to the polyfill version, since we don't provide a test.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill

francoischalifour added a commit that referenced this pull request Apr 26, 2019
* refactor(lodash): remove defaultsDeep usage (#3700)

* refactor(lodash): remove noop usage (#3701)

* refactor(lodash): remove first and last usage (#3704)

* refactor(lodash): remove some usage (#3705)

* refactor(lodash): remove isArray usage (#3708)

* refactor(lodash): remove mapKeys usage (#3710)

* refactor(lodash): remove forEach usage (#3702)

* refactor(lodash): remove has usage (#3703)

* refactor(lodash): remove isFinite usage (#3709)

* refactor(lodash): add documentation for isFiniteNumber (#3722)

* refactor(lodash): remove get usage (#3728)

* refactor(lodash): remove isPlainObject usage (#3724)

* refactor(lodash): remove reduce usage (#3725)

* refactor(lodash): remove uniq usage (#3727)

* refactor(lodash): remove range and times usage (#3721)

* refactor(lodash): remove isEqual usage (#3723)

* refactor(lodash): remove mapValues usage (#3729)

* refactor(lodash): remove escape usage (#3730)

* refactor(lodash): remove keys usage (#3731)

* refactor(lodash): remove union usage (#3732)

* refactor(lodash): remove curry usage (#3733)

* refactor(lodash): remove find usage (#3706)

* refactor(lodash): remove mergeWith usage (#3734)

* chore(deps): remove lodash and @types/lodash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants