Skip to content

Commit d3f8124

Browse files
author
Jakub Ner
committed
Include web3.js in ledgers.js despite size.
We'll wait for web3.js to get their size down.
1 parent 3f0c3c1 commit d3f8124

File tree

9 files changed

+538
-485
lines changed

9 files changed

+538
-485
lines changed

.babelrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
22
"presets": [
3-
"@babel/preset-env"
3+
["@babel/preset-env", {
4+
"useBuiltIns": false
5+
}]
46
],
57
"plugins": [
6-
"@babel/plugin-proposal-class-properties"
8+
"@babel/plugin-proposal-class-properties",
9+
["@babel/plugin-transform-runtime", {
10+
"regenerator": true
11+
}]
712
]
813
}

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ This *ledgers.js* library is client-side and abstracts ledgers (see figure above
7272

7373
### Distributable
7474

75+
> **⚠ Why is it so big?**
76+
>
77+
> We depend on [web3.js](https://github.com/ethereum/web3.js/) which has bloat issues:
78+
>
79+
> https://github.com/ChainSafe/web3.js/issues/1178
80+
>
81+
> As soon as that gets resolved, this distro will be smaller.
82+
7583
The *ledgers.js* library ['dist' folder](https://github.com/overhide/ledgers.js/blob/master/dist) contains the distributable artifact.
7684

7785
You'll likely want to [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) the library along with its dependencies ([web3.js](https://github.com/ethereum/web3.js/)).
@@ -105,13 +113,9 @@ You can include *ledgers.js* via CDN:
105113

106114
For a specific version, e.g. version *2.1.4*: `https://cdn.jsdelivr.net/npm/ledgers.js@2.1.4/dist/ledgers.min.js`
107115

108-
> The library depends on [web3.js](https://github.com/ethereum/web3.js/), as such you must include the dependency (see first line in example below).
109-
110116
The library can be loaded straight into your HTML and accessed by its `oh$` property in the globals:
111117

112118
```
113-
<script src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.3.4/web3.min.js" integrity="sha512-TTGImODeszogiro9DUvleC9NJVnxO6M0+69nbM3YE9SYcVe4wZp2XYpELtcikuFZO9vjXNPyeoHAhS5DHzX1ZQ==" crossorigin="anonymous"></script>
114-
115119
<script src="`https://cdn.jsdelivr.net/npm/ledgers.js/dist/ledgers.min.js`"></script>
116120
117121
<script>

dist/ledgers.js

Lines changed: 60 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ledgers.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 459 additions & 465 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ledgers.js",
3-
"version": "4.4.6",
3+
"version": "4.5.0",
44
"description": "JavaScript library for ledger-based authorizations :: abstracting different ledgers to be used in an application's authentication and authorization workflows.",
55
"engines": {
66
"node": ">=10.13.0"
@@ -24,11 +24,12 @@
2424
},
2525
"homepage": "https://github.com/overhide/ledgers.js#readme",
2626
"dependencies": {
27-
"web3": "1.3.4"
27+
"web3": "1.3.6"
2828
},
2929
"devDependencies": {
3030
"@babel/core": "^7.13.15",
3131
"@babel/plugin-proposal-class-properties": "^7.13.0",
32+
"@babel/plugin-transform-runtime": "7.14.3",
3233
"@babel/preset-env": "^7.13.15",
3334
"babel-loader": "^8.2.2",
3435
"chai": "4.2.0",

play/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width" />
66
<title>ledgers.js API playground</title>
7-
<script src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.3.4/web3.min.js" integrity="sha512-TTGImODeszogiro9DUvleC9NJVnxO6M0+69nbM3YE9SYcVe4wZp2XYpELtcikuFZO9vjXNPyeoHAhS5DHzX1ZQ==" crossorigin="anonymous"></script>
87
<script type="text/javascript" src="../dist/ledgers.js"></script>
98

109
<!-- ignore below :: code pane / logging pane setup -->

test/html/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
</head>
99

1010
<body>
11-
<script src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.3.4/web3.min.js" integrity="sha512-TTGImODeszogiro9DUvleC9NJVnxO6M0+69nbM3YE9SYcVe4wZp2XYpELtcikuFZO9vjXNPyeoHAhS5DHzX1ZQ==" crossorigin="anonymous"></script>
1211
<script src="../../dist/ledgers.js"></script>
1312
<script src="https://unpkg.com/chai/chai.js"></script>
1413
</body>

webpack.config.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ module.exports = {
1818
plugins: [
1919
new HardSourceWebpackPlugin()
2020
],
21-
externals: {
22-
"web3": {
23-
commonjs: "web3",
24-
commonjs2: "web3",
25-
amd: "web3",
26-
root: "Web3"
27-
}
28-
},
2921
module: {
3022
rules: [
3123
{

0 commit comments

Comments
 (0)