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

[native_assets_cli] Use a schema and schema checker for hook config and output #1826

Open
dcharkes opened this issue Dec 18, 2024 · 0 comments
Labels
package:native_assets_cli type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

Comments

@dcharkes
Copy link
Collaborator

We should consider

  1. generating a an implementation for the build/link config and build/link output rather than handwriting it
  2. use some kind of schema spec to generate from and check backwards and forwards compatibility (due to version skew between the Dart SDK and hook helper packages).

The schema evolution checks will validate we don't introduce any syntactic errors.
The validators for different parts of the config / output validate semantic errors.

Since we don't validate syntactic errors, we should not do any breaking changes to syntax (only when we can bump an SDK constraint). For example, nullable fields in the schema should always stay nullable, even if semantically they are guaranteed to not be null under certain conditions. See the discussion on #1824, thanks @mkustermann!

We can introduce a schema definition, a schema evolution checker, and a code generator from that schema. Then we can make the semantic API (the user API) take the syntactic classes as input (rather than the JSON), and ditto for the validator functions.

Related:

@dcharkes dcharkes added type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable package:native_assets_cli labels Dec 18, 2024
@dcharkes dcharkes added this to the Native Assets v1.x milestone Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:native_assets_cli type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable
Projects
None yet
Development

No branches or pull requests

1 participant