expo-modules-autolinking 55.0.19 → 55.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,10 +10,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 55.0.21 — 2026-05-05
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 55.0.20 — 2026-05-05
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 55.0.19 — 2026-04-28
14
22
 
15
23
  ### 🐛 Bug fixes
16
24
 
25
+ - [iOS] Disable precompiled modules with a clear warning when `EXPO_USE_PRECOMPILED_MODULES=1` is set without `RCT_USE_PREBUILT_RNCORE=1` ([#45381](https://github.com/expo/expo/pull/45381) by [@chrfalch](https://github.com/chrfalch))
26
+ - [iOS] Fall back to source build when a remote precompiled XCFramework download returns 404. ([#45240](https://github.com/expo/expo/pull/45240) by [@chrfalch](https://github.com/chrfalch))
17
27
  - [iOS] Resolve npm-bundled precompiled XCFrameworks for nested Expo packages like `expo-modules-core` during `pod install`. ([#45166](https://github.com/expo/expo/pull/45166) by [@chrfalch](https://github.com/chrfalch))
18
28
  - [iOS] Build precompiled Expo modules from source when a required upstream Expo dependency is unavailable as prebuilt. ([#45160](https://github.com/expo/expo/pull/45160) by [@chrfalch](https://github.com/chrfalch))
19
29
  - [iOS] Add support for optionally downloading external precompiled XCFramework tarballs from during `pod install`. ([#45067](https://github.com/expo/expo/pull/45067) by [@chrfalch](https://github.com/chrfalch))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-autolinking",
3
- "version": "55.0.19",
3
+ "version": "55.0.21",
4
4
  "description": "Scripts that autolink Expo modules.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -38,10 +38,10 @@
38
38
  "memfs": "^3.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@expo/require-utils": "^55.0.4",
41
+ "@expo/require-utils": "^55.0.5",
42
42
  "@expo/spawn-async": "^1.7.2",
43
43
  "chalk": "^4.1.0",
44
44
  "commander": "^7.2.0"
45
45
  },
46
- "gitHead": "be06cb45cb9eb8076b6910daa98813a6a3b03287"
46
+ "gitHead": "7c081282cf88968f81732feb67a71840e769a40f"
47
47
  }
@@ -74,6 +74,8 @@ module Expo
74
74
  @hermes_version = nil
75
75
  @claimed_vendored_frameworks = nil # Set<String> — xcframework names already claimed by a prebuilt pod
76
76
  @framework_owner_map = nil # Hash: framework_name -> owning_pod_name
77
+ @failed_remote_downloads = Set.new
78
+ @warned_no_prebuilt_react = false
77
79
 
78
80
  class << self
79
81
  # Returns the build flavor (debug/release) for precompiled modules.
@@ -95,9 +97,20 @@ module Expo
95
97
  ENV[EXTERNAL_MODULES_BASE_URL_ENV_VAR]
96
98
  end
97
99
 
98
- # Returns true if precompiled modules are enabled via environment variable
100
+ # Returns true if precompiled modules are enabled via environment variable.
101
+ # Precompiled module xcframeworks are linked against the prebuilt
102
+ # React.xcframework, so they also require RCT_USE_PREBUILT_RNCORE=1. If
103
+ # the user opted in to precompiled modules but React Native is still set
104
+ # to build from source, fall back to source-built modules and warn once.
99
105
  def enabled?
100
- ENV[ENV_VAR] == '1'
106
+ return false unless ENV[ENV_VAR] == '1'
107
+ return true if prebuilt_react_active?
108
+
109
+ unless @warned_no_prebuilt_react
110
+ @warned_no_prebuilt_react = true
111
+ Pod::UI.warn "[Expo] EXPO_USE_PRECOMPILED_MODULES=1 was set, but React Native is configured to build from source (RCT_USE_PREBUILT_RNCORE is not 1). Precompiled Expo modules require the prebuilt React.xcframework, so every Expo module will be built from source for this install. To use precompiled modules, ensure `ios.buildReactNativeFromSource` is not `true` in the `expo-build-properties` plugin (the default uses the prebuilt framework), or export RCT_USE_PREBUILT_RNCORE=1 before running `pod install`."
112
+ end
113
+ false
101
114
  end
102
115
 
103
116
  # Sets the list of package name patterns that should be built from source
@@ -1570,7 +1583,7 @@ module Expo
1570
1583
  current_dir = start_dir || Dir.pwd
1571
1584
 
1572
1585
  loop do
1573
- return current_dir if File.directory?(File.join(current_dir, 'packages'))
1586
+ return current_dir if File.exist?(File.join(current_dir, 'packages', 'expo-modules-core', 'spm.config.json'))
1574
1587
 
1575
1588
  parent = File.dirname(current_dir)
1576
1589
  break if parent == current_dir
@@ -1796,22 +1809,41 @@ module Expo
1796
1809
  "#{product_name}.tar.gz"
1797
1810
  ].join('/')
1798
1811
  remote_url = "#{base_url.chomp('/')}/#{relative_path}"
1812
+ remote_tarball = File.join(remote_precompiled_artifacts_dir, relative_path)
1813
+
1814
+ return remote_tarball if File.exist?(remote_tarball)
1815
+ return remote_tarball if failed_remote_downloads.include?(remote_url)
1816
+
1817
+ download_remote_tarball(remote_url, remote_tarball, pod_name || product_name, flavor)
1818
+ remote_tarball
1819
+ end
1799
1820
 
1800
- download_remote_tarball(remote_url, tarball, pod_name || product_name, flavor)
1821
+ def failed_remote_downloads
1822
+ @failed_remote_downloads ||= Set.new
1823
+ end
1824
+
1825
+ def remote_precompiled_artifacts_dir
1826
+ pods_root = Pod::Config.instance.sandbox_root rescue File.join(Dir.pwd, 'Pods')
1827
+ File.join(pods_root.to_s, 'ExpoPrecompiledArtifacts')
1828
+ end
1829
+
1830
+ def gray(text)
1831
+ text.respond_to?(:gray) ? text.gray : text
1801
1832
  end
1802
1833
 
1803
1834
  def download_remote_tarball(remote_url, destination_path, pod_name, flavor)
1804
1835
  FileUtils.mkdir_p(File.dirname(destination_path))
1805
1836
  tmp_path = "#{destination_path}.download-#{Process.pid}"
1806
1837
 
1807
- Pod::UI.info "#{'[Expo-precompiled] '.blue}#{pod_name}: downloading #{flavor} artifact from #{remote_url}"
1808
-
1809
1838
  download_to_file(remote_url, tmp_path)
1810
1839
  FileUtils.mv(tmp_path, destination_path)
1840
+ Pod::UI.info "#{'[Expo-precompiled] '.blue}#{pod_name}: downloaded remote #{flavor} artifact"
1811
1841
  destination_path
1812
1842
  rescue => e
1813
1843
  FileUtils.rm_f(tmp_path) if tmp_path && File.exist?(tmp_path)
1814
- Pod::UI.warn "[Expo-precompiled] #{pod_name}: failed to download #{flavor} artifact from #{remote_url}: #{e.message}"
1844
+ failed_remote_downloads.add(remote_url)
1845
+ Pod::UI.puts "#{'[Expo-precompiled] '.blue}#{"#{pod_name}: remote #{flavor} artifact unavailable (#{e.message}); building from source".yellow}"
1846
+ Pod::UI.puts "#{'[Expo-precompiled] '.blue}#{gray(" URL: #{remote_url}")}"
1815
1847
  nil
1816
1848
  end
1817
1849