8000 [Worker support] DOM access from the worker · Issue #1379 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

[Worker support] DOM access from the worker #1379

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

Closed
antocuni opened this issue Apr 12, 2023 · 1 comment
Closed

[Worker support] DOM access from the worker #1379

antocuni opened this issue Apr 12, 2023 · 1 comment
Labels
classic Issues only applicable to PyScript versions 2023.05.1 and earlier ("PyScript Classic")

Comments

@antocuni
Copy link
Contributor

This is a follow-up of #1333 (once it's merged).

Currently, you cannot access the DOM from workers, and e.g. js.document is unavailable.
The plan is to use "auto-syncify" synclink to allow transparent access to it.

There are 24 tests which are marked as @skip_worker("FIXME: js.document") which fails because of that. For example:

@skip_worker("FIXME: js.document")
def test_element_value(self):
"""Test the element value"""
self.pyscript_run(
"""
<input id="foo" value="bar">
<py-script>
from pyscript import Element
el = Element("foo")
print(el.value)
</py-script>
"""
)
assert self.console.log.lines[-1] == "bar"
py_terminal = self.page.wait_for_selector("py-terminal")
assert "bar" in py_terminal.inner_text()

This is the full list:

tests/integration/test_py_repl.py
232:    @skip_worker("FIXME: js.document")
233-    def test_hide_previous_error_after_successful_run(self):
--
369:    @skip_worker("FIXME: js.document")
370-    def test_repl_output_display_async(self):
--
410:    @skip_worker("FIXME: js.document")
411-    def test_repl_stdio_dynamic_tags(self):

tests/integration/test_zzz_docs_snippets.py
7:    @skip_worker("FIXME: js.document")
8-    def test_tutorials_py_click(self):
--
69:    @skip_worker("FIXME: js.document")
70-    def test_tutorials_py_config_fetch(self):

tests/integration/test_py_terminal.py
38:    @skip_worker("FIXME: js.document")
39-    def test_two_terminals(self):

tests/integration/test_stdio_handling.py
186:    @skip_worker("FIXME: js.document")
187-    def test_targeted_stdio_dynamic_tags(self):
--
296:    @skip_worker("FIXME: js.document")
297-    def test_stdio_output_attribute_change(self):
--
330:    @skip_worker("FIXME: js.document")
331-    def test_stdio_target_element_id_change(self):

tests/integration/test_splashscreen.py
99:    @skip_worker("FIXME: js.document")
100-    def test_splashscreen_custom_message(self):

tests/integration/test_03_element.py
24:    @skip_worker("FIXME: js.document")
25-    def test_element_value(self):
--
42:    @skip_worker("FIXME: js.document")
43-    def test_element_innerHtml(self):
--
60:    @skip_worker("FIXME: js.document")
61-    def test_element_write_no_append(self):
--
77:    @skip_worker("FIXME: js.document")
78-    def test_element_write_append(self):
--
97:    @skip_worker("FIXME: js.document")
98-    def test_element_clear_div(self):
--
113:    @skip_worker("FIXME: js.document")
114-    def test_element_clear_input(self):
--
129:    @skip_worker("FIXME: js.document")
130-    def test_element_select(self):
--
147:    @skip_worker("FIXME: js.document")
148-    def test_element_clone_no_id(self):
--
165:    @skip_worker("FIXME: js.document")
166-    def test_element_clone_with_id(self):
--
185:    @skip_worker("FIXME: js.document")
186-    def test_element_clone_to_other_element(self):
--
220:    @skip_worker("FIXME: js.document")
221-    def test_element_remove_single_class(self):
--
236:    @skip_worker("FIXME: js.document")
237-    def test_element_remove_multiple_classes(self):
--
252:    @skip_worker("FIXME: js.document")
253-    def test_element_add_single_class(self):
--
269:    @skip_worker("FIXME: js.document")
270-    def test_element_add_multiple_class(self):
@JeffersGlass JeffersGlass added the classic Issues only applicable to PyScript versions 2023.05.1 and earlier ("PyScript Classic") label Sep 15, 2023
@WebReflection
Copy link
Contributor

The DOM access from the Workers is now fully covered ... the PyDom story behind works too, but on Pyodide only (IRRC) so this issue doesn't look relevant anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
classic Issues only applicable to PyScript versions 2023.05.1 and earlier ("PyScript Classic")
Projects
None yet
Development

No branches or pull requests

3 participants
0