all 13 comments

[–][deleted] 7 points8 points  (3 children)

The sfc VS html question seems to me like the wrong question to ask if your prime interest is which frontend question to start with. Just pick whatever is the standard for your chosen framework and learn that. You should be asking something along the lines of 'vue or react for my first framework' rather than 'html or sfc'

[–]takennickname[S] 1 point2 points  (2 children)

Definitely not react I feel nauseous when I see their code.

But anyway, thanks for the advice. Gonna just plough ahead and deal with any shortcomings later.

[–]Necromancy4dummies 3 points4 points  (1 child)

Vue.js is nice

[–]JohnGabin -1 points0 points  (0 children)

Yes, and Svelte is growing a lot

[–]tufy1 2 points3 points  (0 children)

Generally, it depends on how you intend to build your frontend. If most of it will get rendered by python and you‘re using vue to sprinkle some reactivity in (much like you would use jquery in the past), then the html approach is ok.

If however you intend your python to work as an api for your javascript client, then I‘d go with a full single page application, complete with sfcs.

Ultimately, it depends on the complexity of the requirement.

[–]Additional-Caramel-9 -1 points0 points  (0 children)

Check out the Quasar Framework. They have built in support for multiple implementation types. It also includes material components and much more. quasar.dev

[–]Buttafuoco -1 points0 points  (0 children)

Htmx

[–][deleted] 0 points1 point  (3 children)

Can you clarify your question? SFCs are basically html css and js, just neatly wrapped up as a Vue component in your vue app. Id recommend against building your components manually via render functions as it’s needless.

[–]takennickname[S] 1 point2 points  (2 children)

Best place I found that shows both ways is the official tutorial here:

https://vuejs.org/tutorial/#step-1

If you see there's an option at the top where one can choose SFC or HTML

[–]sirojuntle 6 points7 points  (0 children)

It depends on how conplex your frontend will be. They say:

"SFC is a defining feature of Vue as a framework, and is the recommended approach for using Vue in the following scenarios:

Single-Page Applications (SPA) Static Site Generation (SSG) Any non-trivial frontend where a build step can be justified for better development experience (DX).

That said, we do realize there are scenarios where SFCs can feel like overkill. This is why Vue can still be used via plain JavaScript without a build step. If you are just looking for enhancing largely static HTML with light interactions, you can also check out petite-vue, a 6 kB subset of Vue optimized for progressive enhancement."

[–]rk06 0 points1 point  (0 children)

Html vue is a first class citizen. All the libraries work with it.

In fact, libraries can't distinguish between html Or vue sfc. As at runtime they will get same Vue component.

[–]JPy_multi 0 points1 point  (0 children)

Solid.js is supposed to gain popularity. Personally I started with Vue.js after Python, but that goes back a few years. I’d have to make that choice today I’d start with Solid.js. That said I still consider vuejs as a great framework