expo-desktop 0.1.30 → 0.1.32

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.
@@ -98,7 +98,6 @@ export async function createExpoDesktopApp({ localDev, name, packageManager, tem
98
98
  }
99
99
  title("Adding Expo support to the Metro config…", { spacing: 1 });
100
100
  await improveMetroConfig({ projectPath });
101
- await addWindowsExpoPolyfill({ projectPath });
102
101
  title("Adding Expo support to the Babel config…", { spacing: 1 });
103
102
  await writeBabelConfig({ projectPath });
104
103
  }
@@ -472,17 +471,6 @@ const { getDefaultConfig } = require("@expo/metro-config");
472
471
  const { makeMetroConfig } = require("@rnx-kit/metro-config");
473
472
 
474
473
  const config = makeMetroConfig(getDefaultConfig(__dirname));
475
-
476
- const getPolyfills = config.serializer.getPolyfills;
477
- const windowsExpoPolyfill = require.resolve("./expo-polyfill.windows.js");
478
- config.serializer.getPolyfills = (...args) => {
479
- const polyfills = getPolyfills(...args);
480
- if (args[0].platform === "windows") {
481
- polyfills.push(windowsExpoPolyfill);
482
- }
483
- return polyfills;
484
- };
485
-
486
474
  module.exports = config;
487
475
  `.trim() + "\n", "utf-8");
488
476
  }
@@ -492,69 +480,6 @@ module.exports = config;
492
480
  }
493
481
  console.log(`\n${green("◆")} Overwrote metro.config.js.\n`);
494
482
  }
495
- /**
496
- */
497
- async function addWindowsExpoPolyfill({ projectPath }) {
498
- await fs.writeFile(path.resolve(projectPath, "expo-polyfill.windows.js"), `
499
- try {
500
- // Until we can configure TurboModules for eager initialisation (which is
501
- // waiting on https://github.com/microsoft/react-native-windows/pull/16093), we
502
- // need to trigger the lazy-init of our TurboModule by accessing it for the
503
- // first time, which causes the TurboModuleManager to call its REACT_INIT
504
- // method.
505
- //
506
- // We can't do any imports inside getPolyfills(), but can use the global proxy:
507
- globalThis.nativeModuleProxy.ExpoMainRuntimeInstaller;
508
-
509
- // TODO: Implement Expo's NativeModulesProxy and make all of this
510
- // lazy-initialised (and actually populate \`exportedMethods\`, etc.).
511
-
512
- // Below are temporary stubs to suppress these warnings:
513
- // WARN The "EXNativeModulesProxy" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly
514
- // WARN No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
515
- // WARN No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
516
-
517
- // Funnily enough, although expo-modules-core prefers to access
518
- // global.expo?.modules?.NativeModulesProxy over the deprecated
519
- // NativeModules?.NativeUnimoduleProxy, we still need the latter to exist in
520
- // order for it to check the former. And it's only
521
- globalThis.nativeModuleProxy.NativeUnimoduleProxy;
522
- const { ExpoAsset } = globalThis.nativeModuleProxy;
523
-
524
- const ExponentConstants = {};
525
-
526
- globalThis.expo.modules = {
527
- ExpoAsset,
528
- ExponentConstants,
529
- // - JS: apps/demo/node_modules/expo-modules-core/src/NativeModulesProxy.native.ts
530
- // - iOS:
531
- // - NativeUnimoduleProxy: apps/demo/node_modules/expo-modules-core/ios/Legacy/NativeModulesProxy/NativeModulesProxyModule.swift
532
- // - NativeModulesProxy: apps/demo/node_modules/expo-modules-core/ios/Legacy/NativeModulesProxy/EXNativeModulesProxy.mm
533
- // - Android:
534
- // - NativeUnimoduleProxy: apps/demo/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java
535
- // - NativeModulesProxy: apps/demo/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/defaultmodules/NativeModulesProxyModule.kt
536
- NativeModulesProxy: {
537
- exportedMethods: {
538
- ExpoAsset: [],
539
- ExponentConstants: [],
540
- },
541
- modulesConstants: {
542
- ExpoAsset: [],
543
- ExponentConstants: [],
544
- },
545
- },
546
- };
547
-
548
- // Now expo-modules-core can populate its fileprivate
549
- // \`const NativeModulesProxy: Record<string, ProxyNativeModule = {}\` from our
550
- // global.expo?.modules?.NativeModulesProxy. This avoids the warning about
551
- // EXNativeModulesProxy being missing.
552
- } catch (error) {
553
- console.error("Polyfill failed", error);
554
- throw error;
555
- }
556
- `.trim() + "\n", "utf-8");
557
- }
558
483
  async function updatePodfile({ projectPath }) {
559
484
  const appJsonPath = path.resolve(projectPath, "macos/Podfile");
560
485
  let contents;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-desktop",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Best-effort desktop support for Expo",
5
5
  "keywords": [
6
6
  "android",
@@ -37,8 +37,8 @@
37
37
  "@clack/prompts": "^1.2.0",
38
38
  "arktype": "^2.2.0",
39
39
  "citty": "^0.2.2",
40
- "expo-desktop-config-plugins": "^1.1.27",
41
- "expo-desktop-prebuild-config": "^1.0.13",
40
+ "expo-desktop-config-plugins": "^1.1.29",
41
+ "expo-desktop-prebuild-config": "^1.0.15",
42
42
  "glob": "^10.5.0",
43
43
  "kleur": "^4.1.5",
44
44
  "mustache": "^4.2.0",