-
Notifications
You must be signed in to change notification settings - Fork 65
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
Remote cell #328
Remote cell #328
Conversation
We can define scan_eval_result/2 and react to evaluation error any way we want. @josevalim is it for arbitrary errors, or do you have something specific in mind? |
@jonatanklosko it is about the case where you have invalid Elixir code in the editor. Then
Any other suggestions? Is there a way to attach code comments to the generated code? |
Wait! I think I was a bit vague. 🙈 |
@josevalim perhaps it would be less confusing if we generated code with explicit
|
@jonatanklosko the problem is raising the explicit syntax error that we get. What do you think about generating this:
? |
Sounds good! |
lib/kino/remote_cell.ex
Outdated
node = unquote(String.to_atom(node)) | ||
cookie = unquote(String.to_atom(cookie)) | ||
Node.set_cookie(node, cookie) | ||
Node.connect(node) |
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 think we actually don't need this call. :erpc
connects automatically! Please verify:
Node.connect(node) |
lib/kino/remote_cell.ex
Outdated
node = unquote(String.to_atom(node)) | ||
cookie = unquote(String.to_atom(cookie)) |
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.
Btw, we should allow the cookie to be a secret, but we can move that to a separate issue. :)
lib/kino/remote_cell.ex
Outdated
|
||
def to_source(%{"code" => code} = attrs) do | ||
code = Code.string_to_quoted(code) | ||
to_quoted(attrs, code) |
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.
to_quoted(attrs, code) | |
to_source(attrs, code) |
lib/kino/remote_cell.ex
Outdated
quote do | ||
node = unquote(String.to_atom(node)) | ||
cookie = unquote(String.to_atom(cookie)) | ||
Node.set_cookie(node, cookie) |
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.
Nitpick: should we interpolate the cookie directly here?
Node.set_cookie(node, cookie) | |
Node.set_cookie(node, unquote(String.to_atom(cookie))) |
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 think that if we do it for one, we should do it for both
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 don't think so because node
we repeat (we use it more than once). We don't do so for cookie!
lib/assets/remote_cell/main.js
Outdated
/> | ||
</form> |
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.
/> | |
</form> | |
/> | |
</div> | |
</form> |
Hey @jonatanklosko! @josevalim told me to ask you if there's a better way to give feedback on invalid codes.