I know the [PlayCanvas-Sync], but it’s so hard to use…
I don’t know if there is planned support for TS in editor, but feel free to open a feature request in the editor repo about it.
There have been discussions around adding Typescript support but no concrete plans yet.
What issues are you running into? It would be great to know so that we can improve the documentation and feature set of playcanvas-sync.
In the meantime, you can use Typescript locally on your PC and either manually transfer the built file to the Editor manually or use the REST API to update the built JS file as part of your build process: https://developer.playcanvas.com/en/user-manual/api/asset-update/
For me, it’d be nice to have an up to date template on a project that has some TS build + PlayCanvas sync already hooked up. I know there’s a zillion ways to compile your TS, but it’d be nice to just have something ready to go with an opinionated solution and directory structure, where I could start writing some TS.
I found these projects, but it’s hard to know what’s relevant, up to date, or even works with the current version of PlayCanvas:
Yes, we definitely should. We are way overdue on a manual page on setting playcanvas sync for the typical workflows that people tend to use.
Ticket created: https://github.com/playcanvas/developer.playcanvas.com/issues/273
Awesome. And even beyond a manual page, I think having a pretty bare-bones github repo that people could just clone and have it start working right away would be amazing.
Just like a super simple repo with maybe a package.json and a pcconfig.json file in it, a folder with a Hello World script component in TS, and an
npm run watch to automatically build the TS into a bundle and upload it with pcwatch whenever something changes.
Ideally the setup flow would be as simple as:
- Start a new blank project in the playcanvas editor
- Clone this repo and run
- Follow instructions to fill out the pcconfig.example.json in the repo
npm run watch
- Click on a box in the playcanvas editor and attach the HelloWorld script to it
- Hit launch and see the hello world message
- Change the message in the local repo
- Hit refresh and see the new message automagically