| commit | e881908c02fc311ad639584506284b16b3cd3f68 | [log] [tgz] |
|---|---|---|
| author | Jacob MacDonald <jakemac@google.com> | Thu Aug 15 11:00:25 2024 -0700 |
| committer | GitHub <noreply@github.com> | Thu Aug 15 11:00:25 2024 -0700 |
| tree | b881262e48d211c5e821549cf9759515abf531de | |
| parent | e55806a8339e45446afa7c341bd3828a8b772710 [diff] |
Allow union types to have additional fields, support required fields. (#43) - Union types can now have additional fields beyond just `type` and `value`. These can be passed to each specialized constructor along with the value. - Adds support for required fields in schemas, which essentially just makes the parameters for these fields in the constructors be required. These are not intended to be widely used, but there are certain things which are truly required. - Uses these features to add a required `id` field to request types, and `requestId` field to response types. - These will be used to support multiple ongoing requests and remove hacks with global variables for cfe/analyzer internals in the future. - Also dropped the special `_dartWrapperToJson` function - afaik this was never necessary (but please let me know if that is wrong). If you would like, I could separate out the support here from adding the actual required fields. ## Risks This makes requests non-hermetic, because of the `id` field. This is always only in the _outer_ request type though. We can still do caching based on the _inner_ request type, which I think should work out fine. Note that having the IDs on the outer types means they are not generally visible to the user APIs which is good.
This repository is home to various macro related Dart packages.
| Package | Description | Version |
|---|---|---|
| _analyzer_macros | Macro support for the analyzer. | |
| _cfe_macros | Macro support for the CFE. | |
| _macro_builder | Builds macros. | |
| _macro_client | Connects user macro code to a macro host. | |
| _macro_host | Hosts macros. | |
| _macro_runner | Runs macros. | |
| _macro_server | Serves a macro_service. | |
| _test_macros | Some test macros. | |
| dart_model | Data model for information about Dart code, queries about Dart code and augmentations to Dart code. Serializable with a versioned JSON schema for use by macros, generators and other tools. | |
| macro | For implementing a macro. | |
| macro_service | Macro communication with the macro host. | |
| generate_dart_model |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
For additional information about contributing, see our contributing page.