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

Implement Luau types #84

Closed
wants to merge 4 commits into from
Closed

Implement Luau types #84

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented May 19, 2022

This PR fully implements Luau types into Promises. I've did quite a lot of testing and it works flawlessly, however I believe just a bit more testing should be done so that the Luau types implementation can be as solidified as possible.

Additional changes:

  • Updated CHANGELOG.md
  • Updated wally.toml file (You just need to publish the package)

@konstantinepapakonstantinou

Thanks, @bubshayz! This is a much needed change.

Full disclosure- I no longer do much work on Roblox but I closely follow the development of Luau. There's a considerable amount of people who are switching back to Luau after switching to Roblox-TS given the immense progress on the language.

I definitely support this PR. Nobody wants to sacrifice their strict type checking to take advantage of asynchronous programming models. I will close #79 once this is merged.

@evaera
Copy link
Owner

evaera commented May 19, 2022

Posted an update on the issue: #79 (comment)

In short, it seems like Luau might not yet have the tools we need to correctly implement type checking into the Promise module.

@ghost
Copy link
Author

ghost commented May 20, 2022

Going to close this PR, at the end, I was able to:

  • Add in type annotations for missing methods.
  • Fix some wrong Luau types.

However, I wasn't able to get rid of the giant type def structure at the start of the code and directly inline the types property due to some limitations of Luau's type checking but also some parts of the lib it self (a lot of prototype and metatable work so refactoring them was a complete headache), so this marks the problem as unsolved.

Additionally, I wasn't able to properly implement generics since Luau doesn't yet support generic constraints yet.

@ghost ghost closed this May 20, 2022
This pull request was closed.
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.

2 participants