-
Notifications
You must be signed in to change notification settings - Fork 331
Add declaration provider #9352
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
base: main
Are you sure you want to change the base?
Add declaration provider #9352
Conversation
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
|
Ok this is ready |
The declaration provider is an abstraction that allows for the emitter framework to discover types it needs to emit, storing discovered types in a reactive array. This array is stored in context, allowing emitters to create multiple declarations for the same typespec type in different areas of their output. It also allows for emitter authors to control the logic of "what is a declaration" which is often emitter-specific. For more details, see this gist.
Suffix refkeys have been removed, the concept seemed not very useful since consumers could just provide the actual refkey to use instead (using a suffix approach if they feel like it).
This adopts declaration provider in the TypeScript emitter framework and updates http-client-js to take advantage of it. The changes required in http-client-js are mostly just to use the declaration provider instead of assuming the refkey convention EF used. Also fixed up some things I considered to be bugs (see the test changes).