Skip to content

Commit 8c02d19

Browse files
committed
Revert "implement script element"
This reverts commit 00fba99.
1 parent 00fba99 commit 8c02d19

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

src/client/packages/idom-client-react/src/components.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export function Element({ model }) {
3434
} else {
3535
return null;
3636
}
37-
} else if (model.tagName == "script") {
38-
return html`<${ScriptElement} script=${model.children[0]} />`;
3937
} else if (model.importSource) {
4038
return html`<${ImportedElement} model=${model} />`;
4139
} else {
@@ -58,12 +56,6 @@ function StandardElement({ model }) {
5856
);
5957
}
6058

61-
function ScriptElement({ script }) {
62-
const el = React.useRef();
63-
React.useEffect(eval(script), [script]);
64-
return null;
65-
}
66-
6759
function ImportedElement({ model }) {
6860
const layoutContext = React.useContext(LayoutContext);
6961

src/idom/html.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
- :func:`template`
151151
"""
152152

153-
from .core.vdom import VdomDict, make_vdom_constructor
153+
from .core.vdom import make_vdom_constructor
154154

155155

156156
# Dcument metadata
@@ -253,22 +253,6 @@
253253
del_ = make_vdom_constructor("del")
254254
ins = make_vdom_constructor("ins")
255255

256-
# Scripting
257-
258-
259-
def script(content: str) -> VdomDict:
260-
"""Create a new `<{script}> <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script>`__ element.
261-
262-
Parameters:
263-
content: The text of the script should evaluate to a function. This function
264-
will be called when the script is initially created or when the content of the
265-
script changes. The function may optionally return a teardown function that is
266-
called when the script element is removed from the tree, or when the script
267-
content changes.
268-
"""
269-
return {"tagName": "script", "children": [content]}
270-
271-
272256
# Table content
273257
caption = make_vdom_constructor("caption")
274258
col = make_vdom_constructor("col")

0 commit comments

Comments
 (0)