-
Notifications
You must be signed in to change notification settings - Fork 1.5k
kill unwrapped_remote #1490
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
kill unwrapped_remote #1490
Conversation
6ad6cb9
to
fa7cedc
Compare
beforePyScriptExec?: { callKwargs: (options: any) => Promise<void> }; | ||
afterPyScriptExec?: { callKwargs: (options: any) => Promise<void> }; | ||
beforePyReplExec?: { callKwargs: (options: any) => Promise<void> }; | ||
afterPyReplExec?: { callKwargs: (options: any) => Promise<void> }; |
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.
Changed callKwargs
to have actual list of args instead....
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 would like to make it so that we can use kwargs
. I'll look into fixing 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.
Changed callKwargs to have actual list of args instead....
good idea @madhur-tandon, it looks also cleaner and easier to read now
I would like to make it so that we can use kwargs. I'll look into fixing it.
yes, this looks like a good idea in general
@@ -63,12 +63,10 @@ class ExecTestLogger(Plugin): | |||
async def beforePyScriptExec(self, interpreter, src, pyScriptTag): | |||
console.log(f'beforePyScriptExec called') | |||
console.log(f'before_src:{src}') | |||
console.log(f'before_id:{pyScriptTag.id}') |
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.
pyScriptTag
is a pyodide.ffi.JsProxy
and I was unable to get the id
.
I have removed this for now...since it wasn't testing something of any significant value I guess...
But of course, if there's a way to resolve this, we should re-add this stuff...
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.
pyScriptTag should be unwrapped as an HtmlElement within Python, and not appear like a JsProxy in this context... I was having similar issues with the event listener work, with some methods/attributes on JsProxies not proxying properly.
We should try to understand why this regression happened, because it means something in the way the JS objects are proxied into Python is broken.
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.
pyScriptTag should be unwrapped as an HtmlElement within Python, and not appear like a JsProxy in this context
I'm confused. pyScriptTag
is a JS object of clas HTMLElement
, isn't it? If so, then it must be a JSProxy, because that's the way in which pyodide passes JS objects into Python.
What am I missing?
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 phrased my response poorly. This is my concern:
pyScriptTag
is apyodide.ffi.JsProxy
and I was unable to get theid
. I have removed this for now...
Accessing the id
attribute here previous worked, and now doesn't. Which means attribute access on JsProxies is broken, in some way we don't understand. Does it need an await
? Is it specific to async contexts? We don't know, but this previously worked and now doesn't.
Specific to this code, does this mean users can't access attributes of the pyScriptTag
at all, and if not, what's the value in passing 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.
LGTM
beforePyScriptExec?: { callKwargs: (options: any) => Promise<void> }; | ||
afterPyScriptExec?: { callKwargs: (options: any) => Promise<void> }; | ||
beforePyReplExec?: { callKwargs: (options: any) => Promise<void> }; | ||
afterPyReplExec?: { callKwargs: (options: any) => Promise<void> }; |
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.
Changed callKwargs to have actual list of args instead....
good idea @madhur-tandon, it looks also cleaner and easier to read now
I would like to make it so that we can use kwargs. I'll look into fixing it.
yes, this looks like a good idea in general
@@ -63,12 +63,10 @@ class ExecTestLogger(Plugin): | |||
async def beforePyScriptExec(self, interpreter, src, pyScriptTag): | |||
console.log(f'beforePyScriptExec called') | |||
console.log(f'before_src:{src}') | |||
console.log(f'before_id:{pyScriptTag.id}') |
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.
pyScriptTag should be unwrapped as an HtmlElement within Python, and not appear like a JsProxy in this context
I'm confused. pyScriptTag
is a JS object of clas HTMLElement
, isn't it? If so, then it must be a JSProxy, because that's the way in which pyodide passes JS objects into Python.
What am I missing?
* kill unwrapped_remote (#1490) * kill unwrapped_remote * linting * don't use callKwargs for python plugins * fix tests and improve types * Bringing PyScript.next PoC to the main project * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Madhur Tandon <20173739+madhur-tandon@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Closes #1384