Svelte Cubed
svelte-cubed.vercel.app
svelte-cubed.vercel.app
I'm sure its nice to have that glue code written for you, (I haven't actually seen it work on any of my devices yet), but I don't really see what this is doing other than making a repo with Svelte and threejs dependencies, writing some svelte components, and making a flashy website. Is this really all you need to do to "create something"?
As a self-taught developer I am always confused what _should_ be my labor or not , especially with web-development. Like, I honestly would assume that I would get laughed off of HN if I ever "made" something like this and passed it off as an accomplishment. But perhaps I am missing something crucial here...
- They're a new developer, and this was a big accomplishment for them that they want to show off
- They've built a few projects this way, identified the repetitive boilerplate code and extracted it into a library
- They built a small app as a way to learn about Svelte and Three.js and want to get others' feedback
- They're excited about Svelte or Three.js and want to show off what it can do (this is what actually happened, since the author is also the creator of Svelte)
- They realize that other developers who aren't familiar with Svelte or Three.js may have trouble starting a project like this, so they wrote the plumbing code to help them
It might seem to you that this code does "what any developer would do", but I assure you it's not. Everyone is different, and things that seem obvious to you may not be to others.
I also want to comment on this:
> Like, I honestly would assume that I would get laughed off of HN if I ever "made" something like this and passed it off as an accomplishment. But perhaps I am missing something crucial here...
To be honest, I think the tone in your comment comes off as dismissive, and comments like this perpetuate the assumption that people have that they'll get laughed off HN if they show something like this. Ultimately the result is fewer people will show off stuff they make. And that sucks! The community should be a welcoming place that fosters others' enthusiasm. If this doesn't interest you, or you think it's too simple, you're always free to not upvote and not read. Obviously, a lot of other people do think this is interesting, because it made the front page.
"Svelte Cubed is a component library for building Three.js scene graphs in Svelte apps. It was built because of reasons X and Y, attempts to solve the W problem and in practice will make doing Z easier thanks to this."
Perhaps a bit like their Getting Started guide, but with the missing reasoning for the project to exist: https://svelte-cubed.vercel.app/docs/getting-started
Similarly, the GitHub doesn't seem to have an extensive README or anything yet, either: https://github.com/rich-harris/svelte-cubed
While having docs of any sort is nice and should be encouraged, at the same time i often find myself wishing that more projects would summarize what they are, why they exist and what problems they solve, much like a lot of software packages do (or should do) in the app stores. Do other people not do that sort of stuff with their Git repos for projects, so that everyone can understand what they're looking at, at a glance?
Here's a few examples from repos that were a part of my Master's degree:
https://git.kronis.dev/rtu1/kvps5_masters_degree_covid_1984/...
https://git.kronis.dev/rtu1/kvps5_masters_degree_astolfo_clo...
(admittedly the repos themselves no longer are relevant, though should serve as an example of what i mean)
There's absolutely nothing wrong with using Three directly, but it's equivalent to using the DOM directly. At some point it gets hard to keep track of hierarchical relationships that aren't expressed as hierarchies, and managing state across your app becomes a burden.
In addition, because components have a managed lifecycle, you get things like hot module reloading 'for free' if you're using a framework like Vite (or SvelteKit, which uses Vite). Once you've tried building scenes this way (e.g. maintaining your camera position while you tweak the properties of an object you've zoomed in on), Cmd-R driven development feels paleolithic.
Really didn't mean any snark at all!
Given the rapid development Svelte has endured over the past 18 months I have no idea whether my solution still works. I'll have to revisit/review/retest it when I get a spare moment.
[1] - https://scrawl-v8.rikweb.org.uk/how-do-i/add-to-a-svelte-pro...
One more thing, software is more than just the code. Documentation is also a critical component of successful and useful software, and the submission does an amazing job of making this approachable and useful through Rich's characteristically clear documentation
There is some cool shit being done, maybe just not on the web.
The web's "upper level of cool" is being able to display a list of text and images without stutter. And it fails even at that.
All the other things that are being desperately bolted on (WASM, WebGL etc.) are just rehashes of everything we already had 20 years ago.
If it doesn‘t actually take a whole lot of code, that seems great.
That’s quite different from “what any developer does to use three.js on their website” which is usually imperative code in a render loop.
That the implementation itself [1] looks pretty vanilla is actually one of Svelte’s selling points! It would look a lot more complex with other frameworks.
[1] https://github.com/Rich-Harris/svelte-cubed/blob/main/src/li...
I think you answered your own question there. There aren't any rules dictating how many lines of code must be written before it counts as "creating something".
btw demos seem to work perfectly on safari 15.1, ff94.0.1 and brave 1.32.106 on macos monterey and on my ancient Note 8 running the android brave 1.32.106
Apparently the underlying code was used for some of the NY Times Covid infographics.
- https://github.com/pmndrs/react-three-fiber
- https://docs.pmnd.rs/react-three-fiber/getting-started/examp...
"Create beautiful, high-performance 3D apps"
While it runs incredibly choppy on my Android in Chrome and the renderer looks both awkward and has artifacts on the shadows.
I can’t defend this, but there is something about working with Svelte that makes me feel like web development has arrived.
Maybe this will feel like a more natural fit.
Is declarative easier to reason about for complex projects, or does it become necessary to go imperative? I can imagine the advantage of imperative is being able to use normal engineering practices, but this isn't something I've thought about before.
Are there examples where a declarative approach was phased out as complexity grew? The only example I can think of is when a company I worked for tried to use Flex (declarative Flash), which we later converted into pure ActionScript for larger projects.
> Uncaught TypeError: Failed to execute 'shaderSource' on 'WebGL2RenderingContext': parameter 1 is not of type 'WebGLShader'.
A proper restart fixed it. Happened after installing some system updates, so if you’re on a Ubuntu (or downstream) distro maybe give that a shot. I think something just got left in a bad state post-update.
I've used Svelte and Three.js recently for several data visualizations and the DX is very good. Shamelss plug: https://cybernetic.dev/ (HN warning: uses crypto data).
I think Rich will solve the current problems promptly now that he is working full time on Svelte at Vercel.
"no camera set" too, FF 94 Linux. May be the linux part and the 3D/drivers mess/therefore lag of support for these things in linux that's to blame.
Also fails the same way with Chromium 91 Linux.
Svelthree - Svelte powered three.js development https://svelthree.dev/
Do these two projects cover the same scope?
I don’t use the latest flagship, but I’m usually on one from ~3 years earlier; there are many people with far less capable devices than mine. So it seems like it’s doomed to stay niche for a few more generations yet.
My laptop's Chrome doesn't complain either.
Looks cool! I'd wait for a little bit until the author declares it safe for general consumption, but it does look like something I'd use.
It's mostly down to the browser and OS, and a function of screen resolution and GPU 'power', rather than anything to do with the framework or JS aspects.
1: https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2
Edit: The home page animation works fine (30+ FPS), but the ones listed under the actual Examples tab are blank white pages
more and more, websites seem to care only about Chrome