When debugging the fix in b84770cdec, I
removed the `package-lock.json`, ran `npm install`, then individually
reviewed the fixes to better understand what happened.
I noted a few other differences in the `package-lock.json`, mostly due to
changes in `fsevents` (which internally switched to `bundledDependencies`),
and changes in `@apollographql/apollo-tools`.
I've reviewed these as well, and they all look reasonable, but wanted to put
them in a different commit for later bisecting purposes (hopefully a purpose
I won't have!).
Without this fix to `package-lock.json`, which it's not immediately clear to
me what was wrong (possibly a transitive error) there were type errors
manifesting on the `master` branch.
This TEMPORARILY reverts commit 069110b353,
which was the result of the work done in #1971 by @rkorrelboom.
Unfortunately, we need to put this on ice while we wait for movement on a
package naming conflict. The dialog surrounding this is under way, as
I've explained in the PR:
https://github.com/apollographql/apollo-server/pull/1971#issuecomment-456817749
I'm excited to re-land this in an upcoming version, but there's no reason to
block the 2.4.0 release for it right now.
I will open a new PR with the work from #1971 in due time.
Currently, the only place that we use `lodash` in the entire `apollo-server`
repository is to utilize the `sortBy` function in this signature generation.
Looking at the bundle stats, it appears that lodash represents 7.1% of the
`apollo-server` package. We're a server, so bundle size is generally less
of a concern, but it's still not to be ignored, particularly as we move into
worker environments. More pressingly though, since this package will be
utilized by the `apollo` CLI, we'll be shaving precious download time off
the invocation of `npx apollo` if we can get this down.
By switching to the modular package (but still depending on `@types/lodash`
for _just_ the `ListIteratee` type — which we only need in development — we
should be able to trim 55.4kB minified (19.1kB minified+gzip'd) off the
`apollo-server` build.
cc @trevor-scheer @jbaxleyiii @martijnwalraven
Many of these signature calculation functions are now utilized in tools or
helpers which are not directly related to `apollo-server` functionality,
including various aspects of the `apollo` CLI which live within
`apollo-tooling`.
Currently, because of `apollo`'s dependency on `apollo-engine-reporting` for
this signature, this requires bringing in the entire dependency tree which
`apollo-server-core` relies on since `apollo-engine-reporting` depends on
`apollo-server-core`.
By moving this into this new `apollo-graphql` utility library, we're able to
trim that rather hefty dependency tree and drastically reduce the download
for running, say, `npx apollo`.