VR Example (and other community ideas)
Hi Vatro!
Thank you for your incredible work with bringing Svelte into the web graphics forefront! It would be great to see this project gain more traction and I'd love to help out however I can. I understand that things are still very much in development and pie in the sky ideas probably don't help much, so I'll keep it brief:
In my opinion, most people would benefit from additional examples provided by the docs, especially newcomers to Svelte or Three.js, and also help ease migration from other frameworks for experienced users. A-Frame might be the ideal framework to imitate in terms of docs (and some of the API) and I think a VR example would be paramount. If you have any kind of VR capability ready, I'd really love to give it a try.
Also, maybe we could set up a Discord server? I'd be happy to help people with questions as much as I can, which could be the fastest way to a community effort around the project.
Looking forward to hearing from you, Jasper
Hi Jasper,
thanks for your feedback / input, I'm glad you like svelthree! 🙂
documentation: there will be a new basic examples page incl. various starter-templates with the (or right after) svelthree 1.0.0-next.1 release. For people new to Svelte and / or Three.js I would strongly recommend diving into those first. My current focus is on providing decent JSDoc comments / documentation / intellisense.
XR features: see e.g.:
... XR features were removed from the project / basic screen (desktop / mobile) version with the last major refactor, but will be added again in some other form (as an extension / plugin or as a standalone svelthree-xr project). Changing some core concepts of the basic version simply got too messy with all the "xr-stuff" logic being included.
Discord: I am not a big fan of discord-channel-like support, but I don't reject the idea generally. The project is imo currently way too "undone" for it. If at all, then it would make sense at some more mature point in future.
I hope / think a lot of things will develop in a more "open" (more contributors etc.), community-like direction with the project becoming more and more stable.
Cheers, Vatro
That makes sense. The XR side of things is already a bit of a mess in the Three.js API. The demos look great though! If you get a chance to create a fork for them, I could help polish things out.
Is there anything else I could help with in the meanwhile? I wouldn't mind writing some of the docs, but I understand if you'd like to keep things uninvolved for now.
One thing I haven't touched yet, but I feel will become very important soon, are tests. The main reason for this was the heavy prototyping / refactoring svelthree situation, but beside that I have no clue which testing-setup to use and how to use it with all the things involved: three.js, Svelte (being actually svelte-accmod) and svelthree itself 🤯.
Currently, I have a bunch of scenes (pages / routes of a SvelteKit app) which I'm using for prototyping and testing of different features, and while this is okay it isn't automated, means I have to check if each one of those is running as expected interacting with them by myself, which is getting more and more cumbersome as the number of test scenes grows.
Thoughts:
- Newest
create-svelte@nextversions propose Playwright for browser testing... I'm not familiar with it yet, is it cool / how cool is it? How to use it with the svelthree-setup? - We would also need something to test correct rendering / state of scenes, means comparing each pixel of the actual scene-state (image / screenshot) at animation-frame X to corresponding goal scene-state (image / screenshot), kind of "simple" scene-state image comparison.
- ...
I could (will) provide you (to the public) asap my current SvelteKit-test-app-setup (before svelthree 1.0.0-next.1 release) with a simple scene as a good starting point for everything else concerning testing. It would be really cool to make some progress in this area.
There's some eye-catching videos about Playwright on Youtube - I'll be seeing into it, but first impressions are good! Seems to be a Puppeteer-like API with an "expect" constructor, which checks that the page elements are displayed correctly, under specified conditions. Question is though: If Svelthree doesn't use DOM elements, can we bind the tests to custom JavaScript functions? And if we're going to do that, is there really a point in using another framework for testing when we could just run our own tests?
What are the current limitations in automating your tests? I imagine it's hard to ensure the consistency of the visuals and keeping different components working together. In a dynamic system (such as automated testing), each frame is rendered stochastically. So, I don't imagine there's currently any JavaScript tooling available for that. Components however, should trigger a console error if the experiment is a failure. Perhaps we could rig up Puppeteer to run a Svelthree app with procedural configurations and log errors with their specific conditions?
Possibly I'm somewhat misunderstanding your concerns regarding testing, so I look forward to playing with your test repo. Hope you're having a great week