DEV Community

Vue without View - An Introduction to Renderless Components

YCM Jason on June 22, 2019

Components get harder to maintain as they grow larger. Sometimes it is not obvious how to split a bloated component into smaller components. Th...
Collapse
 
anduser96 profile image
Andrei Gatej

Interesting approach!

As far as I know, one way to optimize your Vue app is to use functional components. This kind of components are instanceless and stateless, which means you have a different way to handle props. There are no lifecycle hooks, no methods, no computed properties etc..

I personally use functional components when I only want to display data. There might be some other use cases as well.

Thanks for sharing!

Collapse
 
mannil profile image
Alexander Lichter

Totally right! But to experiecne the difference you need a lot of these components.

More info: slides.com/akryum/vueconfus-2019#/3 - Demo at vue-9-perf-secrets.netlify.com/ben... (all credits to @akryum )

PS: In Vue 3, the performance for functional components will be "marginally better" compared to normal components

Collapse
 
anduser96 profile image
Andrei Gatej

Thanks for referring to some great resources!

Speaking of which, what do you think of Vue 3?

Collapse
 
bertw profile image
Bert

I dont know man, you basically introduce a HTML element to relocate your interval logic, while a mixin will probably suffice.

Collapse
 
sammerro profile image
Michał Kowalski • Edited

It is not an html element. It does not get rendered.