Skip to content
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

Use const enums in typescript since regular enums generate extremely bad code #64486

Merged
merged 1 commit into from
Jan 29, 2022

Conversation

kg
Copy link
Contributor

@kg kg commented Jan 29, 2022

To get good behavior in typescript, your enums need to be 'const enum', otherwise it generates some really gross JS with runtime overhead. I didn't know this (thanks to @pavelsavara for the tip)

@ghost
Copy link

ghost commented Jan 29, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

To get good behavior in typescript, your enums need to be 'const enum', otherwise it generates some really gross JS with runtime overhead. I didn't know this (thanks to @pavelsavara for the tip)

Author: kg
Assignees: -
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: -

@kg kg requested a review from pavelsavara January 29, 2022 03:12
@kg kg merged commit cede333 into dotnet:main Jan 29, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants