callstack / callstack/haul

Support Fast Refresh

Open
#583 7 comments 27 reactions 0 assignees View on GitHub
needs more info
Dominant language
TypeScript
Stars
3.7k
Forks
185
PR merge metrics
No merged PRs in 30d

Description

## Describe the feature

We've landed [Fast Refresh](https://mobile.twitter.com/reactnative/status/1144629612921720833) on React Native master. You can try it if you build all Metro packages from master and replace them in `node_modules` of RNTester.

## Motivation

It would be nice if Haul could replace `react-hot-loader` or other techniques with Fast Refresh because:

- Fast Refresh doesn't create semantic differences in behavior (so it's safe to always leave on, unlike solutions based on `react-hot-loader` and similar tools)
- Fast Refresh fully supports function components and Hooks, including cases where you add or remove Hooks
- Fast Refresh gracefully recovers from errors

It likely also fixes hot reloading problems with navigation libraries because it's fully integrated with React. (Although I don't have a test case to verify that.)

It would also unify the behavior with mainline React Native.

## But How?

I'd be happy to chat with someone to give an overview of how the new system works. For a 100% match in behavior we might need some new hooks from webpack, but you should be able to get reasonably close today too.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.