-
Notifications
You must be signed in to change notification settings - Fork 75
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
Upgrade compiler v0.48 #2029
Merged
Merged
Upgrade compiler v0.48 #2029
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b2bf37f
upgrade the tsp compiler version
MaryGao d6cb382
Update the breakings
MaryGao f7b17e8
Merge remote-tracking branch 'origin/main' into upgrade-compiler-v0.48
MaryGao eafebb6
Fix to pass build errors
MaryGao 77b8a5f
Update the !
MaryGao d94c5fd
Fix the ut issue in rlc
MaryGao f7a65f3
Update the test cases
MaryGao 93d6d06
Update the test cases
MaryGao c0b6f13
update the lib to dev
MaryGao afdb56f
Update the test cases
MaryGao b258ae1
Update the spec
MaryGao 4db33a8
Update the lint
MaryGao 748745b
Disable the polling operation setting due to wrong def
MaryGao d700808
Update .vscode/launch.json
MaryGao 3d4fe46
Update .vscode/launch.json
MaryGao 9beaf7a
Update the error spec
MaryGao bece042
temp
MaryGao cd9ee55
temp
MaryGao 2b4b536
update the test cases
MaryGao 0bd3065
Update the test cases
MaryGao a519249
update changes in openai
MaryGao 35d1d4d
update the statement
MaryGao f8f749f
Update the modular lro
MaryGao d2d7d3f
Update the openapi.json
MaryGao 6d83594
Update .vscode/launch.json
MaryGao a803437
Update packages/typespec-ts/src/modular/buildCodeModel.ts
MaryGao 11fbfdd
update the name
MaryGao 53f4ccc
Update the dependency to dev
MaryGao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iscai-msft @tadelesh Another failed test case is for union of string.
TypeSpec
Old generation after calling
getSdkUnion
Latest generation with
getSdkUnion
After debugging I found the
getSdkUnion
would only return the first enum member to us. Here is the relevant tcgc code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
talked with the dpg crew about this, for sdk union types like this scenario, where the definition is `, we've decided to just emit it as a string. This is because there isn't information about the name of the union, and dotnet and java can't handle this. If they want an enum, they should define it as an enum in the tsp file, instead of us creating an enum from it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting! I think emitting this as a string is not proper for TypeScript because we have native support for string union. And for TypeSpec type
"red" | "blue"
, we may prefer to directly map to TypeScript type"red" | "blue"
like below. But currently we only have the first enum in underlying __raw, it makes us impossible to get all values.On the other hand for other languages they emit as a string but they may have pontential requirement to touch underlying values, e.g using them in descriptions or knownable values etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joheredi Have you been involved in those discussions and are you agree with this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we agreed to have it as a string in tcgc since 3/4 languages are just going to emit it as a string, which conflicts with what JS wants here. For JS though, I should be able to fix the
__raw
to return the original union type and there should be enough information there. Down the line, we might decide that we can toggle this behavior with a flag, but since I think it's very JS specific, I think the best way right now is to have JS get the info they need themselves from the raw typeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version
0.35.0-dev.5
is currently releasing and has this changeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick fix! Not sure we could have a stable patch version for this?