Skip to content
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

Feature parity with Juro's fork #483

Open
JuroOravec opened this issue May 6, 2024 · 1 comment
Open

Feature parity with Juro's fork #483

JuroOravec opened this issue May 6, 2024 · 1 comment

Comments

@JuroOravec
Copy link
Collaborator

JuroOravec commented May 6, 2024

Here I'm documenting ther remaining features/changes that I made in my fork that I'd want to eventually discuss.

Feature name Description Resolved
Fallthrough attributes Allow to pass ad hoc key-value pairs to components as "attributes" to enable component users to configure styling and event handling. See Vue's flalthrough attributes. [X]
(added in v0.74)
HTML attribute formatting One thing is passing ad hoc attributes to components, but other is formatting them as HTML attributes. E.g. see how django-web-components does it. [X]
(added in v0.74)
Global rendering context Allow to specify a dict of values that should be automatically made available inside all components in given rendering run. Similar to Vue's inject/provide or React's Context/Provide [X]
(added in v0.80)
Inlined component render Allow to render a component like a function, passing in the same args and kwargs as the get_context_data accepts. E.g. content = MyComponent.render_from_input(args, kwargs) [ ]
Typed component inputs When I render template with django.shortcuts.render("mytemplate.html", data), there's not typing support for what should be the fields of data. Likewise, if the "Inlined component render" was implemented, the args, kwargs would likely not be typed either. Ideally, there'd be a way to define the typing of the component input, so I get a Mypy error if I pass invalid field/type.

NOTE: We will see once we get to it, but in my experience it was easier to add typing to component inputs after enforcing that components could have ONLY kwargs instead of args + kwargs.
[ ]
@EmilStenstrom
Copy link
Owner

For the Global rendering context, maybe we could take some hints from Django's RequestContext? https://docs.djangoproject.com/en/5.0/ref/templates/api/#using-requestcontext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants