react-native-safe-area-context
react-native-safe-area-context copied to clipboard
Move to expo-module-scripts for web tree shaking
Summary
Close #188 by moving the build script over to expo-module-scripts.
Test Plan
I'm going to publish under my own scope and install it in my app to make sure that the tree shaking does in fact work. The changes in this PR are little more than chores for build scripts, and moving some files around.
Looks like some tests are failing. Let me know what you need me to do to solve that.
Published to @nandorojo/react-native-safe-area-context at version 3.2.1. I can confirm this has a significant impact on tree shaking. Here's my next.js bundle analyzer:
- import { SafeAreaProvider } from 'react-native-safe-area-context'
+ import { SafeAreaProvider } from '@nandorojo/react-native-safe-area-context'
This one change reduced my bundle size by 400kb, which is quite significant for web.
Before
After
Thanks for taking the time to look at this. I'm not certain this is still an issue - but also - I don't think this project differs much from the generated boilerplate. The advantage of staying very close to the boilerplate is major upgrades are much easier. We may very well have to look into bringing in the latest boiler plate for the new architecture updates.
So appreciate the time you put into this, but I don't think this is the right direction