3 Key Insights from Vue’s new functional API RFC
Tags: webdev, vue, javascript
Published: 2019-06-27 15:11:55

---
title: 3 Key Insights from Vue’s new functional API RFC
published: true
tags: webdev, vue, javascript
canonical_url: https://zendev.com/2019/06/25/key-insights-from-vue-functional-rfc.html
---

On June 7th, Evan You (creator of Vue.js) posted an [RFC](https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs/0000-function-api.md) on a Hooks-inspired function-based API for a Vue.js. It’s an absolutely fascinating read, and well worth going through.

It also sparked quite a bit of conversation and some backlash. I’m not going to go deeply into the conversation, but from my perspective the Vue team has done a great job listening to feedback and using it to improve the RFC.

The only thing I will say is **I wish those choosing to weigh in were a bit more respectful**. Open source maintainers do a tremendous amount of work for public benefit, and things like RFCs are out there to give you a chance to weigh in and help guide them to what will be most useful. They are _not_ there for you to shit on the work or efforts of those maintainers.

Rampant negativity is pervasive in our community (HN and Reddit both are covered in it), and in my opinion it is harmful. If you find yourself about to make a very negative comment, stop, think about how you can phrase your feedback constructively, and as the old saying goes “if you can’t say something nice don’t say anything at all”. This isn’t to say don’t disagree, but just be respectful of those you are speaking to.

Anyway, back to the RFC.

I think this RFC is worth exploring not just in it’s own sake, but also because it reveals 3 key insights about what the future of front-end development looks like.

## 1. The future of reusable state management is composable functions

The trend towards component-oriented development has been phenomenal for productivity in the front-end world by allowing seamless composition of independently developed pieces. This has allowed us to create reusable building blocks that we can plug in as needed throughout our applications.

However, efforts to apply this approach to state management have been awkward and verbose. Tools like Higher Order Components (HOCS) introduce extreme levels of nesting complexity while mixins are hard to compose, can have cause namespace clashes, and are opaque when trying to understand where properties are coming from.

React Hooks introduced a new approach that dramatically improved the composability of stateful logic using functions, and this RFC looks like it may take it even further as it manages to remove some of the more unintuitive challenges in hooks (like call order sensitivity and not being able to use them inside a conditional).

## 2. Types are ever more central to how frameworks are designed

One of the motivating factors highlighted in the proposal and present throughout much of the discussion is that a function-based API makes type checking and type inference far simpler than other approaches.

A [2019 survey by npm](https://javascriptsurvey.com/) found a whopping 62% of npm users (which lets face it is pretty much all JavaScript users) were using TypeScript in some form, with 42% of those writing TypeScript directly and the others using libraries and code written in TypeScript. This was up from 48% the year before.

The trendlines are strong, and types appear to be here to stay.

## 3. Frameworks are co-evolving along shared directions

One of the things I loved about reading through this was the peak behind the curtain of how ideas move from one framework to another.

This is one of the reasons I think it doesn’t matter too much which exact front-end framework you choose to study - the best ideas get adopted by all of the frameworks, and that adoption curve is happening faster and faster.

There are criticisms about this; part of the pushback against this RFC was that it felt too different from how Vue had traditionally worked. But in my opinion, the cross-polination is a good thing.

This should also help take the stress out of choosing a framework. So long as you learn it deeply enough to master the underlying concepts, you’ll be able to jump quickly to other frameworks as you need to. And if you love the “flavor” of one in particular, you won’t be left out of any big innovations because soon enough they will spread.

## Wrapping up

This RFC got me incredibly excited about the future of front-end development. This is not just because I love Vue.js (though I do), but because it highlighted how we as an industry keep getting better at self improvement. Innovative breakthroughs are rapidly spread, improved upon, and adopted throughout the ecosystem. The future is very bright indeed.

* * *

If frontend development is something you care about, you might also be interested in my weekly newsletter the Friday Frontend. Every Friday I send out 15 links to the best articles, tutorials, and announcements in CSS/SCSS, JavaScript, and assorted other awesome Front-end News. Sign up here: [https://zendev.com/friday-frontend.html](https://zendev.com/friday-frontend.html)