You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The vision is to allow expert users to retrieve file based metadata and for the regular users to retrieve an easy, self-contained metadata object that exposes all publicly available/accessible properties of the current bundle.
1222
+
1223
+
The main differences in proposed shape #2:
1224
+
- no decorators: external consumer shouldn't be concerned if the class fields are decorated or not. All they need is the information that describes whether the class member is public. With that, instead of collecting decorators, each class member will carry 'isPublic' property to indicate its access.
1225
+
- success: an indication of successful collection. If errors occurred during the metadata collection, then 'success' will be false and diagnostics will be reported.
1226
+
- diagnostics: even though metadata collection is not responsible for validating the syntax, any unexpected failures during the collection should be handled gracefully and surfaced to the user
1227
+
- javascript declarations: file metadata revolves around declarations (both exported and private) - that can be functions, classes, consts, etc. The reason for this is that we don't know the content of the file and cannot make an assumption about its shape, therefore the metadata is collected from declarations.
1228
+
- bundle interface: an interpretation of the bundle shape. It is an object that contains public properties, slots, events or anything that is accessible from the outside of the component/module. The reason for doing so is that individual file metadata doesn't have the notion of other files in the bundle and therefore cannot make assumption about an overall shape. With that, the interface is an additional step that attempts to deduce the shape and provide a union of all public properties.
1229
+
1230
+
### TypeScript
1231
+
1232
+
#### Root Metadata Object
1233
+
```ts
1234
+
interfaceBundleMetadata {
1235
+
success:boolean;
1236
+
version:string;
1237
+
diagnostics:Array<Diagnostic>;
1238
+
entry:string;
1239
+
results: { [name:string]:FileMetadata } // metadata for each source
1240
+
interface:BundleInterface; // public methods, events, css properties, exports, slots.
0 commit comments