@octane-xplat/patches 0.0.0-nightly.g2e22171

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.
@@ -0,0 +1,30 @@
1
+ diff --git a/index.ios.js b/index.ios.js
2
+ index 55c24ed3cbcd7eb0b17ddd3ea86f4ba72bf5e8fb..c4d2344fffbcea691c25099548e09a15355795d1 100644
3
+ --- a/index.ios.js
4
+ +++ b/index.ios.js
5
+ @@ -108,6 +108,16 @@ function getContextFromOptions(options) {
6
+ if (transformers.length > 0) {
7
+ context.setValueForKey(SDImagePipelineTransformer.transformerWithTransformers(transformers), SDWebImageContextImageTransformer);
8
+ }
9
+ + if (options.headers) {
10
+ + const requestModifier = SDWebImageDownloaderRequestModifier.requestModifierWithBlock((request) => {
11
+ + const newRequest = request.mutableCopy();
12
+ + Object.keys(options.headers).forEach((k) => {
13
+ + newRequest.addValueForHTTPHeaderField(options.headers[k], k);
14
+ + });
15
+ + return newRequest.copy();
16
+ + });
17
+ + context.setValueForKey(requestModifier, SDWebImageContextDownloadRequestModifier);
18
+ + }
19
+ return context;
20
+ }
21
+ // This is not the best solution as their might be a lot of corner cases
22
+ @@ -177,6 +187,8 @@ export class ImagePipeline {
23
+ prefetchToCacheType(uri, cacheType, options = {}) {
24
+ return new Promise((resolve, reject) => {
25
+ const context = getContextFromOptions(options);
26
+ + context.setObjectForKey(cacheType, SDWebImageContextStoreCacheType);
27
+ + context.setObjectForKey(cacheType, SDWebImageContextOriginalStoreCacheType);
28
+ SDWebImagePrefetcher.sharedImagePrefetcher.context = context;
29
+ SDWebImagePrefetcher.sharedImagePrefetcher.prefetchURLsProgressCompleted([getUri(uri)], null, (finished, skipped) => {
30
+ if (finished && !skipped) {
@@ -0,0 +1,41 @@
1
+ diff --git a/dist/server/strategy.js b/dist/server/strategy.js
2
+ index 7d84b37e2ed3a026da5b31c8a11027e0580877b2..f6594a913ba64837135e994cb183add13c6a0530 100644
3
+ --- a/dist/server/strategy.js
4
+ +++ b/dist/server/strategy.js
5
+ @@ -14,7 +14,9 @@ import { purgeTransformCachesForHotUpdate, runHotUpdatePrologue, typescriptServe
6
+ * otherwise the re-fetch can be served from the previous save's transform and
7
+ * the screen ends up one save behind.
8
+ */
9
+ -const SCRIPT_FILE_RE = /\.(?:[mc]?[jt]sx?)$/i;
10
+ +// `.tsrx` is Octane's component extension — without it the deferred delta is
11
+ +// never emitted and component edits silently never reach the device.
12
+ +const SCRIPT_FILE_RE = /\.(?:[mc]?[jt]sx?|tsrx)$/i;
13
+ export const octaneServerStrategy = {
14
+ ...typescriptServerStrategy,
15
+ flavor: 'octane',
16
+ @@ -24,7 +26,7 @@ export const octaneServerStrategy = {
17
+ if (!state)
18
+ return;
19
+ const { root, metrics, emitSummary } = state;
20
+ - const { moduleGraph, verbose, sharedTransformRequest } = deps;
21
+ + const { moduleGraph, verbose, sharedTransformRequest, wss, isSocketClientOpen } = deps;
22
+ const { file, server } = ctx;
23
+ if (!SCRIPT_FILE_RE.test(file)) {
24
+ emitSummary();
25
+ @@ -71,6 +73,16 @@ export const octaneServerStrategy = {
26
+ const gm = moduleGraph.get(normalizedId);
27
+ if (gm)
28
+ moduleGraph.emitDelta([gm], []);
29
+ + // The ns:hmr-delta broadcast IS the update delivery for this flavor —
30
+ + // count open sockets so the always-on summary reflects reality
31
+ + // instead of reporting recipients=0 for a delivered update.
32
+ + try {
33
+ + wss?.clients?.forEach((client) => {
34
+ + if (isSocketClientOpen?.(client))
35
+ + metrics.recipients += 1;
36
+ + });
37
+ + }
38
+ + catch { }
39
+ }
40
+ catch (e) {
41
+ if (verbose)