Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: rest client worker for aries JS #1321

Merged

Conversation

sudeshrshetty
Copy link
Contributor

@sudeshrshetty sudeshrshetty commented Feb 22, 2020

  • Switching JS source from ../dist/web to ../dist/rest will make
    aries js worker to run in rest agent client mode.
  • Web worker will be using agent rest client endpoints instead of
    aries wasm command handlers.
  • Except worker javascript, all the other functionalities and interfaces
    will remain same.
  • added switch (to REST/WASM worker) feature in presentation html for
    demonstration/testing.
  • closes Aries JS Worker : REST client based web worker #1295

//TODO :Currently incoming topics/messages should be looked up in
webhook URL of corresponding REST agent, javascript notifier listening
to webhook URL will be added in future.

Signed-off-by: sudesh.shetty sudesh.shetty@securekey.com


export function loadWorker(pending, notifications, paths) {
const wasmJS = paths.wasmJS
const wasm = paths.wasm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops :) will remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

*/

export function loadWorker(pending, notifications, paths) {
const wasmJS = paths.wasmJS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

entry: path.join(PATHS.srcDir, "aries.js"),
target: 'web',
// enable below option during dev mode to get exact stacktrace during error
devtool: 'inline-source-map',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've left it enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@llorllale llorllale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commens

@@ -37,12 +39,15 @@
"copy-webpack-plugin": "5.1.1",
"file-loader": "5.0.2",
"webpack": "4.41.5",
"webpack-cli": "3.3.10",
"webpack-cli": "^3.3.10",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better leave it exact

"webpack-merge": "4.2.2",
"webpack-shell-plugin": "0.5.0"
},
"engines": {
"node": ">=12.14",
"npm": ">=6.13"
},
"dependencies": {
"axios": "^0.19.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better exact versions

@@ -7,8 +7,9 @@
"scripts": {
"build:node": "webpack --config ./webpack.config.node.js --mode=production",
"build:web": "webpack --config ./webpack.config.web.js --mode=production",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@llorllale @sudeshrshetty I wonder if web and node names should include that they are wasm. (followup).

@troyronda
Copy link
Contributor

troyronda commented Feb 22, 2020

@sudeshrshetty we should add support for WebSocket notifications (#471) and then connect to the WS endpoint for rest notifications.

REST JS Wrapper notification support:
#1323

- Switching JS source from `../dist/web` to `../dist/rest` will make
aries js worker to run in rest agent client mode.
- Web worker will be using agent rest client endpoints instead of
aries wasm command handlers.
- Except worker javascript, all the other functionalities and interfaces
will remain same.
- added switch (to REST/WASM worker) feature in presentation html for
demonstration/testing.

//TODO :Currently incoming topics/messages should be looked up in
webhook URL of corresponding REST agent, javascript notifier listening
to webhook URL will be added in future.

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
@troyronda troyronda merged commit 771e63e into hyperledger-archives:master Feb 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Aries JS Worker : REST client based web worker
3 participants