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

Which components are public API? #94

Open
NullVoxPopuli opened this issue Oct 3, 2021 · 4 comments · May be fixed by #119
Open

Which components are public API? #94

NullVoxPopuli opened this issue Oct 3, 2021 · 4 comments · May be fixed by #119

Comments

@NullVoxPopuli
Copy link
Collaborator

Traditionally, all components used must have app-re-exports, but with Ember 3.25+, we can get around that -- and there may be some internal organization benefits to having total control over implementation details if we can ensure that certain components, like, list-box/button is private (in this case, the only intended use is through the yield of the listbox component, which pre-wires up a bunch of stuff -- which maybe we want to restrict what folks can do?)

@NullVoxPopuli
Copy link
Collaborator Author

like, for Switch, we could say that:

Public API:

  • <Switch> + all arguments + all attributes
  • yielded properties; isOn, <Label>, <Button>

but, the following is private API:

  • <Label>'s @guid, onClick
  • <Button>s @guid, @labelGuid, @isOn, @onClick, @onKeyUp

@GavinJoyce
Copy link
Owner

👍 I think it's reasonable that top level components are public and any yielded components are private.

@alexlafroscia
Copy link
Collaborator

alexlafroscia commented Oct 19, 2021

@GavinJoyce that's how I understand it as well!

all components used must have app-re-exports, but with Ember 3.25+, we can get around that

@NullVoxPopuli 🤯 I had no idea that was the case -- do you have a link to more information?

@NullVoxPopuli
Copy link
Collaborator Author

do you have a link to more information?

It's a feature of the VM upgrade in 3.25+ that lets components-as-values be a thing, made a demo: https://github.com/GavinJoyce/ember-headlessui/pull/119/files#diff-268d073b63281f34748203ce9d28f671ae6be574d74ea8d0407154b0d3452924R8

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.

3 participants