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

fix(natives): Vector3 will generate a tuple type instead of an array … #2439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AleksanderEvensen
Copy link

@AleksanderEvensen AleksanderEvensen commented Mar 27, 2024

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)

image

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

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes. (I won't expect it to generate any errors due to the small change, but I'll leave it uncheck since i haven't tested it)

Fixes issues

N/A

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Mar 27, 2024
@AvarianKnight
Copy link
Contributor

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

@AleksanderEvensen
Copy link
Author

AleksanderEvensen commented Mar 27, 2024

I didn't even think about the compatibility breaking for the types 😅

@thorium-cfx thorium-cfx added the ScRT: JS Issues/PRs related to the JavaScript scripting runtime label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ScRT: JS Issues/PRs related to the JavaScript scripting runtime triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants