Skip to content
Merged
5 changes: 1 addition & 4 deletions requirements/test-env.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
django
selenium

# required due issue with channels:
# https://github.com/django/channels/issues/1639#issuecomment-817994671
twisted<21
twisted
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load static %}
<div id="{{ idom_mount_uuid }}"></div>
<div id="{{ idom_mount_uuid }}" class="{{ class }}"></div>
<script type="module" crossorigin="anonymous">
import { mountViewToElement } from "{% static 'js/django-idom-client.js' %}";
const mountPoint = document.getElementById("{{ idom_mount_uuid }}");
Expand Down
4 changes: 3 additions & 1 deletion src/django_idom/templatetags/idom.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
register = template.Library()


@register.inclusion_tag("idom/view.html")
@register.inclusion_tag("idom/component.html")
def idom_component(_component_id_, **kwargs):
_register_component(_component_id_)

class_ = kwargs.pop("class", "")
json_kwargs = json.dumps(kwargs, separators=(",", ":"))

return {
"class": class_,
"idom_websocket_url": IDOM_WEBSOCKET_URL,
"idom_web_modules_url": IDOM_WEB_MODULES_URL,
"idom_mount_uuid": uuid4().hex,
Expand Down