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

Improve MirrorsUsed API docs #15656

Closed
kwalrath opened this issue Dec 16, 2013 · 8 comments
Closed

Improve MirrorsUsed API docs #15656

kwalrath opened this issue Dec 16, 2013 · 8 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-mirrors type-documentation A request to add or improve documentation

Comments

@kwalrath
Copy link
Contributor

We should fix the MirrorsUsed API docs ASAP so that people can use @­MirrorsUsed annotations correctly.

Another possibility (for quicker resolution) is explaining MirrorsUsed somewhere (group? blog?) and then linking from the docs to there.

https://api.dartlang.org/dart_mirrors/MirrorsUsed.html

@gbracha
Copy link
Contributor

gbracha commented Dec 16, 2013

FWIW, the issue with MirrorsUsed is not simply documentation. It goes much deeper. We still have not figured out the best (or even a good) model for how to communicate information about reflective usage to the system. MirrorsUsed is a stop-gap. Once we know how it should work, we can document it.

@kwalrath
Copy link
Contributor Author

But... it's what we're telling people to use, for now. Can't we do just a wee bit of doc? The constructor has no description at all, so I have no idea of what "targets" and "metaTargets" mean, e.g.

@rmacnak-google
Copy link
Contributor

Reassign to dart2js land.


Set owner to @floitschG.

@kwalrath
Copy link
Contributor Author

kwalrath commented Jun 4, 2014

@floitschG
Copy link
Contributor

Copied from internal bug-tracker (thanks Chris):

MirrorsUsed has been around for >= 1.5 years, yet its api remains too non-committal to be useful, e.g.
"For now, there is no formal description of what a reflective target is.
Informally, it is a list of things that are expected to have fully functional mirrors."
that's too vague.

here are some docs, just to show the level of specificity that would make it usable,
but please don't just copy this since i made up half of it:

  • the following are acceptable values for targets:
      - a comma-separated string of other strings S, where S represents the set of libraries L
        s.t. the name of L is either S or S followed by a dot followed by something else.
        any amount of whitespace after each comma is allowed.
      - a list of strings, each of which will be interpreted as either a full library name, not a prefix, or a symbol name, like 'String',
        and these can be mixed and matched.
      - a list of type objects.
      you may not mix and match the above types (highly speculative. i totally made that up).
  • override, when used in library L0, must be a list of library names (not prefixes) or the string '*', representing all libraries.
      each library L it represents, except for L0 itself, will have the property that any @­MirrorsUsed in L will be ignored and instead,
      this @­MirrorsUsed will supercede that one... except if both use override, in which case... i have no idea.
  • the definition of "class used as metadata" is... no idea. and so the difference between targets and metaTargets is... no idea.
    if, after applying the above rules, library L0 allows reflecting upon class C, or library L, or symbol S, then
    every method M in L has the property that when M is at the top of the call stack, a reflective call on C or L or S will succeed.
    but it will fail if M calls M' in library L' and L' does not declare the ability to reflect on C or L or S.
    cc @trinarytree.
    Set owner to @herhut-ggl.

@ghost
Copy link

ghost commented May 5, 2015

Added Started label.

@ghost
Copy link

ghost commented May 5, 2015

I improved the dartdoc for MirrorsUsed in

https://codereview.chromium.org/1122983002/

The purpose is not to discuss the design of MirrorsUsed but merely describe the behaviour of the current implementation in dart2js.

Comments here or on the CL most welcome.

@ghost
Copy link

ghost commented May 7, 2015

This has now landed in r45585.


Added Done label.

@kwalrath kwalrath added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-documentation A request to add or improve documentation Priority-Medium library-mirrors labels May 7, 2015
@kwalrath kwalrath assigned ghost May 7, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-mirrors type-documentation A request to add or improve documentation
Projects
None yet
Development

No branches or pull requests

5 participants