Skip to content

fix: iOS hermes detection#2119

Merged
AnatolyPristensky merged 1 commit intomicrosoft:masterfrom
pjc0247:patch-1
Oct 24, 2022
Merged

fix: iOS hermes detection#2119
AnatolyPristensky merged 1 commit intomicrosoft:masterfrom
pjc0247:patch-1

Conversation

@pjc0247
Copy link
Copy Markdown
Contributor

@pjc0247 pjc0247 commented Oct 18, 2022

The original regex fails to match RN's default template.

const t = `
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'HelloWorld' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change \`false\` to \`true\` and then install pods
    :hermes_enabled => true
  )

  target 'HelloWorldTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end
`;

// old one
console.log(/^([^#\n]*:?hermes_enabled(\s+|\n+)?(=>|:)(\s+|\n+)?true)$/.test(t));

// fixed one
console.log(/([^#\n]*:?hermes_enabled(\s+|\n+)?(=>|:)(\s+|\n+)?true)/.test(t));

Possible related issues:
microsoft/react-native-code-push#2342
microsoft/react-native-code-push#2346

@pjc0247 pjc0247 requested a review from a team as a code owner October 18, 2022 06:25
@AnatolyPristensky
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@AnatolyPristensky AnatolyPristensky merged commit c272be7 into microsoft:master Oct 24, 2022
@Acetyld
Copy link
Copy Markdown

Acetyld commented Oct 27, 2022

Lovely, can this be a beta/alpha release? Currently i pulled the git, build it my self and merged.
This fixed a mayor issue with use together with --use-hermes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants