wartoshika / wow-declarations

Typescript declarations for the current live World of Warcraft Retail LUA API
MIT License
27 stars 11 forks source link

Consider versioning based on the WoW api version #6

Closed tstirrat closed 4 years ago

tstirrat commented 5 years ago

This is very much a suggestion/topic for discussion only..

Consider exporting this with the wow api version

i.e.

If we are on WoW api 8.2.0 then versions could be 8.2.0.1, 8.2.0.13, etc

wartoshika commented 5 years ago

Good idea. Do you have any idea about the wow classic addon api? its version is currently 1.13.x and is also mostly compatible with the latest api (some functions removed of course).

tstirrat commented 5 years ago

I think tracking the latest api e.g. 8.2.x is fine, and I wonder if we can mark apis which are not available in classic with some tag that will be visible in vscode... I thought perhaps @deprecated.. but that might be too heavy handed...

wartoshika commented 5 years ago

Yes, @deprecated is not a good solution. Since this repository only provides types for World of Warcraft, i thought about introducing custom decorators.

Option 1:

Option 2:

Both options will only inform the developer about compatiblity if intellisence is activated within the IDE and if custom decorators are visible in the tooltip (visual studio code does this for example).

Do you have a third option or some completly different idea?

wartoshika commented 5 years ago

I am also thinking of implementing this decorator in my transpiler to support a selective target (retail or classic). With this feature i am able to tell the user that this function is not supported in classic or retail.

You may also think of something more machine readable :)

martinjlowm commented 5 years ago

Alternatively, inspired by https://github.com/TypeScriptToLua/lua-types, you can serve version specific declarations, sort of like entry points, and pull in whatever is defined in the API for that particular version. For an end-user they would simply refer to @wartoshika/wow-declarations/8.2.0, @wartoshika/wow-declarations/1.13.2 etc.

wartoshika commented 4 years ago

Closing this issue since changes have been applied to the repository. Thanks!