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

Any plans to generate TypeScript types definitions? #1

Open
CrazyFlasher opened this issue Feb 6, 2022 · 5 comments
Open

Any plans to generate TypeScript types definitions? #1

CrazyFlasher opened this issue Feb 6, 2022 · 5 comments

Comments

@CrazyFlasher
Copy link

I love Feathers since early Starling versions. Using openfl haxe version for some pet-projects.
Currently looking forward to do some frontend stuff with TypeScript and it would be cool if there is a TS version of Feathers (I see, that there is a repo with JS version)

@joshtynjala
Copy link
Member

I would like to create type definitions for TypeScript, which could be used with the JS build, but I need to find a way to generate them automatically. I have not had time to figure that out yet.

@back2dos
Copy link

back2dos commented Feb 9, 2022

There are basically two libs available:

  • https://lib.haxe.org/p/hxtsdgen/ - this will produce definitions.
  • https://lib.haxe.org/p/genes/ - this will generate Haxe modules as ES6 modules and definitions as well. If you go all in with TS/JS tooling, this might be a better fit. You can compile the whole library (without DCE) and then your bundler will do treeshaking and what not.

@joshtynjala
Copy link
Member

I played around a bit with Genes a couple of weeks ago because I wanted to see if I could use dynamic imports to achieve code splitting, but I was having some difficulty getting a basic OpenFL hello world app working. I found that I had to manually adjust one of the JS files generated by Genes because it was putting imports in an invalid location. Even after I manually fixed that, I was having trouble figuring out the startup sequence for Lime/OpenFL when using an ES module context. I think that I was mixing calls to global script context with calls to things in a module context, and I hadn't quite figured out how to stay entirely in the module context. I plan to give it a try again eventually.

Note that I was not trying to use any kind of bundler. I figured that it would be easier to start testing with raw ES modules, and then add a bundler later.

@alamboley
Copy link

Hi Josh, any news on this?

We're considering Feathers UI for a web game, but we're bothered by many external libs. So we thought using TypeScript or even pure JS. OpenFL allows it, but not Feathers right?

@joshtynjala
Copy link
Member

@alamboley There are no TypeScript definitions, but you can use pure JS with the npm package:

https://www.npmjs.com/package/feathersui-openfl

Note that OpenFL on npm hasn't been updated since 8.9.6, so it won't have the latest features and bug fixes. Hopefully, we can get an updated npm OpenFL release in the future. However, there are some issues that need to be resovled first.

@joshtynjala joshtynjala transferred this issue from feathersui/feathersui-openfl Nov 17, 2022
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

No branches or pull requests

4 participants