Skip to content

implement dart:mirrors #27268

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

Closed
vsmenon opened this issue Sep 6, 2016 · 12 comments
Closed

implement dart:mirrors #27268

vsmenon opened this issue Sep 6, 2016 · 12 comments
Labels
customer-google3 type-enhancement A request for a change that isn't a bug web-dev-compiler

Comments

@vsmenon
Copy link
Member

vsmenon commented Sep 6, 2016

From @vsmenon on May 27, 2015 18:28

Implement the dart:mirrors API. We should be able to map this to our dynamic invocation code / metadata.

Copied from original issue: dart-archive/dev_compiler#199

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

The basic parts of this (i.e., the parts used by angular) are landed. This is still missing a lot of features - general method / function mirrors, parameter names, etc.

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

Angular is now using parameter annotations as well (only for constructors).

@vsmenon vsmenon self-assigned this Sep 6, 2016
@vsmenon vsmenon added web-dev-compiler P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug customer-google3 labels Sep 6, 2016
@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

From @jmesserly on July 13, 2015 17:13

Angular is now using parameter annotations as well (only for constructors).

should be easy to implement now, given that we track parameter types?

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

Yeah, we've already got code for class-level annotations too, mainly we just need to decide how we want to encode it.

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

Angular is now using ClassMirror.owner:

https://api.dartlang.org/1.13.0/dart-mirrors/DeclarationMirror/owner.html

This will require us to embed a pointer in classes back to the containing library in generated code.

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

Some more items required for Angular apps in mirrors mode:

  • Implement DeclarationMirror.owner
  • Implement LibraryMirror.uri
  • Instance var / getter / setter / method mirrors
  • Fix ClassMirror.newInstance support factory constructors

All of these will require additional compile-time metadata.

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

From @eernstg on April 20, 2016 8:58

I guess the intended workflow is such that 'reflectable' would not be helpful here, as long as it is running as a pub transformer?

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

Yes, this is just a convenience to run Angular2 apps without transformation.

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

From @srawlins on August 1, 2016 17:47

LibraryMirror.uri is important for some rare cases of unit testing: dart-lang/test#110 requires this to find assets for a test.

@vsmenon
Copy link
Member Author

vsmenon commented Sep 6, 2016

Bumping and taking. We need some of this for testing support.

@vsmenon vsmenon removed the P1 A high priority bug; for example, a single project is unusable or has many test failures label Jan 6, 2017
@vsmenon vsmenon removed their assignment Jun 30, 2017
@matanlurey
Copy link
Contributor

@vsmenon I imagine you can close this?

@jmesserly
Copy link

yup! closing this now that we have deprecation plan: #32294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-google3 type-enhancement A request for a change that isn't a bug web-dev-compiler
Projects
None yet
Development

No branches or pull requests

3 participants