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

Refactor accessing of default slot from as var to kwarg #502

Closed
JuroOravec opened this issue May 22, 2024 · 3 comments · Fixed by #504
Closed

Refactor accessing of default slot from as var to kwarg #502

JuroOravec opened this issue May 22, 2024 · 3 comments · Fixed by #504

Comments

@JuroOravec
Copy link
Collaborator

See #495 (comment)

@JuroOravec
Copy link
Collaborator Author

Btw, @EmilStenstrom, what do you think of dropping the .default property when accessing the default slot?

Currently, we assign the slot to a variable with {% fill "xxx" as "alias_name" %}, and then we have to access the default slot via the "default" property as alias_name.default.

Since we already have slot_data directly on the fill tag, which we access as {% fill "xxx" slot_data="abc" %}, then IMO we should also access the default slot directly.

So instead of:

{% fill "xxx" default="orig_slot" %}
	{{ orig_slot.default }}
{% endfill %}

We'd drop the .default, and have only:

{% fill "xxx" default="orig_slot" %}
	{{ orig_slot }}
{% endfill %}

Above, I used the kwarg default="..." as a replacement for the as "..." syntax.

@EmilStenstrom
Copy link
Owner

Using default="orig_slot" looks much better! I think this is a good API.

@JuroOravec
Copy link
Collaborator Author

Wrote an MR for this at #504, @EmilStenstrom would you give it a look?

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

Successfully merging a pull request may close this issue.

2 participants