-
Notifications
You must be signed in to change notification settings - Fork 89
Add support for ES6 classes #57
Conversation
You can just throw Node 4,5 and 7 here out on the way for Travis build, also there is still some linting error. |
Greetings from Devcon, you are missed! Already hooked up with @whymarrh. 😄 |
Are you updating And just a reminder that the docs have to be recreated at the end of the process. |
Hey @holgerd77, thanks for the comments. Will look into the docs, but this PR was mostly just to allow for the use of ES6 classes and remove the |
This Otherwise the distribution build probably will not work properly with these static member changes? |
@holgerd Thanks for the heads up. So from what I understand, I believe the solution, in order to preserve the current behavior and allow for |
Not quite, I think Current distribution is done on the Node compatible code and we probably want to keep it that way for the moment. What I was suggesting would be that we keep the I know this is not the super-elegant solution, but this works at least, I can now remember, we had this discussion in the wallet library here ethereumjs/ethereumjs-wallet#65 and there was not an easy obvious fix. If you have got a better idea though I am also open to this, we just have to make sure things work at the end! 😄 |
Ah, ok I think I understand now. Thanks! Will make changes. |
Hi @holgerd77 , Yep, will update this PR soon. Thanks for the heads up. |
7ee3e53
to
7657dc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, will merge for now, thanks! 😄
So if I get this right, there is one follow-up PR to be done, is BaseTrie.js
the only file that still needs an update? When you do the next PR, can you also include rebuild documentation?
Cheers
Holger
index.js
Outdated
checkpointInterface.call(this, this) | ||
static verifyProof (...args) { | ||
return proof.verifyProof(...args) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look equivalent.
node_modules | ||
dist/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to make sense to throw out the dist
directory, cleaner like this.
secure.js | ||
trieNode.js | ||
util.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit this solution is not super-pretty, but since there are also other .js
files in the directory it's probably necessary to be so explicit here. I also double checked again, there seems to be no non-workaround solution in Node to set the import base path for modules (everyone correct me if I am wrong).
"@babel/plugin-proposal-class-properties": "^7.1.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"babel-tape-runner": "^3.0.0", | ||
"babelify": "^10.0.0", | ||
"browserify": "^13.0.0", | ||
"coveralls": "^2.11.6", | ||
"documentation": "^3.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, build changes seems to be ok.
static verifyProof (...args) { | ||
return proof.verifyProof(...args) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
}) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
}) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
constructor (...args) { | ||
super(...args) | ||
secureInterface(this) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
@@ -1,4 +1,4 @@ | |||
const Trie = require('../index.js') | |||
const Trie = require('../src/index.js') | |||
const describe = require('tape') | |||
|
|||
describe('kv stream test', function (tester) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test changes also ok.
One other note: just took some step back and did another look. I have no ideas actually about this whole benchmarking stuff, if this is still working and what's the status there. Maybe you can have a short look on this on next update and - if these are just two paths modifications - do it along (and maybe also add 1-2 lines about usage on the README) - or otherwise open a new issue on this. Thanks! |
Follow-up note (another one): I am still not completely happy with this distribution structure, it's working but not particularly elegant. Optimal would be: build everything to a distribution directory (then probably If you have good ideas on this let me know. |
No description provided.