Skip to content

feat: add type declarations for lua 5.0#59

Merged
Perryvw merged 7 commits into
TypeScriptToLua:masterfrom
YoRyan:lua5.0
Aug 10, 2022
Merged

feat: add type declarations for lua 5.0#59
Perryvw merged 7 commits into
TypeScriptToLua:masterfrom
YoRyan:lua5.0

Conversation

@YoRyan

@YoRyan YoRyan commented May 5, 2022

Copy link
Copy Markdown
Contributor

Note that Lua 5.0 breaks some of our assumptions about which features are common to all versions - see the deletions in core/. That means the tests also need to be updated.

@Perryvw Perryvw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not in favour of splitting these functions out of the core directory and into 15 different version specific files, this seems like a nightmare to maintain. Please keep the core files as they are and reconsider how to do 5.0 specific stuff.

@YoRyan

YoRyan commented May 13, 2022

Copy link
Copy Markdown
Contributor Author

But the functions I removed from core are simply not available in 5.0, so it doesn't make sense to keep them there. Anything in core must be available to all versions, if I've understood the setup correctly.

You can categorize the new additions into just two domains: "5.0" and "5.1 and above." The only reason I created so many new files was to eliminate as much duplicate code as possible, as is done in the existing declarations. If we were to accept some amount of duplication, that should allow me to simplify things dramatically.

@Perryvw

Perryvw commented May 13, 2022

Copy link
Copy Markdown
Member

But the functions I removed from core are simply not available in 5.0, so it doesn't make sense to keep them there. Anything in core must be available to all versions, if I've understood the setup correctly.

You can categorize the new additions into just two domains: "5.0" and "5.1 and above." The only reason I created so many new files was to eliminate as much duplicate code as possible, as is done in the existing declarations. If we were to accept some amount of duplication, that should allow me to simplify things dramatically.

I am okay with accepting some duplication, splitting into 5.0 and 5.1+ sounds like a good idea. If possible try keeping the current declarations as they are as much as possible.

@YoRyan

YoRyan commented Jul 25, 2022

Copy link
Copy Markdown
Contributor Author

This PR should be ready for review again. How does this look? I've moved the declarations for 5.0 into entirely separate files.

Comment thread core/5.0/debug.d.ts Outdated
Comment thread core/5.0/global.d.ts Outdated
Comment thread core/global.d.ts
@Perryvw Perryvw merged commit b0f29a9 into TypeScriptToLua:master Aug 10, 2022
@YoRyan YoRyan deleted the lua5.0 branch August 10, 2022 18:31
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.

3 participants