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

Model class and Datastore annotations should not depend on Mirrors #38

Open
nicolasgarnier opened this issue Feb 18, 2015 · 4 comments
Open
Labels
package:gcloud type-enhancement A request for a change that isn't a bug

Comments

@nicolasgarnier
Copy link
Contributor

Model class and Datastore annotations (like @kind, @StringProperty()...) should be in a separate importable library and not depend on the Mirrors package. It's common practice to have the model classes shared between the Client and the Server when both are written in Dart. Currently an @MirrorUsed() annotation will fix the issue of large generated code size but it would be nicer not to have to use it.

@sethladd
Copy link

cc @eernstg

@eernstg
Copy link
Member

eernstg commented Feb 20, 2015

Seems like the only actual dependency is that model_db_impl.dart needs dart:mirrors. The import of dart:mirrors cannot simply be moved from db.dart to model_db_impl.dart because that file is a 'part' of db.dart, but it looks like the dependency on dart:mirrors could at least be encapsulated by refactoring that file from being a 'part' to a 'library'. In the case of https://github.com/dart-lang/reflectable the transformer will eliminate the dependency on dart:mirrors entirely; but I don't know anything about the details of this package, so I won't make any wild guesses about whether that approach would work here.

@nicolasgarnier
Copy link
Contributor Author

+1 I also think it's just a matter of doing a refactoring and putting the xxxProperty, Kind,IdType, Model and ExpandoModel classes into their own library.

@sigurdm sigurdm added the type-enhancement A request for a change that isn't a bug label Sep 5, 2024
@sigurdm
Copy link
Contributor

sigurdm commented Sep 5, 2024

Maybe when macros land...

@devoncarew devoncarew transferred this issue from dart-archive/gcloud Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:gcloud type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants