expo 58.0.0 → 58.0.2

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.
Files changed (41) hide show
  1. package/android/build.gradle +2 -2
  2. package/android/proguard-rules.pro +4 -0
  3. package/android/src/main/java/expo/modules/fetch/NativeResponse.kt +5 -1
  4. package/android/src/main/java/expo/modules/fetch/OkHttpFileUrlInterceptor.kt +5 -1
  5. package/build/winter/runtime.native.js +0 -2
  6. package/build/winter/runtime.native.js.map +1 -1
  7. package/bundledNativeModules.json +76 -76
  8. package/ios/Expo/ExpoReactNativeFactory.swift +2 -2
  9. package/ios/ExpoObjC/AppDelegates/EXReactRootViewFactory.mm +16 -2
  10. package/ios/ExpoObjC/include/Expo/EXReactRootViewFactory.h +2 -1
  11. package/package.json +13 -13
  12. package/scripts/spm/README.md +0 -3
  13. package/scripts/spm/__tests__/app-target.test.js +105 -1
  14. package/scripts/spm/__tests__/autolink-gate.test.js +188 -0
  15. package/scripts/spm/__tests__/classify.test.js +17 -19
  16. package/scripts/spm/__tests__/cli.test.js +57 -1
  17. package/scripts/spm/__tests__/diagnostics.test.js +806 -183
  18. package/scripts/spm/__tests__/flavored-frameworks.test.js +9 -0
  19. package/scripts/spm/__tests__/helpers.js +88 -0
  20. package/scripts/spm/__tests__/manifests.test.js +1330 -104
  21. package/scripts/spm/__tests__/metadata.test.js +120 -0
  22. package/scripts/spm/__tests__/plugin.test.js +3304 -111
  23. package/scripts/spm/__tests__/podspec.test.js +27 -138
  24. package/scripts/spm/__tests__/spm-dependencies.test.js +344 -0
  25. package/scripts/spm/app-target.js +42 -1
  26. package/scripts/spm/autolink-gate.js +40 -0
  27. package/scripts/spm/classify.js +78 -79
  28. package/scripts/spm/cli.js +23 -9
  29. package/scripts/spm/diagnostics.js +605 -192
  30. package/scripts/spm/flavored-frameworks.js +231 -64
  31. package/scripts/spm/manifests.js +565 -196
  32. package/scripts/spm/metadata.js +152 -0
  33. package/scripts/spm/plugin.js +679 -205
  34. package/scripts/spm/podspec.js +57 -170
  35. package/src/winter/runtime.native.ts +0 -2
  36. package/template.tgz +0 -0
  37. package/build/winter/AbortSignal.d.ts +0 -3
  38. package/build/winter/AbortSignal.js +0 -96
  39. package/build/winter/AbortSignal.js.map +0 -1
  40. package/src/winter/AbortSignal.ts +0 -132
  41. package/src/winter/__tests__/AbortSignal.test.native.ts +0 -163
@@ -1,163 +0,0 @@
1
- import { installAbortSignalPatch } from '../AbortSignal';
2
-
3
- const originalTimeout = AbortSignal.timeout;
4
- const originalAny = AbortSignal.any;
5
-
6
- function resetAbortSignalStatics() {
7
- Object.defineProperty(AbortSignal, 'timeout', {
8
- value: undefined,
9
- configurable: true,
10
- enumerable: false,
11
- writable: true,
12
- });
13
- Object.defineProperty(AbortSignal, 'any', {
14
- value: undefined,
15
- configurable: true,
16
- enumerable: false,
17
- writable: true,
18
- });
19
- }
20
-
21
- function restoreAbortSignalStatics() {
22
- Object.defineProperty(AbortSignal, 'timeout', {
23
- value: originalTimeout,
24
- configurable: true,
25
- enumerable: false,
26
- writable: true,
27
- });
28
- Object.defineProperty(AbortSignal, 'any', {
29
- value: originalAny,
30
- configurable: true,
31
- enumerable: false,
32
- writable: true,
33
- });
34
- }
35
-
36
- describe('AbortSignal patch', () => {
37
- beforeEach(() => {
38
- jest.useFakeTimers();
39
- resetAbortSignalStatics();
40
- installAbortSignalPatch(AbortSignal);
41
- });
42
-
43
- afterEach(() => {
44
- jest.useRealTimers();
45
- restoreAbortSignalStatics();
46
- });
47
-
48
- it('should install timeout and any when missing', () => {
49
- expect(AbortSignal.timeout).toEqual(expect.any(Function));
50
- expect(AbortSignal.any).toEqual(expect.any(Function));
51
- });
52
-
53
- it('should not override native timeout or any implementations', () => {
54
- const timeout = jest.fn();
55
- const any = jest.fn();
56
-
57
- Object.defineProperty(AbortSignal, 'timeout', {
58
- value: timeout,
59
- configurable: true,
60
- });
61
- Object.defineProperty(AbortSignal, 'any', {
62
- value: any,
63
- configurable: true,
64
- });
65
-
66
- installAbortSignalPatch(AbortSignal);
67
-
68
- expect(AbortSignal.timeout).toBe(timeout);
69
- expect(AbortSignal.any).toBe(any);
70
- });
71
-
72
- it('should abort timeout signal after delay with TimeoutError reason', () => {
73
- const signal = AbortSignal.timeout(10);
74
- const listener = jest.fn();
75
-
76
- signal.addEventListener('abort', listener);
77
- jest.advanceTimersByTime(9);
78
-
79
- expect(signal.aborted).toBe(false);
80
- expect(listener).not.toHaveBeenCalled();
81
-
82
- jest.advanceTimersByTime(1);
83
-
84
- expect(signal.aborted).toBe(true);
85
- expect(listener).toHaveBeenCalledTimes(1);
86
- expect(signal.reason).toBeInstanceOf(DOMException);
87
- expect(signal.reason.name).toBe('TimeoutError');
88
- });
89
-
90
- it('should reject invalid timeout values', () => {
91
- expect(() => AbortSignal.timeout(-1)).toThrow(RangeError);
92
- expect(() => AbortSignal.timeout(1.5)).toThrow(RangeError);
93
- expect(() => AbortSignal.timeout(Number.MAX_SAFE_INTEGER + 1)).toThrow(RangeError);
94
- // @ts-expect-error: Testing invalid usage
95
- expect(() => AbortSignal.timeout('1')).toThrow(TypeError);
96
- });
97
-
98
- it('should return non-aborted signal for empty any iterable', () => {
99
- const signal = AbortSignal.any([]);
100
-
101
- expect(signal.aborted).toBe(false);
102
- });
103
-
104
- it('should abort any signal when source is already aborted', () => {
105
- const reason = new Error('cancelled');
106
- const controller = new AbortController();
107
-
108
- controller.abort(reason);
109
- const signal = AbortSignal.any([controller.signal]);
110
-
111
- expect(signal.aborted).toBe(true);
112
- expect(signal.reason).toBe(reason);
113
- });
114
-
115
- it('should abort any signal when any source aborts', () => {
116
- const reason = new Error('second');
117
- const firstController = new AbortController();
118
- const secondController = new AbortController();
119
- const signal = AbortSignal.any([firstController.signal, secondController.signal]);
120
- const listener = jest.fn();
121
-
122
- signal.addEventListener('abort', listener);
123
- secondController.abort(reason);
124
-
125
- expect(signal.aborted).toBe(true);
126
- expect(signal.reason).toBe(reason);
127
- expect(listener).toHaveBeenCalledTimes(1);
128
- expect(firstController.signal.aborted).toBe(false);
129
- });
130
-
131
- it('should preserve first abort reason for any signal', () => {
132
- const firstReason = new Error('first');
133
- const secondReason = new Error('second');
134
- const firstController = new AbortController();
135
- const secondController = new AbortController();
136
- const signal = AbortSignal.any([firstController.signal, secondController.signal]);
137
-
138
- secondController.abort(secondReason);
139
- firstController.abort(firstReason);
140
-
141
- expect(signal.reason).toBe(secondReason);
142
- });
143
-
144
- it('should remove source listeners after any signal aborts', () => {
145
- const firstController = new AbortController();
146
- const secondController = new AbortController();
147
- const removeFirstListener = jest.spyOn(firstController.signal, 'removeEventListener');
148
- const removeSecondListener = jest.spyOn(secondController.signal, 'removeEventListener');
149
-
150
- AbortSignal.any([firstController.signal, secondController.signal]);
151
- firstController.abort();
152
-
153
- expect(removeFirstListener).toHaveBeenCalledWith('abort', expect.any(Function));
154
- expect(removeSecondListener).toHaveBeenCalledWith('abort', expect.any(Function));
155
- });
156
-
157
- it('should reject invalid any iterable values', () => {
158
- // @ts-expect-error: Testing invalid usage
159
- expect(() => AbortSignal.any(null)).toThrow(TypeError);
160
- // @ts-expect-error: Testing invalid usage
161
- expect(() => AbortSignal.any([{}])).toThrow(TypeError);
162
- });
163
- });