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

ResourceIdentifier.metadata Map and List #55407

Open
Tracked by #55555
dcharkes opened this issue Apr 9, 2024 · 3 comments
Open
Tracked by #55555

ResourceIdentifier.metadata Map and List #55407

dcharkes opened this issue Apr 9, 2024 · 3 comments
Labels
analyzer-pkg-meta Issues related to package:meta area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on

Comments

@dcharkes
Copy link
Contributor

dcharkes commented Apr 9, 2024

Allowed types are bool, int, double, and String.

https://pub.dev/documentation/meta/latest/meta/ResourceIdentifier/metadata.html

For dart-lang/native#1085, we need support for maps. (Which was discussed in https://dart-review.googlesource.com/c/sdk/+/355922, but not yet implemented.)

@lrhn
Copy link
Member

lrhn commented Apr 9, 2024

Consider just allowing any JSON-shaped data. I expect that the maps you need are all string keyed.
(The documentation should probably also say that it allows null.)

How is the data "made available to post-compile steps"?
Do they have access to the source, or to a textual representation of the value?
If is textual, might as well but the bullet and allow full JSON, so people don't have to write it in a string.

@vsmenon vsmenon added analyzer-pkg-meta Issues related to package:meta area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Apr 9, 2024
@scheglov scheglov added the P2 A bug or feature request we're likely to work on label Apr 10, 2024
@dcharkes dcharkes changed the title ResourceIdentifier.metadata Map ResourceIdentifier.metadata Map and List Apr 22, 2024
@dcharkes
Copy link
Contributor Author

JSON-shaped data makes sense. 👍

So we'd exclude support for:

  • Sets
  • Tuples
  • Instance constants
  • Maps with keys other than strings.

We could add support for those if we come up with some kind of encoding scheme, but so far I have not seen any use cases for non-JSON shaped data.

@dcharkes
Copy link
Contributor Author

If we support multiple fields in subtypes of ResourceIdentifier (#55568), then we might not have a need to support maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-pkg-meta Issues related to package:meta area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

5 participants