Skip to content

Make third-party dependencies optional to reduce bundle size and version conflictsΒ #769

@douglasjunior

Description

@douglasjunior

Is your feature request related to a problem? Please describe.

I'm always frustrated when Storybook for React Native forces the inclusion of third-party dependencies like react-native-reanimated, react-native-svg, and @gorhom/bottom-sheet in projects that don't actually use these libraries. This creates three main problems:

  1. Version conflicts between the libraries used in our project and those required by Storybook

  2. Unnecessary native module bundling - our final app bundle includes code for libraries we don't use (e.g., we don't use @gorhom/bottom-sheet or react-native-reanimated, but their code is still bundled)

  3. Breaking changes overhead - libraries like react-native-reanimated have a considerable history of breaking changes between versions, increasing maintenance workload for future Android, iOS, and React Native updates

Describe the solution you'd like

I would like Storybook to make these third-party dependencies optional and limit required dependencies to only internal React Native APIs. For example, @gorhom/bottom-sheet could be replaced with React Native's built-in Modal component. This would allow projects to opt-in to additional dependencies only when needed, rather than being forced to include them.

Describe alternatives you've considered

  • Creating a peer dependency system where these libraries are optional
  • Providing different Storybook builds (minimal vs full-featured)
  • Using React Native's built-in components as fallbacks when third-party libraries are not available
  • Implementing a plugin system where additional UI components can be added optionally

Are you able to assist bring the feature to reality?

Yes, I can contribute to this feature implementation. I have experience in React Native and open-source projects, I'm willing to help with code reviews, testing, and implementation.

Additional context

This issue particularly affects enterprise projects and apps with strict bundle size requirements. Many teams avoid updating Storybook versions due to conflicts with these mandatory dependencies, which impacts the overall developer experience and adoption of newer Storybook features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions