ItsJonQ / g2

✨ An experimental reimagining of WordPress components
http://g2-components.com/
MIT License
105 stars 12 forks source link

Utils: Update dependencies + lodash usage #186

Closed ItsJonQ closed 3 years ago

ItsJonQ commented 3 years ago

This update refactors the utils package to improve the shared dependencies with WordPress + Gutenberg.

Resolves https://github.com/ItsJonQ/g2/issues/184

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/itsjonq/g2/dt41gu9el
✅ Preview: https://g2-git-update-utils-deps.itsjonq.vercel.app

ItsJonQ commented 3 years ago

Hmm! Looks like there's some typescript build issues with importing the individual type checking utils from lodash:

import {
  isArray,
  isBoolean,
  ...
} from 'lodash'

Refactored to do this:

import * as _ from 'lodash';

const {
    isArray,
    isBoolean,
        ....
} = _

I'm not sure it makes a difference (treeshake/dead-code elimination wise). The TS builder seems to be happy though.

(cc'ing @saramarcondes for heads up)