I know this is a very general question and there maybe several answer to it. I’ve been playing around with Babylon.js and web development for the last few weeks and and its a really great platform, so far my impression is that:
Babylon.JS playground is mainly for prototyping and trying things to watch at runtime
For developing a more complicated project, whith more than one class in it, I should use an IDE, like visual studio and do the development locally and then check it on a localhost or web.
Please share your preferred workflow.
This question arises from a battle neck I had, when writing code in the playground.
First, writing BABYLON. each time I need a class is redundant, and so I was looking for other workflow, and found this tutorial:
and I think this tutorial is somewhat close to what I need.
but, when looking at the logic, in the src file, I see it is TypeScript, and I know that Babylon.js also works with JavaScript so why use TS files? (I guess this is a more philosophical question).
Yep, it’s all very subjective. Each of us here probably has a different way to deal with developing a large project.
I’ll start from the end -
Oh, once you go TS you never go back :-).
First - Babylon is written in TypeScript. It would be much harder doing everything in vanilla JS. Second - project is structured better (IMO) when you use typescript. A bit of type safety and a little less duck-typing will only do good for a large project. And third - why not? Typescript is a superset of javascript. It is not some random language or different syntax. it is practically the same. With Type Safety and an extra compilation step
About developing a larg(er) project - I agree with you. Though it is practically the same editor as vscode (monaco editor), the playground is not suitable for a large multi-classed project (thou you could put them all in a single file. Not recommended…). This would be my recommendation for a “getting started” project:
Dont know if this adresses your question, but i have had good experiences using npm for package handling and webpack for bundling. (has nothing to do with babylonjs in particular)
Also github offers now to publish stuff using ‘github-pages’. Once set up properly, the app will be built and hosted automatically which is pretty handy.
During development, the app can be bundled and hosted/tested locally as well.