TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.23k stars 2.9k forks source link

chore: move to monorepo with bun #4255

Open KrzysztofMoch opened 1 month ago

KrzysztofMoch commented 1 month ago

Summary

I have replaced yarn with bun as it is much faster. Also changed our repo structure to mono repo so we have now: -> docs -> examples | -> bare | -> expo -> packages | -> react-native-video (library code) | -> react-native-video-plugin-sample

Motivation

Speed up "node_modules" installation and allow for installing react-native-video as dependency in examples with simplify configuration.

Changes

Test plan

KrzysztofMoch commented 1 month ago

@freeboub this PR will create conflicts in all PRs, so I would like to merge as many PRs as possible before this one

KrzysztofMoch commented 1 month ago

Also builds are faster by 1.5 minute and node_modules for all projects are installing in ~8 sec

freeboub commented 3 weeks ago

finally a clean repo 🙏 Thank you !

freeboub commented 2 weeks ago

@KrzysztofMoch I would be happy if this PR is merged soon! I don't want to start any dev or fixes to avoid conflict :) Thank you

KrzysztofMoch commented 2 weeks ago

@freeboub I fine to merge it - other PRs will need to rebase but I guess this is probably inevitable

freeboub commented 2 weeks ago

@KrzysztofMoch I am not able to build samples with this PR ...

on bare sample: olivier@OrdinateOlivier bare % bun run android $ react-native run-android (node:17082) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) info Installing the app...

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

BUILD FAILED in 466ms error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. Where: Script '/Users/olivier/openSource/react-native-video/examples/bare/node_modules/react-native-test-app/android/config-plugins.gradle' line: 17 What went wrong: A problem occurred evaluating script.

Failed to apply config plugins: node:internal/process/promises:394 triggerUncaughtException(err, true / fromPromise /); ^ SyntaxError: Unexpected token 'typeof' at compileSourceTextModule (node:internal/modules/esm/utils:337:16) at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:310:18) at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24) at Module._compile (node:internal/modules/cjs/loader:1503:5) at Module._extensions..js (node:internal/modules/cjs/loader:1691:10) at Module.load (node:internal/modules/cjs/loader:1317:32) at Module._load (node:internal/modules/cjs/loader:1127:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:217:24) at Module.require (node:internal/modules/cjs/loader:1339:12) { name: 'PluginError', isPluginError: true, code: 'INVALID_PLUGIN_IMPORT', cause: undefined } Node.js v22.9.0 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org. BUILD FAILED in 466ms. info Run CLI with --verbose flag for more details. error: script "android" exited with code 1

I also think you should move react-native-video-plugin-sample to exemple folder as it is not made to be released.

Thank you

freeboub commented 2 weeks ago

pod install is also failing on ios: olivier@OrdinateOlivier bare % pod install --project-directory=ios Framework build type is static library [Codegen] Generating ios/build/generated/ios/React-Codegen.podspec.json (node:19807) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) Auto-linking React Native modules for target ReactTestApp: RNCPicker and ReactTestApp-DevSupport Analyzing dependencies Fetching podspec for DoubleConversion from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec [Codegen] Found FBReactNativeSpec Fetching podspec for RCT-Folly from ../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec [Codegen] Found rncore Fetching podspec for boost from ../node_modules/react-native/third-party-podspecs/boost.podspec Fetching podspec for glog from ../node_modules/react-native/third-party-podspecs/glog.podspec Downloading dependencies Removing react-native-video Generating Pods project Setting USE_HERMES build settings Setting REACT_NATIVE build settings Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /Users/olivier/openSource/react-native-video/examples/bare/node_modules/.generated/ios/ReactTestApp.xcodeproj Pod install took 9 [s] to run node:internal/process/promises:394 triggerUncaughtException(err, true / fromPromise /); ^

SyntaxError: Unexpected token 'typeof' at compileSourceTextModule (node:internal/modules/esm/utils:337:16) at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:310:18) at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24) at Module._compile (node:internal/modules/cjs/loader:1503:5) at Module._extensions..js (node:internal/modules/cjs/loader:1691:10) at Module.load (node:internal/modules/cjs/loader:1317:32) at Module._load (node:internal/modules/cjs/loader:1127:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:217:24) at Module.require (node:internal/modules/cjs/loader:1339:12) { name: 'PluginError', isPluginError: true, code: 'INVALID_PLUGIN_IMPORT', cause: undefined }

Node.js v22.9.0 [!] An error occurred while processing the post-install hook of the Podfile.

Failed to apply config plugins

/Users/olivier/openSource/react-native-video/examples/bare/node_modules/react-native-test-app/ios/test_app.rb:29:in apply_config_plugins' /Users/olivier/openSource/react-native-video/examples/bare/node_modules/react-native-test-app/ios/test_app.rb:447:inblock in use_test_app_internal!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.15.2/lib/cocoapods-core/podfile.rb:196:in post_install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1013:inrun_podfile_post_install_hook' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1001:in block in run_podfile_post_install_hooks' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:149:inmessage' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1000:in run_podfile_post_install_hooks' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:337:inblock (2 levels) in create_and_save_projects' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in write!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:336:inblock in create_and_save_projects' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in section' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:315:increate_and_save_projects' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:307:in generate_pods_project' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:183:inintegrate' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:inrun' /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:inrun' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:inload' /usr/local/bin/pod:23:in `

'

[!] CocoaPods will not include resources it cannot find: dist/assets dist/main.ios.jsbundle

The app will still build and run if they are served by the dev server. To include missing resources, make sure they exist, then run pod install again to update the workspace.

KrzysztofMoch commented 1 week ago

I have bumped react-native version in bare example, I have tested it and now I am able to build and run android

my versions