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

Support scoped slots #210

Closed
Gr8Gatsby opened this issue Apr 6, 2018 · 2 comments
Closed

Support scoped slots #210

Gr8Gatsby opened this issue Apr 6, 2018 · 2 comments

Comments

@Gr8Gatsby
Copy link

SOMA#288

Migrated issue

Notes:

UE and polymer supports something called scoped slots, which means a component can pass an inert template as the default slot, and let the component to use that template to produce internal created elements, e.g.:

<x-foo>
    <template>
        <div>
            some text
        </div>
    </template>
</x-foo>

In the example above, x-foo can create as many fragments as desired from the provide template. In raptor it means that the template will be compiled to a function, and that factory function can be invoked from x-foo at any given time.

The problem is the ambiguity of the data that can be used by that fragment, e.g.:

<x-foo>
    <template>
        <div onclick={handleClick}>
            {someName}
        </div>
    </template>
</x-foo>

Who owns the div? who implements handleClick event listener? where is someName coming from?

VUE solves most of this problems by providing an explicit mapping of what the fragment can use via a template tag attributes, which sounds good, but still the ownership of the instances of div is ambiguous when it comes to web component semantics. We need to investigate more. I'm not sure about polymer implementation either.

@nolanlawson nolanlawson changed the title should we support scoped slots? Support scoped slots Aug 8, 2022
@nolanlawson
Copy link
Collaborator

Fixed by #3077

@gr8gitsby
Copy link

Whoohoo!

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

No branches or pull requests

4 participants