-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[TS][Inverisify] Adding support for RxJS 6 #2793
[TS][Inverisify] Adding support for RxJS 6 #2793
Conversation
import 'rxjs/add/operator/toPromise'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
import { map } from 'rxjs/operators'; |
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.
I think map
should be added to the reserved keywords
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.
I used the standard import of map operator of rxjs as suggested in the documentation.
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.
yes, but if a user defines an api parameter named map
, this clashes, so we should add map
to the list of reserved keywords, similar to this:
Lines 64 to 69 in 50fddc7
reservedWords.addAll(Arrays.asList( | |
// local variable names used in API methods (endpoints) | |
"varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred", | |
"requestOptions", | |
// Typescript reserved words | |
"abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield")); |
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.
I thought you refered to the reserved key keywords of javascript and I could not understand you. Thanks for the example. I added map to reserved keywords.
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.
I've filed #3020 to rename "map" to "GlobalImportOperators" so that map
doesn't need to be a reserved word.
import { Observable } from "rxjs/Observable"; | ||
|
||
{{^useRxJS6}} | ||
import { Observable } from 'rxjs/Observable'; |
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.
i suggest to use double quotes as in the rest of the code
@@ -28,7 +28,12 @@ | |||
"@angular/compiler": "^{{ngVersion}}", | |||
"core-js": "^2.4.0", | |||
"reflect-metadata": "^0.1.3", | |||
"rxjs": "^{{rxjsVersion}}" | |||
{{^useRxJS6}} |
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.
why is this changed? it is not related to typescript-inversify
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.
I added a config's propertyuseRxJS6
to allow the user to decide the using of rxjs6 or rxjs5
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.
here you are modifying the typescript-angular
file
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.
Sorry, I did a big mistake
@macjohnny In the list of api client the |
@gualtierim which list do you mean? you can add it yourself as part of this PR if you find the corresponding file. |
Add typescript-inversify inside README
eeeca91
to
ed34de6
Compare
@gualtierim thanks again for your contribution, which has been included in the v4.0.1 release (https://twitter.com/oas_generator/status/1135534738658062336) |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,. Default:3.4.x
,4.0.x
master
.Description of the PR
Adding support to rxjs6 and patch http method for typescript-inverisify's language