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 ints for XAML Enums #36

Merged
merged 3 commits into from Mar 8, 2021
Merged

Use ints for XAML Enums #36

merged 3 commits into from Mar 8, 2021

Conversation

asklar
Copy link
Member

@asklar asklar commented Mar 7, 2021

Fixes #19

Ideally I'd like to use TS const enums but those seem to not work (I get a render error from RN), I think it is because of this TypeScript bug:
Imported const enum is not inlined in generated code

For the time being this saves about 40 kB of binary size (and also runtime perf will be better due to no string->enum->int boxing conversion) so this is overall goodness

@asklar asklar merged commit 9054dcb into main Mar 8, 2021
@asklar asklar deleted the enumConst branch March 8, 2021 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use TS constants for projecting enums instead of strings
1 participant