Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Establish style guidelines for what constitutes the public API of a component #1509

Closed
bencalabrese opened this issue Jul 19, 2018 · 1 comment

Comments

@bencalabrese
Copy link

Forked discussion from #930.

What should be considered part of a component's public API? This is important to know for both writers of components (so they're not exposing more than they wish to) and consumers of components (so they're not using pieces of the component that are intended to be internal.

This question arises because the standard Dart convention of making a getter/setter library private often cannot be used in AngularDart because those fields must be public in order to be used in the component's template.

Some possibilities:

  • Non-@Input/@Output public APIs should defined through explicit 'handle' interfaces that the component implements. If they aren't, don't touch them.
  • Anything not marked @visibleForTemplate is fair game.
  • Reading any public data is fine, but mutating pieces of the component is frowned upon unless it's explicitly stated otherwise.
@matanlurey
Copy link
Contributor

We added @visibleForTemplate! Woohoo!

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

No branches or pull requests

2 participants