-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(natives): Vector3 will generate a tuple type instead of an array … #2439
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
base: master
Are you sure you want to change the base?
fix(natives): Vector3 will generate a tuple type instead of an array … #2439
Conversation
I think this would be better, though it would generate type errors where there were none before, but also not sure what the opinions on "compatibility breaks" are for types. I think this change is better for the better as it should always return 3 values |
I didn't even think about the compatibility breaking for the types 😅 |
I'm not sure if we can handle this change considering it causes to much compatibility issues. |
Thanks for the explanation. When the array typed function parameter accepts the tuple as well its not really a compatibility issue. |
Goal of this PR
The vector3 type has until now been generated as an array type. In my opinion it should be generated as a tuple type instead.
The reason I think the tuple type is a better option is because it can be used properly with the spread operator in functions that takes in the x, y and z component (ref picture below)
How is this PR achieving the goal
Changing the codegen for dts files to parse the Vector3 type into the tuple type
This PR applies to the following area(s)
Natives
Successfully tested on
Has not been tested due to node-gyp not being able to compile the libclang bindings in native-doc-tooling
Game builds: N/A
Platforms: Windows
Checklist
Fixes issues
N/A