-
Notifications
You must be signed in to change notification settings - Fork 115
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
Weird Type Definition in Browsers.ts #1275
Comments
This is probably one of Quick types annoying type merges... The order that things are generated in affects which name is used. I may be able to work around that way... Alternatively, we really need the If you see these check if they have the right properties. Also, bear in mind that you usually wouldn't import the oddly named type directly, rather just the top level type |
@robmoffat @Lecss @Roaders @Davidhanson90 I took a brief look at this again - the problem is that QuickType won't guarantee the naming of any sub-types it generates, only of the top-level types that we are generating (e.g. FindIntentsRequest, rather than FindIntentsRequestMetadata) and only where they have a unique title. There are some fudges possible that can guide it to a better name but they depend on the order that files are processed in and are fragile. The top-level types are those listed at the top of the BrowserTypes.ts file in the sample import statement/Convert class code. If we wanted to enable stable naming for the subtypes we might have to go as far as fixing quicktype (so the --co-combine-classes parameter actually works) as I think that, even if we change some of the metadata it will still try to combine some of the types where they overlap on 90% of properties. Hence, for now I would stick to trying to use the top-level types only and consider the rest to be an implementation detail you shouldn't interact directly with. Once I get ahead of the FDC3 for Web standard docs PR (no small task) I can try to circle around to quicktype... Note P.S. I've just updated the generated BrowserTypes.ts file after a few corrections. Please pull the new copy and use that and let me know about any unexpected differences. |
P.S. we could/should control what you can import by re-exporting through index.ts as we do for everything else: https://github.com/finos/FDC3/blob/main/src/index.ts I've yet to add exports for BrowserTypes to it... That could be done soon, at which point you'd be able to use |
closing as complete - will revisit in review of FDC3 for the Web PR |
Minor Issue
This is probably not wrong, but kinda weird:
why is meta specified as
AddContextListenerRequestMeta
?The text was updated successfully, but these errors were encountered: