erikras.com
HomeAbout

šŸ Final Form goes to TypeScript

All Final Form modules have been modernized to TypeScript

Posted in Coding, šŸ Final Form, React, TypeScript
June 7, 2025Ā -Ā 4 min read
šŸ Final Form goes to TypeScript

When I first wrote šŸ Final Form back in 2017, Flow and TypeScript were exactly tied in the race to strongly type JavaScript.

At the time, I was just coming off of a switch from Angular to React. It was really telling to me at the time that Google wasn't really using Angular in their core user facing products, but Facebook was putting all their chips on React, dogfooding the crap out of it with their entire business on the line. And Facebook was doing an amazing job stewarding React in the Open Source community. Choosing Flow, from Facebook, to build Final Form was a no-brainer.

In retrospect, we now know that I put all my money on the wrong dog in the race.

Shortly thereafter, Facebook stopped supporting Flow externally. It's my understanding that those on the inside of Meta still use and love it.

Withdrawl from Open Source

After getting laid off in March 2020 – remember anything else going on then? – my career switched to jobs that needed more of my attention and also scratched my React and JavaScript itches. I know they say that "[Software] is never finished, merely abandoned", but... I think

Final Form is more or less feature complete.

It handles a huge portion (> 95%) of form use cases, and those use cases haven't changed in the eight years since I wrote it.

Nor will they.

Form state management will still be the same general shape of problem even when our great-grandkids are filling out their Space Academy applications. Values, validation, dirty, touched, submission errors, etc. The UI frameworks will change, but the underlying form state won't. As far as I know, Final Form remains one of only two framework agnostic form state solutions (the other is the brand new TanStack Form, which solves the same problems in a similar way).

Complaints

People have been contacting me lately asking me to mark the library as dead or at least update it to modern, say, React 19, standards. For years my response has been, "Volunteers welcome!", but it turns out no one really wants to help, certainly not a corporation. In a recent response on Github, I said:

It is true that:

  • I am no longer actively maintaining FF.
  • An unattended package.json will develop cobwebs.

However, it's also true that:

  • The code still works.
  • IMHO, RFF is still the most ergonomic way to manage form state in React.
  • For the first time ever, I'm actually consuming RFF at my day job.

I would love to hand the keys to the chapel over to a responsible young monk who will come in and sweep the floors and clear the cobwebs every so often. Any volunteers?

As per usual, this response received only crickets chirping. But the more I thought about it, the more I liked my cobwebs metaphor.

Cobwebs in a Church

If only there were a way to find junior developers that would work for little or no money and keep working until all the linting and tests pass! Rather than an intern to sweep the floors, what if there were like, some sort of...

robot vacuum?!

LLMs to the rescue!

It's 2025! We've all got an army of junior devs at our fingertips!

Robot monks sweeping

So I set about asking LLMs to convert Final Form from Flow to TypeScript, and it went better than I could have expected. Of course, it helped that long ago I had put in all of the legwork to have near 100% test coverage, so I could be certain that the migration did not introduce any bugs.

Now that the code is modernized, I feel less apathy towards maintaining it, so I hope to be more attentive in the future, though I am not promising anything.

In total precaution, I am bumping all the versions as if this were a breaking change, even though I'm 99.9% sure that it isn't, unless you were relying on the flow types, and in that case, you work for Meta and can build your own 🤬 internal form library.

LibraryVersion
final-formv5.0.0
final-form-focusv2.0.0
final-form-calculatev2.0.0
final-form-arraysv4.0.0
final-form-submit-listenerv2.0.0
react-final-formv7.0.0
react-final-form-arraysv4.0.0
react-final-form-arraysv2.0.0
react-final-form-html5-validationv2.0.0

ā¤ļø Thank you for reading, and thank you all for bearing with me during these years. 🫶

Discuss on Twitter

Ā© 2025 – Erik Rasmussen