You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a case where a service has a "Delete" method. Since the generator will output export const ${localName(method)} = ..., it will output export const delete = ..., which is a reserved keyword in javascript and cannot be used as a variable name in strict mode. This will make typescript compilation fail with no way of ignoring the issue.
While "delete" is the more likely case to happen in this context, all methods named after a reserved word will also generate invalid code as such.
A simple solution could be using PascalCase for the variable declaration, but that would also break any code using this after the upgrade.
What are your thought on this?
In the meantime i'll just automatically patch the file after generation with a sed command.
Thanks a lot by the way, this toolchain is a game changer for us compared to using grpc-web! :)
The text was updated successfully, but these errors were encountered:
I have a case where a service has a "Delete" method. Since the generator will output
export const ${localName(method)} = ...
, it will outputexport const delete = ...
, which is a reserved keyword in javascript and cannot be used as a variable name in strict mode. This will make typescript compilation fail with no way of ignoring the issue.While "delete" is the more likely case to happen in this context, all methods named after a reserved word will also generate invalid code as such.
A simple solution could be using PascalCase for the variable declaration, but that would also break any code using this after the upgrade.
What are your thought on this?
In the meantime i'll just automatically patch the file after generation with a sed command.
Thanks a lot by the way, this toolchain is a game changer for us compared to using grpc-web! :)
The text was updated successfully, but these errors were encountered: