[pg-protocol] patch out the const enum in messages.d.ts#2489
[pg-protocol] patch out the const enum in messages.d.ts#2489forivall wants to merge 2 commits intobrianc:masterfrom
Conversation
| Either one would be fine. If you merge that one, close this one and we're good here! |
| hmmm thinking about this a bit....there's this PR that fixes this by just not making it a |
| A const enum doesn't actually produce any code (except with the preserveConstEnums option, which you don't use); the generated code is equivalent to using string literal. So changing it to string literals may break people's typescript builds, but it won't cause runtime issues. Changing it to a non-const enum is fine, though, it changes the usage from literals to property access on the enum object. as you were mentioning hot path code, you might want to evaluate if that perf would be an issue. |
| Closing as the other solutions seem preferable. |
Alternative fix to #2473
This is the diff it generates to the typedefs: