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

Replace lodash 'isPlainObject' usage with is-plain-object library #11855

Closed
wants to merge 2 commits into from
Closed

Replace lodash 'isPlainObject' usage with is-plain-object library #11855

wants to merge 2 commits into from

Conversation

jayaddison
Copy link
Contributor

@jayaddison jayaddison commented Jul 20, 2020

Q                       A
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? No
Any Dependency Changes? Yes
License MIT

As per feedback in #11789 (comment), this is another instance of a lodash function that can be replaced by a standalone library.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 20, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 39bae07:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@babel-bot
Copy link
Collaborator

babel-bot commented Jul 20, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/26196/

@jayaddison
Copy link
Contributor Author

The two implementations seem to differ when determining whether an object created by using Object.create(null) is a plain object:

> isplainobject_standalone = require('is-plain-object');
[Function: isPlainObject]
> isplainobject_lodash = require('lodash/isPlainObject');
[Function: isPlainObject]
> var x = Object.create(null);
undefined
> isplainobject_standalone(x);
false
> isplainobject_lodash(x);
true

@TrySound
Copy link
Contributor

@jayaddison
Copy link
Contributor Author

(switching to draft because I'm not sure what factors should determine the approach between this and #11859)

@kaicataldo
Copy link
Member

Any reason we can't just use lodash.isplainobject instead? I don't think we need to get rid of lodash entirely, but it would be great if we could just install the utils we're using individually.

@TrySound
Copy link
Contributor

lodash.* packages are deprecated and will not be supported in lodash v5.

@kaicataldo
Copy link
Member

Ah, okay, that's a very good reason 👍

@jayaddison
Copy link
Contributor Author

Closing given a marginal preference for #11859 instead.

@jayaddison jayaddison closed this Sep 3, 2020
@jayaddison jayaddison deleted the dependencies/reduce-lodash-usage-isplainobject branch September 3, 2020 16:45
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Dependency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants