Here we can test react-native-reanimated
's bundle size.
-
git clone https://github.com/nandorojo/reanimated-tree-shaking.git
-
yarn
-
yarn dev
to view the website locally onlocalhost:3000
-
yarn analyze
to view the bundle size results (it will open automatically in your browser).a. Be sure to look in the logs in your terminal to see page sizes too.
-
Open
lib/react-native-reanimated
and edit thesrc
folder to see changes, and keep building.
npx create-next-app --example with-react-native-web rea-tree
cd rea-tree
yarn add react-native-reanimated @expo/next-adapter
yarn add -D @next/bundle-analyzer next-transpile-modules
- Configure
next.config.js
andbabel.config.js
by following the Solito's starter configuration. - Add
pages/reanimated.js
- Clone
pages/index.js
, useAnimated.View
instead ofView
- Copy
node_modules/react-native-reanimated
->lib/react-native-reanimated
- Removed all native code from
Common
,ios
andandroid
folders since these aren't used on Web
- Alias imports from
react-native-reanimated
->lib/react-native-reanimated/src/Animated.js
innext.config.js
so that we can debug more easily, sincenode_modules
are cached and compiled.