Skip to content

Commit

Permalink
Remove all usage of the CryptoJS library
Browse files Browse the repository at this point in the history
We’re no longer making use of this library (in order to reduce bundle
size, given that modern browsers provide all of the necessary crypto
functionality).

Resolves #1239.
  • Loading branch information
lawrence-forooghian committed Jun 6, 2023
1 parent 73c2bf4 commit 74d180a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 55 deletions.
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = function (grunt) {
fragments: 'src/platform/web/fragments',
static: 'build',
dest: 'build',
crypto_js: 'node_modules/crypto-js/src',
tools_compiler: __dirname + '/node_modules/google-closure-compiler/compiler.jar',
};

Expand Down
27 changes: 0 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
},
"devDependencies": {
"@ably/vcdiff-decoder": "1.0.4",
"@types/crypto-js": "^4.0.1",
"@types/node": "^18.0.0",
"@types/request": "^2.48.7",
"@types/ws": "^8.2.0",
Expand All @@ -42,7 +41,6 @@
"chai": "^4.2.0",
"copy-webpack-plugin": "^11.0.0",
"cors": "~2.7",
"crypto-js": "ably-forks/crypto-js#crypto-lite",
"eslint": "^7.13.0",
"eslint-plugin-jsdoc": "^40.0.0",
"eslint-plugin-security": "^1.4.0",
Expand Down
10 changes: 0 additions & 10 deletions src/common/types/crypto-js.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions test/support/browser_file_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ window.__testFiles__.files = {
'browser/lib/util/base64.js': true,
'node_modules/async/lib/async.js': true,
'node_modules/@ably/vcdiff-decoder/dist/vcdiff-decoder.js': true,
'node_modules/crypto-js/build/enc-base64.js': true,
'node_modules/crypto-js/build/enc-utf8.js': true,
'node_modules/crypto-js/build/core.js': true,
'test/common/globals/environment.js': true,
'test/common/globals/named_dependencies.js': true,
'test/common/modules/client_module.js': true,
Expand Down
9 changes: 0 additions & 9 deletions test/web_server
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ server.get('/', function(req, res) {
}
});


/**
* This is a rather hacky workaround since crypto-js base64 depends on node_modules/crypto-js/build/core but will request the file from the root level of the server.
* I'm leaving this here for now in lieu of a more elegant solution as the 'real' solution is to improve the way we use dependencies in these tests.
*/
server.get('/core.js', function (req, res) {
res.redirect('/node_modules/crypto-js/build/core.js');
});

server.use('/node_modules', express.static(__dirname + '/../node_modules'));
server.use('/test', express.static(__dirname));
server.use('/browser', express.static(__dirname + '/../src/web'));
Expand Down
3 changes: 0 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ const browserConfig = {
crypto: false,
},
},
externals: {
'crypto-js': true,
},
optimization: {
minimize: false,
},
Expand Down

0 comments on commit 74d180a

Please sign in to comment.