Custom BGA Typescript Template

Game development with Board Game Arena Studio
Post Reply
User avatar
NevinAF
Posts: 1
Joined: 18 March 2024, 21:49

Custom BGA Typescript Template

Post by NevinAF »

I have created a full featured custom Typescript template for BGA development. This template mirrors most of the current typescript documentation and adds a ton of type documentation and features:

- Nearly full typing for all BGA and Dojo components and heavy documentation.
- Detailed yet simple type checking using expandable types for game states, player actions, notifications, and gamedatas.
- (optional) Cookbook recipes for common game mechanics and components, pulled from the BGA documentation and other sources.

Current Typescript Documentation: https://boardgamearena.com/doc/Using_Ty ... t_and_Scss
Custom Typescript Template: https://github.com/NevinAF/bga-ts-template

Typescript offers many benefits over JavaScript, but many benefits are lost when the underlying framework is not typed. Using this new custom template, it becomes extremely difficult to misuse the bga framework and minimizes mistakes from typos. Nearly everything on the BGA studio docs for client side programming is now visible from within your IDE, examples and all. In fact, there are some function parameters included that aren't even shown on the BGA docs. There are over 20,000 lines of documentation and type declarations for BGA and Dojo Framework, all coming from the official documentation or source code. Nonetheless, this template stays true to the generated 'yourgamename.js' file, with nearly identical code when compiled without changes (without comments, both <50 lines).

If you are interested in using this template, there is an in depth README with easy and quick steps to setup in a new or existing project.

Any feedback, changes, and additional information on components are always welcome! There are a handful of BGA framework properties/types that are not well documented and the purpose is unclear, and there may be small mistakes in the typing of the more obscure (maybe undefinable, should be a string literal or number, etc. ).
If you can think of somewhere else that this should be posted for visibility. let me know.
Post Reply

Return to “Developers”