Definitelytyped: [WIP] A-Frame typings

Created on 4 Oct 2016  路  7Comments  路  Source: DefinitelyTyped/DefinitelyTyped

I have started working on TS 2 typings for A-Frame. I figured I should file a ticket to avoid any duplication of work and (potentially) help out anyone looking for A-Frame typings in the meantime. They're a WIP published here https://github.com/devpaul/aframe-typings.

I'm using a testing library ATM to ensure all of my assumptions are correct about A-Frame, especially in regards to optional types, but I'm not really sure how to boil that down to code that might exercise the API without rewriting things outside of the testing framework. Advice is welcome.

Most helpful comment

@devpaul Nice! Thanks for the clarification. We should defintively add the info to the aframe docs so we can point people that want to incorporate some TypeScript goodness.

All 7 comments

@devpaul - Do you feel like these typings are ready to be added to the public definitelytyped repo yet?

@atrauzzi let me reach out to the a-frame people and see where they want me to land these typings. If they're not interested in adding typings I'll release to DT.

Thanks for the interest. While I appreciate Typescript and enforcing types we want to keep tooling to a minimum and avoid transpilation. It increases developer friction, learning curve as well as making a-frame more opinionated. The current schema system is simple and pretty thin and served us well. After working on a-blast, a-saturday or a-painter I did not find the lack of types something that prevented me do what I needed to do. Do people have a different experience? Adding such a big change shoud have a clear ROI considering the added complexity

Just to clarify. I'm happy to see people experimenting with A-FRAME + TS I was just referring about including it by default in the a-frame repo

@dmarcos we're not proposing converting A-Frame to TypeScript. We're just looking to add external typing information. Writing these doesn't require any changes A-Frame's code. We'd essentially add this .d.ts file and (preferably) write some tests against it.

Having types available makes it easier for new people to learn, provides better support to IDE's intellisense and code support, and in general improves the user experience. With good typings users will have all of the interfaces explicitly laid out for them from A-Frame through it's dependencies (e.g. Threejs). Although I'm not an Angular user, typings will also support their environment as well.

@devpaul Nice! Thanks for the clarification. We should defintively add the info to the aframe docs so we can point people that want to incorporate some TypeScript goodness.

WIP: https://github.com/devpaul/DefinitelyTyped/tree/aframe/types/aframe

Need to

  • Update typings to aframe 0.5 APIs
  • add some more code to aframe-tests.ts
  • add some real tests to tests that confirms aframe API works as expected
  • write a readme with information on how to run tests, etc
Was this page helpful?
0 / 5 - 0 ratings