Skip to content

[native_assets_cli] config.xxxConfig extensibility #1837

Closed
@dcharkes

Description

@dcharkes

Currently config.codeConfig (or renamed to be config.code) returns a CodeConfig object which no longer has access to the underlying JSON.

extension CodeAssetLinkConfig on LinkConfig {
/// Code asset specific configuration.
CodeConfig get codeConfig => CodeConfig(this);

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:

  1. Have all XxxConfig classes have a .json as escape hatch that gives access to the root JSON or nested JSON
  2. Have all .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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions