Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of CommonJS dependencies #523

Open
manuelwedler opened this issue Jul 17, 2020 · 1 comment
Open

Get rid of CommonJS dependencies #523

manuelwedler opened this issue Jul 17, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@manuelwedler
Copy link
Contributor

manuelwedler commented Jul 17, 2020

Since Angular version 10 the Angular cli warns about used CommonJS dependencies, because they can cause larger bundle sizes. See https://angular.io/guide/build#configuring-commonjs-dependencies for reference.

The cli warnings are currently suppressed by the allowedCommonJsDependencies option:

webui/angular.json

Lines 29 to 50 in e091b8a

"allowedCommonJsDependencies": [
"bignumber.js",
"qrcode",
"ajv",
"web3",
"web3-utils",
"web3-core",
"web3-core-helpers",
"web3-core-requestmanager",
"web3-eth-personal",
"web3-net",
"web3-eth",
"web3-bzz",
"web3-shh",
"web3-providers-http",
"web3-providers-ws",
"web3-providers-ipc",
"randombytes",
"underscore",
"ethjs-unit",
"elliptic"
]

We should try to only use ECMAScript modules in the future. Some dependencies like web3 are already working on providing an ES module.

@manuelwedler manuelwedler added the enhancement New feature or request label Jul 17, 2020
@manuelwedler manuelwedler added this to the Product Backlog milestone Jul 17, 2020
@manuelwedler
Copy link
Contributor Author

Using import { BigNumber } from 'bignumber.js/bignumber'; should fix it for bignumber.js, see MikeMcl/bignumber.js#278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant