apollo-server/packages
Ben Newman 3f7a7f3d67
Avoid importing entire crypto dependency tree if not in Node.js. (#2304)
The apollo-server-core package uses Node's built-in crypto module only to
create SHA-256 and -512 hashes.

When we're actually running in Node, the native crypto library is clearly
the best way to create these hashes, not least because we can assume it
will be available without having to bundle it first.

Outside of Node (such as in React Native apps), bundlers tend to fall back
on the crypto-browserify polyfill, which comprises more than a hundred
separate modules. Importing this polyfill at runtime (likely during
application startup) takes precious time and memory, even though almost
all of it is unused.

Since we only need to create SHA hashes, we can import the much smaller
sha.js library in non-Node environments, which happens to be what
crypto-browserify uses for SHA hashing, and is a widely used npm package
in its own right: https://www.npmjs.com/package/sha.js.
2019-02-12 14:07:42 -05:00
..
apollo-cache-control Publish 2019-02-07 14:08:23 +02:00
apollo-datasource Publish 2019-02-07 14:08:23 +02:00
apollo-datasource-rest Publish 2019-02-07 14:08:23 +02:00
apollo-engine-reporting Publish 2019-02-07 14:08:23 +02:00
apollo-engine-reporting-protobuf Publish 2018-12-13 15:29:53 +02:00
apollo-graphql Publish 2019-02-07 14:08:23 +02:00
apollo-server Publish 2019-02-07 14:08:23 +02:00
apollo-server-azure-functions Correct Azure Functions type definitions (#2287) 2019-02-12 18:28:12 +02:00
apollo-server-cache-memcached Publish 2019-02-07 14:08:23 +02:00
apollo-server-cache-redis Publish 2019-02-07 14:08:23 +02:00
apollo-server-caching Publish 2019-02-07 14:08:23 +02:00
apollo-server-cloud-functions Publish 2019-02-07 14:08:23 +02:00
apollo-server-cloudflare Publish 2019-02-07 14:08:23 +02:00
apollo-server-core Avoid importing entire crypto dependency tree if not in Node.js. (#2304) 2019-02-12 14:07:42 -05:00
apollo-server-env Publish 2018-11-07 08:17:21 -08:00
apollo-server-errors Publish 2018-11-07 08:17:21 -08:00
apollo-server-express Publish 2019-02-07 14:08:23 +02:00
apollo-server-hapi Publish 2019-02-07 14:08:23 +02:00
apollo-server-integration-testsuite Publish 2019-02-07 14:08:23 +02:00
apollo-server-koa Publish 2019-02-07 14:08:23 +02:00
apollo-server-lambda Publish 2019-02-07 14:08:23 +02:00
apollo-server-micro Publish 2019-02-07 14:08:23 +02:00
apollo-server-plugin-base Publish 2019-02-07 14:08:23 +02:00
apollo-server-testing Publish 2019-02-07 14:08:23 +02:00
apollo-tracing Publish 2019-02-07 14:08:23 +02:00
graphql-extensions Publish 2019-02-07 14:08:23 +02:00