4 ms·
I totally get what you mean. I'm also someone who finds compiling or building unnecessary when running JavaScript in the browser. It feels like we end up studyi
by Farer 2y ago
I totally get what you mean. I'm also someone who finds compiling or building unnecessary when running JavaScript in the browser. It feels like we end up studying and dealing with issues that aren't directly related to actual development.
I really like TypeScript as well. In fact, the back-end of this project is developed with .NET 8.0, and since TypeScript gives off a similar vibe to C#, I genuinely enjoy using it.
I've already made the web front-end open source:
https://github.com/Farer/breathingworld_client_web https://github.com/Farer/breathingworld_client_web
Even though I’m using Vanilla JavaScript for personal preference and to minimize performance issues, I’ve also been concerned about potential challenges when collaborating with others in the future. I’m currently looking for collaborators, but it hasn’t been easy. Honestly, I might be going against the trend, but that’s a possibility I’m aware of.
- wruza 2y agoIf you wanna try ts frontend with no friction, start with Vite, a modern dev and build tool for frontend. It’s mostly zeroconf, everything just works.
- Farer 2y agoOh, I briefly looked over Vite but haven't actually used it yet. This is a good opportunity to seriously take a look at it. Is the final HTML and JavaScript code generated clean and without unnecessary bloat? As always, minimizing the resources that a first-time visitor has to download is one of my main goals as well.
- wruza 2y agoVite minimizes prod builds by default. Generates three bundles, html, js, css. Plus sourcemaps. Can’t tell if any of it can be turned off. As of bloat, it depends on your tsconfig (ts part, not vite). If you set ts up to modern standards (es20xx), it emits code basically verbatim. If you’re gonna support ancient browsers, it will have to emit some es-to-es boilerplate. See tsconfig.json reference for details. Everyone - editor/lsp, tsc, vite, eslint - look into this file. Typescript’s general idea is to just erase types, but they added some es version practicalities cause otherwise that would create a whole “pipeline” yet again for a common use case.
- Farer 2y agoOh, I see. Have you used other frameworks like React or Next.js, Svelt and so on ? If so, do you think Vite has clear advantages compared to those frameworks?
- wruza 2y agoVite is a “bundler”, a dev/build tool. You can vanilla js with it as usual. It takes your index.html and sucks in a whole dependency tree to shake it and either produce a production bundle or run a dev server. Being aware of ts, vue, react, sass, etc out of box is its bonus points. Vite vs React vs Next is crates vs oranges vs boxed oranges. I know react but never touch it. React, vue, svelte are “state management”. I’m using mithril.js with POJOs for my frontends. Vanilla everything gets messy in interactive apps, and I come up with a poor man’s mithril usually, then rewrite for it.
- Farer 2y agoOh, so you're developing a bit differently from the current trends. Interesting. As you mentioned, when developing with vanilla JavaScript, it can become difficult to maintain as more features are added or the service grows. However, if you plan carefully, it’s not necessarily a big issue, though many might find it challenging. Do you have any ongoing projects by any chance? Perhaps a project where you're utilizing Vite and Mithril effectively?
- wruza 2y agoI understand trends, but don’t understand why I’d need them. It’s extra work for nothing. But updating dynamic ui requires thought that aligns with m() ideas for me. That’s it, my whole reasoning. Made numerous projects with m(), inhouse dashboards/forms, crypto/stock trading tools, RC buggy debug interface. Currently a set of crypto-related db views again. Not sure if I want to share the code though. Just read mithril guide if interested, it’s very short. I don’t do anything funny with it. If it clicks, it clicks. If not, ignore it.
- 2y ago