refactor: change component typing from generics to class attributes (#1138)

This commit is contained in:
Juro Oravec 2025-04-20 22:05:29 +02:00 committed by GitHub
parent 912d8e8074
commit b49002b545
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 2451 additions and 610 deletions

View file

@ -85,10 +85,10 @@ class TestComponentMediaCache:
<div>Template only component</div>
"""
def get_js_data(self):
def get_js_data(self, args, kwargs, slots, context):
return {}
def get_css_data(self):
def get_css_data(self, args, kwargs, slots, context):
return {}
@register("test_media_no_vars")
@ -100,10 +100,10 @@ class TestComponentMediaCache:
js = "console.log('Hello from JS');"
css = ".novars-component { color: blue; }"
def get_js_data(self):
def get_js_data(self, args, kwargs, slots, context):
return {}
def get_css_data(self):
def get_css_data(self, args, kwargs, slots, context):
return {}
class TestMediaAndVarsComponent(Component):
@ -114,10 +114,10 @@ class TestComponentMediaCache:
js = "console.log('Hello from full component');"
css = ".full-component { color: blue; }"
def get_js_data(self):
def get_js_data(self, args, kwargs, slots, context):
return {"message": "Hello"}
def get_css_data(self):
def get_css_data(self, args, kwargs, slots, context):
return {"color": "blue"}
# Register our test cache