Yatharth K
JavaScript Engineer
Classical Pianist
GitHub: yatharthk
Twitter: yatharthkhatri
I'm NOT going to present BIASED thoughts
"A progressive JavaScript framework"
⏺️ Framework (Not library)
⏺️ Incrementally adoptable
⏺️ Highly Performant
State
Functional
☑️
☑️
Rendering
Vue templates
☑️
☑️
render methods w/ JSX
render methods w/ JSX
Type
Not reactive
Props
Reactive
☑️
☑️
State
helper methods
☑️
☑️
computed
❌
props
props
☑️
data
☑️
state
methods
class methods
watchers
❌
Creation of Instance
Mount
❌
beforeCreate, createdbeforeMount, mountedcomponentWillMount,
componentDidMountUpdate
beforeUpdate, updatedcomponentWillUpdate,
componentDidUpdateUnmount
beforeDestroy,
destroyedcomponentWillUnmount,
componentDidUnmountshould update ?
shouldComponentUpdate❌
<section>
<h2>Welcome to MyApp</h2>
<p>Hi, {name}</p>
</section><section> // diff
<h2>Welcome to MyApp</h2> // diff
<p>Hi, {name}</p> // diff & update
</section> JSX
Consider this JSX node in component
Consider that `name` is updated
<section> // static
<h2>Welcome to MyApp</h2> // static
<p>Hi, {name}</p> // dynamic, will need diff
</section> At the time of template compilation in Vue
<section> // static
<h2>Welcome to MyApp</h2> // static
<p>Hi, {name}</p> // dynamic, will need diff
</section> Consider component state -
{ address, name }<section> // static
<h2>Welcome to MyApp</h2> // static
<p>Hi, {name}</p> // dynamic, diff, update
</section> When `name` is updated
<section> // static, no-diff
<h2>Welcome to MyApp</h2> // static, no-diff
<p>Hi, {name}</p> // not related, no-diff
</section> When `address` is updated
Context
Lazy
☑️
☑️
Hooks, Suspense,..
❌
☑️
Global instance can be supplied with plugins
( Well, a React concept )
☑️
❌
( Again, a React thing )
directives
mixins
keyCodes
errorHandler
warnHandler
render
errorRender
extend
nextTick
observable
component
filter
compile
computed
watch
version
methods
errorCaptured
el
errorRender
$watch
parent$emit
inject
v-on
transition-group
slot
transition
...to be continued
Official docs
Effort
🏋️♂️🏋️♂️🏋️♂️1/2
🏋️♂️🏋️♂️🏋️♂️🏋️♂️🏋️♂️
Initial Setup
⭐⭐⭐⭐⭐
Zero. Plug and Play
Initial setup required
⭐⭐⭐1/2
Opinionated
More
Less
(Less decision making)
(More decision making)
Component splits out into template, script and style
Markup, styles and script sticks together
Functional + OOP
Functional
Lifecycle is much straightforward, simple
Lifecycle needs some understanding
Built-in SSR, tree-shaking, etc
DOM manipulation faster
DOM manipulation slower
Lighter. 22kb gzip.
(33kb gzip w/ compiler)
Heavier. 36kb gzip.
Built-in SSR, tree-shaking, etc
React Native
Via Nativescript
(, Weex, Quasar)
♥️
💔
Don't compare. Just watch for your needs and trade-offs. And decide what suits you best.
</TALK>
I'm still a React fan. And now a Vue fan, too.
Learn Vue.
And TypeScript! 🤭
😇