4 ms·
Mostly OT, but anyone have any recommendations for getting into "modern" JS? Like, say, hypothetically, for an old hand who last really used JS in anger when j
by TylerE 3y ago
Mostly OT, but anyone have any recommendations for getting into "modern" JS?
Like, say, hypothetically, for an old hand who last really used JS in anger when jQuery was the only game in town.
- wrapperup 3y agoIf you want a job, it's probably going to be React. But for personal projects, I hear Svelte would be up your alley. SolidJS is another nice option if you want to get into JSX templating, and more into something like React hooks that actually makes sense and performs close to vanilla JS. But recently (and maybe you're already familiar), a library called htmx started gaining popularity, which you might like. It doesn't require a build step, npm or node to use it. I'm using it with a Rust-based monolithic website to great success, but you can use it with any backend in any language you like.
- TylerE 3y agoI've toyed with svelte a bit, but honestly it's just a foreign world. Like...how do I make this talk to a database?
- wrapperup 3y agoYeah with these frameworks, you usually need to pair it with a backend that talks to your database. Most of the code you write in these frameworks run on the client (but they employ some server rendering techniques for performance reasons, but generally you treat it like client code) Astro is another one that is server-first, similar to PHP, so maybe you'll like that. It also has integrations with the popular frontend frameworks. And if you don't like any of that, htmx is great!
- tamimio 3y ago>how do I make this talk to a database? With an API, depending on the db too some have ready connectors.
- tamimio 3y ago>I'm using it with a Rust How’s htmx+rust combo so far? Any issues? Pros/cons?
- code_witch_sam 3y agoseems good for low-interactivity sites, especially if everyone is generally looking at the same content. i'd consider it for my company's front-of-site, sales sites, blogs, that sort of thing. i certainly wouldn't write discord, vscode, or even a simple no-code tool with it.
- wrapperup 3y agoI think something like Twitter and Discord could be written in it, but something like Google Maps or VSCode, definitely not. For anything where you need server data rendered, it's perfect. I'm currently writing a website that contains user generated content for a game, kinda like Steam Workshop.
- wrapperup 3y agoMostly great, there is a lack of native Rust frontend tooling outside of Leptos/Dioxus for templated websites, such as static file handling and bundling. Previously, I used vite for this on a templated nodejs website. But I am working on a simple web bundler crate similar to vite to alleviate that (check out the htmx discord!). It's missing the HMR part for assets that can be hot reloaded (it just refreshes your browser), but this will improve things quite a bit for anyone making templated SSR Rust sites. Otherwise, the backend ecosystem is really fantastic in Rust, not much to complain about. Axum is great, and I'm using cornucopia for SQL. Having the type safety is a killer feature.
- artificial 3y agoDo you want to learn a framework or just new JS stuff? https://eloquentjavascript.net/ https://eloquentjavascript.net/ is a great way to get familiar with JS. React has the most traction behind it, although I found Vue easier to pick up. I suggest trying your hand at things and seeing what sticks with you. I've been having a blast with Vercel.
- TylerE 3y agoAll of the above?
- tamimio 3y agoAll frameworks (or libraries like react if someone wants to be specific) are horrendous, was on the same boat as you with jquery/bootstrap pretty much do the job for any UI I needed until I tried the “modern” ones.. but probably svelte or solid+astro would be your best or at least personally being the least cumbersome. That being said, I try now in all my new projects to minimize or eliminate js completely, currently I’m trying to use rust to build the UI for a project I’m doing since the backend and the embedded drivers are also built with Rust, and I’m using egui [1] and so far I love it, Iced is also a good option. [1] https://docs.rs/egui/latest/egui/ https://docs.rs/egui/latest/egui/
- TDiblik 3y agoWant to get a job => learn React Want to have fun => learn Svelte There are a lot of tutorials, but I found following the docs is the most straight forward. If you're interested in frontend/full-stack development state atm, check out "Theo (ping.gg)" on youtube.
- Karawebnetwork 3y agoThey redid React's official documentation and tutorials recently. I find them easy to follow, you should check them out. React is not necessary the "best" one but it's big and popular enough that learning it will give you a head start in all the other ones.