React Finland 2018 conference was held last week and I had the opportunity to attend it and listen what's hot in the React world. The conference started with workshops and after that there was two days of talks of React, React Native, React VR and all things that go with developing web applications with them. The two conference days were packed with great talks and new information. Here's the first part of my notes from the talks which I posted to Twitter. Read also the second part with more of React Native.
React Finland 2018: Day 1
React Finland combined the Finnish React community with international flavor from Jani Eväkallio to Ken Wheeler and other leading talents of the community. The event was the first of its kind in Finland and consisted of a workshop day and two days of talks around the topic. It was nice that the event was single track so you didn't need to choose between interesting talks.
At work I've been developing with React couple of years and tried my hands with React Native so the topics were familiar. The conference provided crafty new knowledge to learn from and maybe even put to production. Overall the conference was great experience and everything went smoothly. Nice work from the React Finland conference team! And of course thanks to Gofore which sponsored the conference and got me a ticket.
I tweeted my notes from almost every presentation and here's a recap of the talks. I heard that the videos from the conference will be available shortly.
The New Best Practices — Jani Eväkallio
First day's keynote was by Jani Eväkallio who talked about "The New Best Practices". As the talk description wrote "When React was first introduced, it was ridiculed for going against established web development best practices as we knew them. Five years later, React is the gold standard for how we create user interfaces. Along the way, we’ve discovered a new set of tools, design patterns and programming techniques."
The new best practices were:
- Build big things from small things
- Write code for humans first: flow, Typescript, storybook
- Stay close to the language:
- helps i.a. linters
- Always prefer simplicity
- Don’t break things:
- Facebook makes React API changes easy to upgrade, depreciation well in advance, migration, documentation. it's a flow, not versions. Use codemod.
- Keep an open mind
You ask "what new best practices"? Yep, that's the thing. We don't need new best practices as the same concepts like Model-View-Controller and separation of concerns are still valid. We should use best practices which have been proved good before as they also work nicely with React philosophy. Eväkallio also talked why React will be around for a long time. It's because components and interoperable components are an innovation primitive.
Declarative state and side effects — Christian Alfoni
Alfoni also pointed to Turning the database inside out with Apache Samza. Also that Cerebral had time travel before Dan Abramov presented Live React in his talk Hot Reloading with Time Travel at react-europe 2015
Immer: Immutability made easy — Michel Weststrate
The talk showed how to write your reducers in a much more readable way, with half the code and without requiring additional large libraries. The talk slides are available on the Internet.
Get Rich Quick With React Context — Patrick Hund
"Get Rich Quick With React Context" lightning talk by Patrick Hund didn't tell how good job opportunities you have when doing React But how with React 16.3 the context API has been completely revamped and demonstrated a good use case: Putting ad placements on your web page to get rich quick! Other use cases are localizations. Check out the slides which will tell you how easy it is to use context now and how to migrate your old context code to the new API.
There's always a better way to handle localization — Eemeli Aro
"There's always a better way to handle localization" lightning talk by Eemeli Aro told about how localization is a ridiculously difficult problem in the general case, but in the specific you can get away with really simple solutions, especially if you understand the compromises you're making.
Styled Components, SSR, and Theming — Kasia Jastrzębska
Web applications need to be styled and Kasia Jastrzębska talked about CSS-in-JS with styled-components by going through the new API, performance improvements, server side rendering with Next.js. She also showed the theming manager available with v2 of styled-components. Talk slides are available on the Internet.
Takeaways from this talk was that CSS in React app can be written as you always have or by using CSS-in-JS solutions. There are several benefits of using styled-components but I'm still thinking how styles get scattered all over components.
Universal React Apps Using Next.js — Sia Karamalegos
53% of mobile site visits are abandoned if pages take longer than 3 seconds to load.
- DoubleClick by Google, 2016
Every user’s hardware is different and processing speed can hinder user experience on client-side rendered React applications and so Sia Karamalegos talked how server-side rendering and code-splitting can drastically improve user experience. By minimizing the work that the client has to do. Performance and shipping your code matters. The talk showed how to easily build an universal React apps using the Next.js framework and walked through the concepts and code examples. Talk slides are available on the Internet.
There are lots of old (mobile) devices which especially benefit from Server Side Rendering. Next.js is a minimalistic framework for universal, server-rendered (or statically pre-rendered) React applications which enables faster page loads. Pages are server-rendered by default for initial load, you can enable prefetching future routes and there's automatic code splitting. It's also customizable so you can use own Babel and Webpack configurations and customize the server API with e.g. Express. And if you don't want to use a server Next.js can also build static web apps that you can then host on Github pages or AWS S3.
State Management in React Apps with Apollo Client — Sara Vieira
Apollo Client was one of the most mentioned framework in the conference along with Reason ML and Sara Vieira gave energetic talk how to use it for state management in React Apps. If you haven't come across Apollo Client it's caching GraphQL client and helps you to manage data coming from the server. Virieira showed how to manage local state with apollo-link-state.
The talk was fast paced and I somewhat missed the why part but at least it's easy to setup:
yarn add apollo-boost graphql react-apollo. Have to see slides and demo later. Maybe the talk can be wrapped up to: "GQL all the things" and "I don't like Redux" :D
Detox: A year in. Building it, Testing with it — Rotem Mizrachi-Meidan
Detox testing framework for React Native talk by Rotem Mizrachi-Meidan was the other talk I dozed along. Mizrachi-Meidan talked what developing and using Detox in production has taught and how Detox works and what makes it deterministic. The talk showed how mobile apps could be tested. There's a video of earlier talk on the Internet.
Make linting great again! — Andrey Okonetchnikov
One thing in software development which always gets developers to argue over stupid things is code formatting and linting. Andrey Okonetchnikov talked how "with a wrong workflow linting can be really a pain and will slow you and your team down but with a proper setup it can save you hours of manual work reformatting the code and reducing the code-review overhead."
The talk was a quick introduction how ?? lint-staged a node.js library can improve developer experience. Small tool coupled with tools that analyze and improve the code like ESLint, Stylelint, Prettier and Jest can make a big difference.
Read also the second part with more of React Native.