cancel
Showing results for 
Search instead for 
Did you mean: 

Using Typescript In Horizon Worlds

Shards632
Mentor

You may have come to love using CodeBlocks to create interactivity in your Horizon Worlds, but now there's a new way using Typescript, a programming language already used by millions of developers around the world!

Typescript is a more robustly typed version of Javascript, and has a ton of common language features you may know from other languages like C#, Python, Perl and others. Things like compound data types, classes, function calls, a variety of looping constructs _other_ than 'while', and more!

With this power, though, comes responsibility to use the language wisely. Typescript has a number of 'dark corners' and 'foot guns' that ensnare the unwary new developer. To aid creators, we have put together a "Typescript Conventions and Best Practices" document (linked below), with specific emphasis on Horizon Worlds, to help guide you through using the language in the safest and most productive way.

In this document you will find a minimal set of recommendations we encourage  everyone to adopt, as well as a more 'extended' set of recommendations that are strongly advised. Each recommendation comes with some reasoning and examples of DOs and DON'Ts.

Finally, there is a section at the end with some VSCode plugin recommendations that may make your coding in Typescript more care-free by putting the editor in charge of properly formatting and identifying problematic bits of your code.

If you have any questions about conventions or best practices in typescript follow up to this post with your thoughts!

PDF attached below.

Link to web version: Meta Developers Website Documentation

Upcoming Events:
Office hours - AMA:TypeScript for MHW Tuesday 3/11 at 12:00 PM PT - Register
Build with a Mentor: Laser Pen for Mobile Thursday 3/27 at 5:00 PM PT - Register

March calendar of all Mentor Workshops and Office Hours
1 REPLY 1

PurrKitty
Partner

Thank you! 😊 

PurrKitty