-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
lang, ts: decamelize idl #912
Conversation
Please do this! I don't think there should be any transformations done when generating the IDL. |
@kevinheavey apart from the merge conflicts, is this ready for review? |
Yes! |
I updated this PR so it no longer has any conflicts but while doing so I realised that there's more work to be done. It's been a while so let me begin by asking if youre still interested in working/have the time to work on this PR? The problem is as follows. The idl generation no longer generates camelCase code. This means that the
I lean towards just having |
Yeah I don't have time to work on this for the next while 😅 but I agree that this option seems better:
|
ok thanks for letting me know Ill finish it then! |
I've written a demo of type level camel casing, but whilst it works perfectly it's horrifically slow; it takes a few seconds to convert one type to camel case. The biggest problem is TypeScripts lack of type level range comparisons, so I have to generate large unicode table types for checks. |
I've improved upon my demo and the performance is much better now. It can now reasonably convert type strings to camel case in real-time. |
Seems like maybe something worth revisiting at some stage. Not sure what the current casing behaviour is like |
Superseded by #2824. |
Summary of changes:
Program
constructor in the TS code so thatthis._idl
still looks like it did before, even though the IDL file no longer has camelization everywhere. Also adds some stuff to make the type checking happy with this new arrangement.The idl.ts changes look like a lot more than they are. It's just going through each property in the IDL and adding 🐫 where needed.
Closes #896