I've primarily moved over to Django with server rendered content and sprinkles of JavaScript where needed.
For those interested in LiveView-esque functionality in other frameworks , there are some similar projects cropping up:
- Django Reactor https://github.com/edelvalle/reactor
- Laravel Livewire: https://laravel-livewire.com/
- Rails Stimulus Reflex: https://docs.stimulusreflex.com/
- Intercooler.js: https://intercoolerjs.org/
There’s a combination of low level features that combine to make LiveView work effectively.
Here's a great introduction to LiveView:
Nice. We need more of this.
4 year Vue dev here (right after 2.0 release). In Vue 2, you have a bunch of "magic" properties. Your state goes under the "data" key, computed properties go under "computed", methods go under... etc. Then you have the lifecycle hook magic methods: "created()", "destroyed()", etc.
In Vue 3, you have one function -- "setup()". This function returns the stuff you want to use inside of your component. This could be state/reactive data using "reactive()" or "ref()", derived data using "computed()", watchers, plain functions, whatever.
If you need to use lifecycle hooks, then you put an "onMounted(() => {})" or whatever in your "setup()".
The API was stripped down to essentially one initialization method where you set up everything you need.
Though to be fair, these days I write Vue like a weirdo and I use JSX with it.
const App = defineComponent({
setup() {
const state = reactive({ count: 0, msg: "Hello" })
const doubledCount = computed(() => state.count * 2)
const inc = () => count.value++
return () => (
<div onClick={inc}>
<p>{state.count}: {state.doubleCount}</p>
<p>{state.msg}
</div>
)
}
})Do you use Hooks in React? Because in that framework, that actually is replacing the older methods, and if you use Hooks then the Composition API is the same (and better in many ways).
The Options API is still the default and remained pretty much the same.
Why would you think that? To me it sounds like a completely unbased opinion and goes agains everything that I read in the v3 documentation or in numerous discussions.
> Possibly the biggest change is our new Composition API, which is entirely additive- the previous Options API will continue to be supported, as the Composition API is an advanced feature.
https://v3.vuejs.org/guide/migration/introduction.html
The Composition API is the last item in the API reference, the Options API is positioned much more prominently.
https://v3.vuejs.org/api/options-data.html
In the Guide, the Options API has its own section while the Composition API is nested within the "Advanced Guides" section.
After trying to use v3 for a new project and trying out the composition API, I've gone back to React.
With v3, and the composition API, to me, it lost all of its appeal (being simple, easy and complete). Now to me it has the worst of both worlds... it's not as easy anymore, has a lot of gotchas and conceptual overhead.