Skip to content

web: switch from `crypto` to `SubtleCrypto`

Administrator requested to merge vb/switch-to-sjcl-from-crypto into main

Created by: valerybugakov

Context

It's a preparation for the Webpack 5 upgrade: https://github.com/sourcegraph/sourcegraph/pull/22580.

Webpack 5 removed automatic Node.js polyfills. To avoid adding polyfills to our bundle, we can switch to the client implementation of the SHA-256 algorithm. That's the only case when Node.js polyfill, specifically crypto, is required for our web app.

Changes

  • Switched from crypto to the SubtleCrypto API for SHA-256 algorithm.

Merge request reports

Loading