-
Notifications
You must be signed in to change notification settings - Fork 90
Expose IdeConnection and getConsoleTypes to the client #863
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
Conversation
Fixes deephaven#862 Client can now start a session like: ``` const connection = new IdeConnection({ websocketUrl: 'wss://localhost:10000/api' }); const consoleTypes = await connection.getConsoleTypes(); const session = await connection.startSession(consoleTypes[0]); ```
niloc132
left a comment
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.
ConsoleAddress should be explicitly marked as a jstype (though not that instance of the class, let's make a new one for this purpose?), otherwise the compiler can change what names it expects that field to have, and if we were to remove any case where we instantiate it from gwt/java, this code path would stop working entirely.
Also, can you update the examples to use this pattern instead? It seems to make a lot more sense in general to work this way.
And didn't we discuss putting this in IdeClient or some other "worker" level type, rather than making it part of how you connect to the actual ide session? this would make app mode easier, by letting scopes potentially be different.
- Fix up IdeConnection constructor - now it takes two params, one for the URL, then another for connection options - Change up IdeClient to use new connection options - Delete the unused classes ConsoleAddress and JsWorkspaceData - Update some of the examples with new usage. For the examples that have code snippets written in Groovy, I didn't change anything
niloc132
left a comment
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 update got console.html and simple.html, but the index.html lists console.html, table_viewport.html, table_filter.html, table_sort.html (and format, but that doesnt use server). This doesn't include simple, which is too simple to matter for most people, but glad to have that fixed too.
web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnectionOptions.java
Outdated
Show resolved
Hide resolved
web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnection.java
Outdated
Show resolved
Hide resolved
|
I added another ticket for converting the examples from Groovy (#904) |
web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnection.java
Outdated
Show resolved
Hide resolved
web/client-ide/src/main/java/io/deephaven/ide/client/IdeConnectionOptions.java
Show resolved
Hide resolved
Tested with the following code snippets. Ensured the auth token was read/decoded properly when it was passed in.
// Options unset
var c = new dh.IdeConnection('http://localhost:10000')
// Options object set, no auth token set
var options = new dh.IdeConnectionOptions();
var c = new dh.IdeConnection('http://localhost:10000', options);
// Options object set, auth token set
var options = new dh.IdeConnectionOptions();
options.authToken = '1234';
var c = new dh.IdeConnection('http://localhost:10000', options);
// Property map passed in with auth token set
var c = new dh.IdeConnection('http://localhost:10000', { authToken: '1234' });
Fixes deephaven#862 Client can now start a session like: ``` const connection = new IdeConnection( 'http://localhost:10000'); const consoleTypes = await connection.getConsoleTypes(); const session = await connection.startSession(consoleTypes[0]); ``` * Clean up based on Colin's review - Fix up IdeConnection constructor - now it takes two params, one for the URL, then another for connection options - Change up IdeClient to use new connection options - Delete the unused classes ConsoleAddress and JsWorkspaceData - Update some of the examples with new usage. For the examples that have code snippets written in Groovy, I didn't change anything Tested with the following code snippets. Ensured the auth token was read/decoded properly when it was passed in. // Options unset var c = new dh.IdeConnection('http://localhost:10000') // Options object set, no auth token set var options = new dh.IdeConnectionOptions(); var c = new dh.IdeConnection('http://localhost:10000', options); // Options object set, auth token set var options = new dh.IdeConnectionOptions(); options.authToken = '1234'; var c = new dh.IdeConnection('http://localhost:10000', options); // Property map passed in with auth token set var c = new dh.IdeConnection('http://localhost:10000', { authToken: '1234' });
Fixes #862
Client can now start a session like: