-
Notifications
You must be signed in to change notification settings - Fork 2k
Packages: Introduce @automattic/is-plain-object
#65668
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
Conversation
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~98 bytes added 📈 [gzipped]) DetailsCommon code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Async-loaded Components (~86 bytes added 📈 [gzipped]) DetailsReact components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
|
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
|
While this works well for me, what about using an existing package like is-plain-obj? |
|
That one didn't come in my search for some reason - thanks @flootr. Looking at it, it seems like it's the same functionality we need, and comes with TS bindings, so I'm going to give it a try and close this one for now. |
|
See #65680 for a variant using is-plain-obj. |
Proposed Changes
This PR introduces a new
@automattic/is-plain-objectpackage that is intended to be public, and used both in Calypso and in Gutenberg as a replacement for Lodash'sisPlainObject()function.See WordPress/gutenberg#42471 (comment) for the motivation for this package. Essentially, we're aiming to minimize the creation of new packages as Lodash replacements, but we will still end up having a few of them for the greater good.
Testing Instructions
yarn test-packages packages/is-plain-objectyarn test-client statePre-merge Checklist
Complete applicable items on this checklist before merging into trunk. Inapplicable items can be left unchecked.
Both the PR author and reviewer are responsible for ensuring the checklist is completed.