Closed jalmasi closed 1 month ago
I think we can refacter it to use vite-vue for better web development for the front-end part
That certainly makes sense. Mind design goals: vrspace client should not require any web development framework. Quite the opposite, goal of node package creation is to allow usage with any framework. You know, include it just like any other library, into your (possibly already existing) web site. So we should follow Separation of Concerns principle, like this: web framework takes care of 2D, vrspace/babylon takes care of 3D. These two distinct layers should exchange data through well defined interface. Typically, World and WorldManager classes. Ideally, vrspace/babylon javascript classes should not know or care about html/css, and web framework should not care about babylon. But that's not always possible, and there are grey areas, e.g. the only way to access a video/audio stream is via html tag. In these cases, plain html should be used, so that no dependencies on framework are introduced.
Done a while ago, @vrspace/babylonjs
Point being, of course, make it easier for web developers to use it.
I did manage to create minified package a year ago or so. But since vrspace client isn't exactly stable, we can't lose the ability to peek into the source, so non-minified source files are a must. But I failed due to conflicting requirements, IIRC it was something about use of javascript classes.
Remains of my attempts are in babylon dir, unmaintained since: webpack.config.js and package.json.
At the time and for a while, using babylon.js from CDN seemed like a good idea, thus vrspace cdn, max and min.js in js subdir. But babylon 5 turned to be unstable, so I've fixed babylon version to latest release of 4, 4.2.1, in js/lib dir. This, and three other dependencies - openvidu, pep and perlin - may or may not be already available as node packages.
I think we need at least two packages. First is vrspace-client, with what we have in js/client dir. That one is thin network layer to connect to the server, and doesn't depend on babylon. Could be used for e.g. three.js client. And the other one is built on top of babylon, everything that is in js/ui dir.