Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update XCFramework setup to work with React Native 0.71.11 #5924

Merged

Commits on Jun 21, 2023

  1. Update Gutenberg reference

    Siobhan committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    cfe592e View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2023

  1. Update script for generating React-Codegen

    The method we used to generate React-Codegen (get_react_codegen_spec) was moved to a different file in newer versions of React Native. We need to update the script for generating it accordingly.
    Siobhan committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    e7bf780 View commit details
    Browse the repository at this point in the history
  2. Update third-party podspecs to target 0.71.11

    Siobhan committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    17e4705 View commit details
    Browse the repository at this point in the history
  3. Update FBReactNativeSpec.podspec.json with hash

    Siobhan committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    2aca7ac View commit details
    Browse the repository at this point in the history
  4. Apply bundle changes

    Siobhan committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    165d681 View commit details
    Browse the repository at this point in the history
  5. Manually add React-bridging.podspec.json

    The file was automatically deleted via the generate-podspecs.sh script. It has been manually added as a temporary measure, to enable further testing.
    Siobhan committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    9707305 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2023

  1. Revert "Manually add React-bridging.podspec.json"

    This reverts commit 9707305.
    Siobhan committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    30b052f View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2023

  1. Update list of dependencies in Podfile for iOS

    Siobhan committed Jun 25, 2023
    Configuration menu
    Copy the full SHA
    c89ef2a View commit details
    Browse the repository at this point in the history
  2. Add tag to Hermes podspec to workaround error

    This is intended as a temporary workaround, we should implement a more robust fix before merging.
    Siobhan committed Jun 25, 2023
    Configuration menu
    Copy the full SHA
    819d005 View commit details
    Browse the repository at this point in the history
  3. Update dependency versions in Podfile.lock

    Siobhan committed Jun 25, 2023
    Configuration menu
    Copy the full SHA
    64bf6d7 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. [Temporary] Add React Native as a dependency

    Siobhan committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    21a4fbe View commit details
    Browse the repository at this point in the history
  2. Revert "[Temporary] Add React Native as a dependency"

    This reverts commit 21a4fbe.
    Siobhan committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    6d1a1a3 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2023

  1. Update Gutenberg ref

    fluiddot committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    76fde7c View commit details
    Browse the repository at this point in the history
  2. Merge branch 'upgrade/react-native-0.71.8' into upgrade/react-native-…

    …0.71-ios
    
    # Conflicts:
    #	gutenberg
    #	ios-xcframework/Podfile.lock
    fluiddot committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    edf1e8c View commit details
    Browse the repository at this point in the history
  3. Update Gutenberg ref

    fluiddot committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    3b9f2cf View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2023

  1. Point RNReanimated to a custom branch to work around 2.17.0 issue

    The issue is due to RNReanimated looking for react-native in the
    node_modules relative to its location, which is how most projects would
    be setup. Unfortunately, our projects is not standard.
    
    When running `pod install` or `pod update`, we'd get:
    
    ```
    Installing RNReanimated 2.17.0 (was 2.9.1-wp-4)
    internal/modules/cjs/loader.js:934
      throw err;
      ^
    
    Error: Cannot find module 'react-native/package.json'
    Require stack:
    - /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/[eval]
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
        at Function.resolve (internal/modules/cjs/helpers.js:113:19)
        at [eval]:1:9
        at Script.runInThisContext (vm.js:134:12)
        at Object.runInThisContext (vm.js:310:38)
        at internal/process/execution.js:81:19
        at [eval]-wrapper:6:22
        at evalScript (internal/process/execution.js:80:60)
        at internal/main/eval_string.js:27:3 {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/[eval]'
      ]
    }
    
    [!] Invalid `RNReanimated.podspec` file: no implicit conversion of nil into String.
    
     #  from /var/folders/dq/cdqxvx3s5ps75564rpmb_dc00000gn/T/d20230627-89428-abwplk/RNReanimated.podspec:5
     #  -------------------------------------------
     #  reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
     >  config = find_config()
     #  assert_no_multiple_instances(config)
     #  -------------------------------------------
    ```
    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    f0ce4ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6632ac8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    74e82b6 View commit details
    Browse the repository at this point in the history
  4. Apply bundle changes

    Siobhan authored and mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    5582572 View commit details
    Browse the repository at this point in the history
  5. Switch to using use_react_native! in XCFramework Podfile

    Using only our custom specs, the build failed with
    
    ```
    Multiple commands produce '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h'
    
    - Target 'ReactCommon' (project 'Pods') has copy command from '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/ReactCommon/react/bridging/CallbackWrapper.h' to '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h'
    - Target 'ReactCommon' (project 'Pods') has copy command from '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h' to '/Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/CallbackWrapper.h'
    ```
    
    However, with this setup the build fails with:
    
    ```
    /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 35: .xcode.env: command not found
    /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 35: node: command not found
    [Warning] You need to configure your node path in the  environment.  You can set it up quickly by running:  echo 'export NODE_BINARY=' > .xcode.env  in the ios folder. This is needed by React Native to work correctly.  We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version.  You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment
    /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/Pods/../../gutenberg/node_modules/react-native/React/FBReactNativeSpec/../../scripts/xcode/with-environment.sh: line 41: /scripts/find-node-for-xcode.sh: No such file or directory
    [Error] Could not find node. It looks like that the .xcode.env or .xcode.env.local
    ```
    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    d065553 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fbd6161 View commit details
    Browse the repository at this point in the history
  7. Use .xcode.env instead of .xcode.env.local

    This way, users can override what CocoaPods does without modifying the
    codebase via the `.local` file.
    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    c7e2dd1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8f74c77 View commit details
    Browse the repository at this point in the history
  9. Use Xcode 14.3.1 in CI, like WordPress iOS does

    Otherwise, we're getting a compilation failure.
    See
    wordpress-mobile/WordPress-iOS@eadad98#commitcomment-119894859
    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    28afd7f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5919506 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1d6fd0a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e3326ab View commit details
    Browse the repository at this point in the history
  13. Switch an unless != to if ==

    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    df511f2 View commit details
    Browse the repository at this point in the history
  14. Add workaround to setup Hermes correctly in XCFramework

    They will take place if the process runs with `HERMES_ENABLED` true.
    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    f2d999d View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    00052f5 View commit details
    Browse the repository at this point in the history
  16. Embed Hermes XCFramework in Gutenberg XCFramework

    This is so that, at runtime, apps can find it. Otherwise, the build will
    run but the app will fail at runtime with:
    
    ```
    dyld[99988]: Library not loaded: @rpath/hermes.framework/hermes
      Referenced from: <931F58EC-3AC7-39DE-BEB7-1D44D8A5CF15> /Users/gio/Library/Developer/CoreSimulator/Devices/90F54127-B854-4ED8-93FA-D58167331941/data/Containers/Bundle/Application/3DA26EC7-B308-4029-9974-426839535542/WordPress.app/Frameworks/Gutenberg.framework/Gutenberg
    ```
    mokagio committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    b275a9d View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2023

  1. Configuration menu
    Copy the full SHA
    ec0c7fa View commit details
    Browse the repository at this point in the history
  2. Merge branch 'upgrade/react-native-0.71.8' into mokagio/support-rn-0.…

    …71.11-xcframework
    
    # Conflicts:
    #	bin/generate-podspecs.sh
    #	bundle/ios/App.js
    #	bundle/ios/App.js.map
    #	gutenberg
    #	ios-xcframework/Podfile
    #	ios-xcframework/Podfile.lock
    #	third-party-podspecs/FBReactNativeSpec/FBReactNativeSpec.podspec.json
    #	third-party-podspecs/hermes-engine.podspec.json
    fluiddot committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    17eae86 View commit details
    Browse the repository at this point in the history
  3. Update Gutenberg ref

    fluiddot committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    3bbb8b7 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. 3 Configuration menu
    Copy the full SHA
    630b737 View commit details
    Browse the repository at this point in the history
  2. Update Podfile.lock file

    fluiddot committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    73249ba View commit details
    Browse the repository at this point in the history
  3. 3 Configuration menu
    Copy the full SHA
    bdd6ab1 View commit details
    Browse the repository at this point in the history