software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.83k stars 1.29k forks source link

rnx-kit treeShaking is removing necessary files from react-native-reanimated #5311

Open adamivancza opened 10 months ago

adamivancza commented 10 months ago

Description

I'm working on adding rnx-kit bundling in our app and noticed that after I bundle our app the app crashes. After some digging I opened up an issue inside rnx-kit: https://github.com/microsoft/rnx-kit/issues/2767. After some further digging I noticed that the sideEffects seems incorrect to me inside packages.json: https://github.com/software-mansion/react-native-reanimated/blob/main/package.json#L184 These paths are not existing for react-native so I think some necessary files are getting stripped out as part of tree shaking. After I changed this to a plain true locally our app is working fine. Any idea what further paths we need to include for react native?

Steps to reproduce

  1. Create an app, add an animation
  2. Enable rnx-kit bundling with treeShaking
  3. Create a release version of the app with the bundle created by rnx-kit
  4. The app is crashing

Snack or a link to a repository

-

Reanimated version

3.5.4

React Native version

0.72.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

iOS simulator

Device model

Any simulator

Acknowledgements

Yes

github-actions[bot] commented 10 months ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

github-actions[bot] commented 10 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

adamivancza commented 10 months ago

I can try to provide a minimal repro if needed but not sure if that makes sense. lmk!

Latropos commented 10 months ago

I'll discuss it with team, after next release, thank you!

adamivancza commented 3 weeks ago

Any update on this @Latropos ?