-
Notifications
You must be signed in to change notification settings - Fork 7
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
make webclient a npm package #123
Conversation
"@types/chai": "^4.3.5", | ||
"@types/dat.gui": "^0.7.10", | ||
"@types/mocha": "^10.0.1", | ||
"@types/three": "^0.152.1", | ||
"@typescript-eslint/eslint-plugin": "^5.60.1", | ||
"@typescript-eslint/parser": "^5.60.1", | ||
"acorn": "^8.8.2", | ||
"babel-loader": "^9.1.2", | ||
"chai": "^4.3.7", |
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.
Should these types and package versions match?
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.
They often get out of sync especially with patch releases. I selected "most current" at this time.
webclient/src/agave.ts
Outdated
} | ||
|
||
isReady(): boolean { | ||
return this.socket.readyState === 1; | ||
return this.socket!.readyState === 1; |
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 and a few other lines have a warning from the linter (Forbidden non-null assertion
). Ideally either change the statement or change the linter rules for the project!
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.
Looks good, added a few minor comments!
console.warn("connection failed. refresh to retry."); | ||
}, 3000); | ||
}; | ||
|
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.
Would you want this code to have a try/catch that tries to reestablish connection before asking the user to refresh?
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.
for now there aren't really any known use cases where this should happen. This is really just some placeholder code (there's a TODO above). I'll simplify it even more.
"name": "agave-webclient", | ||
"version": "1.0.0", | ||
"name": "@aics/agave-webclient", | ||
"version": "1.5.0", |
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.
Is it possible to have this auto-update with new release versions, or does this have to be manually updated?
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.
there's a version bump script (tbump.toml) that goes to all the files that have these version number in them and updates all of them
webclient/src/commandbuffer.ts
Outdated
@@ -105,6 +105,7 @@ export class CommandBuffer { | |||
|
|||
const command = this.prebuffer[i]; | |||
const commandCode = command[0] as string; | |||
//console.log("AGAVE." + commandCode, command.slice(1)); |
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.
Should this be removed?
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.
sure - I'll remove it
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.
Looks good! Left a few notes :)
Final tweaks to publish the webclient as a npm package that other js projects can use. Bring version number in sync with Agave release and python client (all in lockstep).
There may be some more tweaks upcoming, while testing the gh action to ensure that everything publishes correctly.
The main client code includes a change to allow better error handling when failing to connect.