-
Notifications
You must be signed in to change notification settings - Fork 68
[native_assets_cli] config.xxxConfig
extensibility
#1837
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
Comments
This is somewhat by-design. It gets very hairy otherwise: We'd start having protocol extensions on other protocol extensions on other protocol extensions. The simple thing (which we currently have): We have a base protocol. Then we have extensions that use top-level keys in the json. The managing of that namespace is up to the extension and no 3rd parties should meddle with it. (Imagine |
Protocol extensions on protocol extensions would allow And it would allow symmetry of where the Flutter C API is available in the config with where the Dart C API would be available in the config. But yea, it does get rather hairy. (And maybe symmetry between the Dart and Flutter C APIs should be a non-goal The Dart DL API is very different because we provide the function pointers from the VM. So it is available in every embedder where Okay, idea considered, and dismissed. |
Is the I'm not actually sure whether we would want to make the Not sure, but I think it's a separate discussion how to handle |
Currently
config.codeConfig
(or renamed to beconfig.code
) returns aCodeConfig
object which no longer has access to the underlying JSON.native/pkgs/native_assets_cli/lib/src/code_assets/config.dart
Lines 24 to 26 in 9596c1f
This makes it impossible for Flutter to extend the code config (#1836). We should consider fully leaning in to extensibility so that Flutter can introduce a
config.codeConfig.flutterConfig
.Some ideas:
XxxConfig
classes have a.json
as escape hatch that gives access to the root JSON or nested JSON.xxxConfig
return an extension type around the root JSON rather than a class with the syntactically parsed fields.Since we want the JSON format to be extensible, we should make it extensible not only at the root but also in nested keys. And for the Dart code belonging to those extensions to be able to provide extensions to those APIs they need to be able to access the JSON from the API object.
cc @mkustermann
The text was updated successfully, but these errors were encountered: