Skip to content

Commit

Permalink
Remove crypto polyfill
Browse files Browse the repository at this point in the history
The FtM TS library relies on the Node.js `crypto` module (which isn’t available in browsers) in order to implement [namespace signatures](https://github.com/alephdata/followthemoney/blob/main/js/src/namespace.ts). The `crypto-browserify` polyfill is quite big and there were a few questions around continued maintenance of that project, so it would be good to remove it as an dependency.

I initially planned to update the namespacing implementation in the TS lib with the Web Crypto API which is available Node.js and browsers, but this would require breaking changes to the TS API as the Web Crypto API is async.

However, as far as I can see we do not actually rely on the TS implementation of namespaces in the UI, so we should be able to drop the polyfill without any further changes to the TS lib.
  • Loading branch information
tillprochaska committed Jan 8, 2025
1 parent 1ef1040 commit 7531337
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 363 deletions.
12 changes: 12 additions & 0 deletions ui/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ const svgIcon = (path, selectors) => {
};

module.exports = {
webpack: {
configure: (config) => {
return {
...config,
resolve: {
fallback: {
'crypto': false,
},
},
};
},
},
style: {
sass: {
implementation: sass,
Expand Down
Loading

0 comments on commit 7531337

Please sign in to comment.