I recommand Vue to any Javascript beginner that want to add interactivity to their page without having to handle the DOM manipulation themselves.
After that I tried InfernoJS which uses JSX because I needed the performance for a project and now I've turned around on JSX.
Personally I couldn't go back to template based frameworks like Vue or Svelte because they usually put you into this one component per file mindset. I much prefer being able to create micro-components in the same file like say buttons or table rows.
The thing that annoyed the most with JSX was that writing conditionals and loops inline was ugly or a pita. Then I discovered this Babel plugin and I love it:
In pretty much every case, where the README shows the "before transformation" and "after transformation" comparison, the "after" part is what you should be writing to begin with. This feels like adding an extra layer of abstraction just for the purpose of not learning to do some simple things in JavaScript itself.
I would be pretty annoyed if I started working on an existing React project and it had that sprinkled across all the components.
I'm guessing this is mostly a nicety to paper over the fact that 'if' is not an expression in JS, so you have to do things like
var foo;
if (something) {
foo = <SomeComponent.../>;
} else {
foo = <OtherComponent .../>;
}
<Container>
{foo}
</Container>
whereas if JS has if-expressions, you'd just say <Container>
{
if (something) {
<SomeComponent.../>;
} else {
<OtherComponent .../>;
}
}
</Container>
(or similar). From that perspective it seems like a nice little thing to have.Dart also has spread operators and for-expressions to make writing "UI with code" much easier. It's fresh to see how language design choices are being made more by pragmatic ones (for Dart it's the fact that it's primarily being used for Flutter to make UIs) instead of ideological ones (One might claim that "if" should be a pure expression following the tradition from functional languages like ML, but that also has its own set of problems in a language designer's perspective)
https://medium.com/dartlang/making-dart-a-better-language-fo...
(I know absolutely nothing about Dart, but it does sound a bit weird that the expression-ness of an if is contextual. Is there a good underlying reason for the exceptionalism here?)
I think the design really nails it: just enough architecture, tagged template literal rendering, functional DOM tree composition with an optional component system.
I prefer to avoid stateful components in favor of pure rendering functions, as much as possible.
Choo's renderer is based on morphdom, which is interesting because it diffs against the real DOM rather than maintaining a virtual one.
I use monoapp, which is a fork of Choo allowing you to bring your own renderer (such as lit-html).
Although I would eventually recommend learning how to utilize Babel & Webpack yourself because knowing why and how it works is useful.
If it's some other objection to complexity, I'd recommend learning modern web dev using https://mithril.js.org/ which can use JSX, but in documentation the non-JSX form is primary.
I started working on making the JSX docs a little better but got stalled... hopefully I will have some time later this month.
React:
const Welcome = (props) => <h1>Hello, {props.name}</h1>;
ReactDOM.render(<Welcome name="Taylor" />, document.getElementById('react-welcome'));
lit-html: const welcome = (name) => html`<h1>Hello, ${name}</h1>`;
render(welcome('lit-html'), document.getElementById('lit-welcome'));I guess my bigger complaint is that its all 'possible', but not recommended for production, its going to slow down your site in some way, etc. There are always drawbacks to not using the recommended way. Its like eating soup with a spork. Yeah you can do it, but its going to take you a lot longer than with the proper tool.
Theres pages of content that can be sorted and filtered, so I mainly want to use it to dynamically update the elements, with the data coming from ajax calls.
I love the fuck out of Vue.js/NUXT though.