-
Notifications
You must be signed in to change notification settings - Fork 0
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
Live Stream Lambda Output During Execution #406
Conversation
…iling if the user tries to scroll during
return true; | ||
} | ||
|
||
// Otherwise, false. This is not valid output. | ||
return false; | ||
} | ||
|
||
public getRunLambdaReturn(hasValidOutput: string | null | boolean) { |
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.
The name of this parameter is pretty confusing (it sounds like a boolean but it's not always). And it's also probably doing too much (3 different types).
I'd recommend just handing this function the output from this.runResultOutput
and have it pull runResultOutput.returned_data
. Would be a bit less confusing.
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.
Was trying to make it DRY, did as requested: 1cc92bb
Also changed the function to getRunLambdaReturnFieldValue
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.
Awesome to see this come together! The Vue plugin seems like it did a lot of the heavy lifting here -- the rest looks like glue around getting the data into the store + some UX tweaks to make the feature usable.
I'm sure you learned about the Monaco docs being a bit painful. ;)
Nice work on this. Threw a few comments around on a few enhancements/cleanups. Let me know if you have any questions. :)
} | ||
|
||
// Types | ||
export interface RunLambdaState { | ||
isRunningLambda: boolean; | ||
runningLambdaType: runningLambdaType | null; |
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 need to figure out how we can do "many-to-many" relationships in Vue soon. It'd be nice to be able to have "one store per running lambda" or something similar. Would allow the user to run a lambda, grab another block, run that, and then click back to the first block. Seamless experience that currently doesn't exist.
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.
Yeah I thought about that while writing this, but tried not to go too far down a rabbit hole.
// Nothing to do here, Websocket connection has been opened. | ||
}, | ||
[RunLambdaMutators.WebsocketOnClose](state, event) { | ||
console.info('Websocket connection was closed, attempting to reconnect...'); |
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.
Hmmm this is reallllllly weird as a mutator!
But I understand that this is the library... Just weird...
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.
Yeah I didn't like it as a mutator either but it's what the library used for some reason \o/
|
||
onChange?: (s: string) => void; | ||
} | ||
|
||
@Component | ||
export default class MonacoEditor extends Vue implements MonacoEditorProps { | ||
editor?: any; | ||
lastEditorHeight?: number; |
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.
Not actionable feedback on this code and solely an anecdote about this:
I'm not crazy stoked about keeping track of this state in this component, but at the same time I understand why this makes sense to do. Longer term, we'll have to think about how we want to hold state for the editors. Would be nice to have this in the store (especially for debugging). But that's not easy to solve. So I'm fine with this living here for now until we have a better story around how to keep track of Monaco state.
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.
Worth making an issue for maybe?
Addressed all outstanding comments |
Did a port-forward on my router and confirmed this works in the non-ngrok mode. So this should be GTG in production. |
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.
Thanks for making the changes yo :)
# Conflicts: # front-end/src/main.ts # front-end/src/utils/websocket-utils.ts
Hold on to you butts, we're doing it live - landing this now. |
This PR adds the ability to stream the output of Code Block executions in real time as they happen.
Video of the update: https://drive.google.com/file/d/1xzyBIWCDxdtbc45i-tKtfhuhqxOb6zP5/view?usp=sharing
Notes about this feature: