[Review] Reduce file size of the Angular typescript client #1469
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.
File reduction is achieved by ignoring all the existing processing of the responses. Very simple construction can be used instead, which is just enough for us.
Example with a diff:
So it's 1 line instead of existing 35.
I know that this may be a breaking change for someone, so this change is done in a way that it is possible to enable / disable the new shorter template using a new flag:
UseAngularResultProcessing
. By default (false
) it's an existing behaviour.Additional thing that happened in this PR is using the same flag to adjust behaviour of the Result Type generated in the Observable. In our codebase it was been generating always as a nullable Observable, which was not true (and more importantly it was just a PITA)
Please let me know your thoughts.
BTW - this PR is similar to the #1248 but in this, a different approach is used.