JSX is the one contribution to my overall development experience over the last few years, I have used JSX / TSX in Vue.js and really preferred it over SFCs for a good long while.
Then I picked up lit-html and saw another more natural way to write templates, but then google kind of merged the project with lit-element. It's okay... But lit-element added a ton of boilerplate on top of the simple templating language I was attracted to, mostly declaratively defined OOP which I will tolerate but not enjoy.
Finally I finished my trip to obscurity with another JSX powered beast, Stencil - a way of writing web components that is so good, for two years, I couldn't bring myself to learn React, and not stand out. Stencil like Svelte is a compiler and scores incredibly well in performance out of the box, 100 performances, yes please! It also manages to do SSR with web components, yeah, no idea how π§ββοΈ, today I'm not going to learn about that.
React is kind of the jQuery of today (in it's popularity and future tech debt hangover), so everyone must know it, which sucks for me because I could pick up React projects which I often do, but am I a React expert? Kinda, sorts, no.. so no CV entry π
But React functional components, they look nice, and all the libraries I personally will never finish in order to get to my end goal, well they already exist In React... So today with great caution, I am going to try and get React on my CV, like everyone else, I'm so mainstream.
useEffect go!
Top comments (7)
The easiest way to render HTML is using HTML. While JSP is uncool now, that is exactly what it is. JSP is HTML with a few dynamic spots in it marked for dynamic content. Don't be fooled by the strawman arguement that using a framework like Angular or React is better than writing your HTML using basic javascript/jquery. Nobody did that. The HTML would come from the server with dynamic content sewn in and the javascript would be used to do some client side manipulation, and generally NOT to add child nodes. So, the real comparison should be the simplicity of simply writing standard HTML tags vs using these frameworks. Guess which one is 100 times simpler?
Good luck! The key of modern React is using custom hooks for the component logic, and leaving the functional components for UI (jn my opinion)
I will have to strip away the React terminology as I'm a newbie, kind of, do you mean the secret of good software engineering in the UI is to keep UI and business logic separate and testable? I couldn't agree more! actually I believe that business logic should be standalone agnostic and portable using something like XState as a framework for modeling business logic, in theory you could model the entire app and test it without a UI. Anyway if I'm going to get good at React I will have to learn the terminology
Fun fact, lit is literally just polymer renamed lmao
github.com/lit/lit/commit/d1fc7828...
You are correct, but this wasn't always the case, kind of, it isn't the lit I talked about anyway.
lit-html
was in the past, the templating engine forlit-element
, the latter being a offshoot of polymer... sigh they must have gone fully polymer, talk about flogging a dead horse π.. anyway the lit-element part is still available, but by this point I had looked into other very similar ahem original engines, I can't remember the names of those but lit must have been pretty damn inspired by them π³βΊοΈπLIT joins Angular for most confusing project management decisions.
There are better ways to make web components here are 3.
Iβve looked at Stencil but havenβt used it. Svelte Iβve done a basic sort of βhello worldβ Progressive Web App demo, itβs quite nice.
Single Filed Chicken is okay but Jombo Sized Xmas is better yep.
Kidding, I like sperate files for context switching and reasoning. I also like that JSX unlike SFC is not tied to the framework it is synonymous with. You can't just simply use .vue files in a. Angular project (for some reason) but you can take knowledge with you around JSX and use it in lots of different places, making entirely new frameworks etc, therefore JSX is a greater contribution to the future of JavaScript.