@warp-drive-mirror/experiments 0.0.1-alpha.105 → 0.0.1-alpha.106
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/dist/image-fetch.js +77 -0
- package/dist/image-fetch.js.map +1 -0
- package/dist/image-worker.js +96 -0
- package/dist/image-worker.js.map +1 -0
- package/package.json +18 -12
- package/unstable-preview-types/image-fetch.d.ts +4 -0
- package/unstable-preview-types/image-fetch.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +1 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createDeferred } from '@ember-data-mirror/request';
|
|
2
|
+
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
3
|
+
const isServerEnv = typeof FastBoot !== 'undefined';
|
|
4
|
+
class ImageFetch {
|
|
5
|
+
constructor(worker) {
|
|
6
|
+
this.threadId = isServerEnv ? '' : crypto.randomUUID();
|
|
7
|
+
this.pending = new Map();
|
|
8
|
+
this.cache = new Map();
|
|
9
|
+
const isTesting = macroCondition(getGlobalConfig().WarpDrive.env.TESTING) ? true : false;
|
|
10
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
11
|
+
if (!test) {
|
|
12
|
+
throw new Error(`Expected a SharedWorker instance`);
|
|
13
|
+
}
|
|
14
|
+
})(isTesting || isServerEnv || worker instanceof SharedWorker) : {};
|
|
15
|
+
this.worker = worker;
|
|
16
|
+
if (!isServerEnv) {
|
|
17
|
+
const fn = event => {
|
|
18
|
+
const {
|
|
19
|
+
type,
|
|
20
|
+
url
|
|
21
|
+
} = event.data;
|
|
22
|
+
const deferred = this.cleanupRequest(url);
|
|
23
|
+
if (!deferred) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (type === 'success-response') {
|
|
27
|
+
deferred.resolve(url);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (type === 'error-response') {
|
|
31
|
+
deferred.reject(null);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
if (worker instanceof SharedWorker) {
|
|
36
|
+
worker.port.postMessage({
|
|
37
|
+
type: 'connect',
|
|
38
|
+
thread: this.threadId
|
|
39
|
+
});
|
|
40
|
+
worker.port.onmessage = fn;
|
|
41
|
+
} else if (worker) {
|
|
42
|
+
this.channel = new MessageChannel();
|
|
43
|
+
worker.postMessage({
|
|
44
|
+
type: 'connect',
|
|
45
|
+
thread: this.threadId
|
|
46
|
+
}, [this.channel.port2]);
|
|
47
|
+
this.channel.port1.onmessage = fn;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
cleanupRequest(url) {
|
|
52
|
+
const deferred = this.pending.get(url);
|
|
53
|
+
this.pending.delete(url);
|
|
54
|
+
return deferred;
|
|
55
|
+
}
|
|
56
|
+
_send(event) {
|
|
57
|
+
this.worker instanceof SharedWorker ? this.worker.port.postMessage(event) : this.channel.port1.postMessage(event);
|
|
58
|
+
}
|
|
59
|
+
load(url) {
|
|
60
|
+
if (isServerEnv) {
|
|
61
|
+
return Promise.resolve(url);
|
|
62
|
+
}
|
|
63
|
+
const objectUrl = this.cache.get(url);
|
|
64
|
+
if (objectUrl) {
|
|
65
|
+
return Promise.resolve(objectUrl);
|
|
66
|
+
}
|
|
67
|
+
const deferred = createDeferred();
|
|
68
|
+
this.pending.set(url, deferred);
|
|
69
|
+
this._send({
|
|
70
|
+
type: 'load',
|
|
71
|
+
thread: this.threadId,
|
|
72
|
+
url
|
|
73
|
+
});
|
|
74
|
+
return deferred.promise;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export { ImageFetch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-fetch.js","sources":["../src/image-worker/fetch.ts"],"sourcesContent":["import { createDeferred } from '@ember-data-mirror/request';\nimport type { Deferred } from '@ember-data-mirror/request/-private/types';\nimport { TESTING } from '@warp-drive-mirror/build-config/env';\nimport { assert } from '@warp-drive-mirror/build-config/macros';\n\nimport type { MainThreadEvent, RequestEventData } from './types';\n\nexport interface FastBoot {\n require(moduleName: string): unknown;\n isFastBoot: boolean;\n request: Request;\n}\n\nconst isServerEnv = typeof FastBoot !== 'undefined';\n\nexport class ImageFetch {\n declare worker: Worker | SharedWorker;\n declare threadId: string;\n declare pending: Map<string, Deferred<string>>;\n declare channel: MessageChannel;\n declare cache: Map<string, string>;\n\n constructor(worker: Worker | SharedWorker | null) {\n this.threadId = isServerEnv ? '' : crypto.randomUUID();\n this.pending = new Map();\n this.cache = new Map();\n\n const isTesting = TESTING ? true : false;\n assert(`Expected a SharedWorker instance`, isTesting || isServerEnv || worker instanceof SharedWorker);\n this.worker = worker as SharedWorker;\n\n if (!isServerEnv) {\n const fn = (event: MainThreadEvent) => {\n const { type, url } = event.data;\n const deferred = this.cleanupRequest(url);\n if (!deferred) {\n return;\n }\n\n if (type === 'success-response') {\n deferred.resolve(url);\n return;\n }\n\n if (type === 'error-response') {\n deferred.reject(null);\n return;\n }\n };\n\n if (worker instanceof SharedWorker) {\n worker.port.postMessage({ type: 'connect', thread: this.threadId });\n worker.port.onmessage = fn;\n } else if (worker) {\n this.channel = new MessageChannel();\n worker.postMessage({ type: 'connect', thread: this.threadId }, [this.channel.port2]);\n\n this.channel.port1.onmessage = fn;\n }\n }\n }\n\n cleanupRequest(url: string) {\n const deferred = this.pending.get(url);\n this.pending.delete(url);\n\n return deferred;\n }\n\n _send(event: RequestEventData) {\n this.worker instanceof SharedWorker ? this.worker.port.postMessage(event) : this.channel.port1.postMessage(event);\n }\n\n load(url: string) {\n if (isServerEnv) {\n return Promise.resolve(url);\n }\n\n const objectUrl = this.cache.get(url);\n if (objectUrl) {\n return Promise.resolve(objectUrl);\n }\n\n const deferred = createDeferred<string>();\n this.pending.set(url, deferred);\n this._send({ type: 'load', thread: this.threadId, url });\n return deferred.promise;\n }\n}\n"],"names":["isServerEnv","FastBoot","ImageFetch","constructor","worker","threadId","crypto","randomUUID","pending","Map","cache","isTesting","macroCondition","getGlobalConfig","WarpDrive","env","TESTING","DEBUG","test","Error","SharedWorker","fn","event","type","url","data","deferred","cleanupRequest","resolve","reject","port","postMessage","thread","onmessage","channel","MessageChannel","port2","port1","get","delete","_send","load","Promise","objectUrl","createDeferred","set","promise"],"mappings":";;;AAaA,MAAMA,WAAW,GAAG,OAAOC,QAAQ,KAAK,WAAW,CAAA;AAE5C,MAAMC,UAAU,CAAC;EAOtBC,WAAWA,CAACC,MAAoC,EAAE;IAChD,IAAI,CAACC,QAAQ,GAAGL,WAAW,GAAG,EAAE,GAAGM,MAAM,CAACC,UAAU,EAAE,CAAA;AACtD,IAAA,IAAI,CAACC,OAAO,GAAG,IAAIC,GAAG,EAAE,CAAA;AACxB,IAAA,IAAI,CAACC,KAAK,GAAG,IAAID,GAAG,EAAE,CAAA;AAEtB,IAAA,MAAME,SAAS,GAAGC,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,OAAA,CAAU,GAAA,IAAI,GAAG,KAAK,CAAA;IACxCJ,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAE,KAAA,CAAA,GAAA,CAAAC,IAAA,IAAA;AAAA,MAAA,IAAA,CAAAA,IAAA,EAAA;QAAA,MAAAC,IAAAA,KAAA,CAAQ,CAAiC,gCAAA,CAAA,CAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAER,SAAS,IAAIX,WAAW,IAAII,MAAM,YAAYgB,YAAY,CAAA,GAAA,EAAA,CAAA;IACrG,IAAI,CAAChB,MAAM,GAAGA,MAAsB,CAAA;IAEpC,IAAI,CAACJ,WAAW,EAAE;MAChB,MAAMqB,EAAE,GAAIC,KAAsB,IAAK;QACrC,MAAM;UAAEC,IAAI;AAAEC,UAAAA,GAAAA;SAAK,GAAGF,KAAK,CAACG,IAAI,CAAA;AAChC,QAAA,MAAMC,QAAQ,GAAG,IAAI,CAACC,cAAc,CA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ClB,KAAuB,EAAE;IAC7B,IAAI,CAAClB,MAAM,YAAYgB,YAAY,GAAG,IAAI,CAAChB,MAAM,CAAC0B,IAAI,CAACC,WAAW,CAACT,KAAK,CAAC,GAAG,IAAI,CAACY,OAAO,CAACG,KAAK,CAACN,WAAW,CAACT,KAAK,CAAC,CAAA;AACnH,GAAA;EAEAmB,IAAIA,CAACjB,GAAW,EAAE;AAChB,IAAA,IAAIxB,WAAW,EAAE;AACf,MAAA,OAAO0C,OAAO,CAACd,OAAO,CAACJ,GAAG,CAAC,CAAA;AAC7B,KAAA;IAEA,MAAMmB,SAAS,GAAG,IAAI,CAACjC,KAAK,CAAC4B,GAAG,CAACd,GAAG,CAAC,CAAA;AACrC,IAAA,IAAImB,SAAS,EAAE;AACb,MAAA,OAAOD,OAAO,CAACd,OAAO,CAACe,SAAS,CAAC,CAAA;AACnC,KAAA;AAEA,IAAA,MAAMjB,QAAQ,GAAGkB,cAAc,EAAU,CAAA;IACzC,IAAI,CAACpC,OAAO,CAACqC,GAAG,CAACrB,GAAG,EAAEE,QAAQ,CAAC,CAAA;IAC/B,IAAI,CAACc,KAAK,CAAC;AAAEjB,MAAAA,IAAI,EAAE,MAAM;MAAES,MAAM,EAAE,IAAI,CAAC3B,QAAQ;AAAEmB,MAAAA,GAAAA;AAAI,KAAC,CAAC,CAAA;IACxD,OAAOE,QAAQ,CAACoB,OAAO,CAAA;AACzB,GAAA;AACF;;;;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const WorkerScope = globalThis.SharedWorkerGlobalScope;
|
|
2
|
+
async function loadImage(url) {
|
|
3
|
+
const response = await fetch(url);
|
|
4
|
+
const fileBlob = await response.blob();
|
|
5
|
+
return URL.createObjectURL(fileBlob);
|
|
6
|
+
}
|
|
7
|
+
class ImageWorker {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
// disable if running on main thread
|
|
10
|
+
if (typeof window !== 'undefined') {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
this.threads = new Map();
|
|
14
|
+
this.pendingImages = new Map();
|
|
15
|
+
this.options = options || {
|
|
16
|
+
persisted: false
|
|
17
|
+
};
|
|
18
|
+
this.isSharedWorker = WorkerScope && globalThis instanceof WorkerScope;
|
|
19
|
+
this.initialize();
|
|
20
|
+
}
|
|
21
|
+
fetch(url) {
|
|
22
|
+
const objectUrl = this.cache.get(url);
|
|
23
|
+
if (objectUrl) {
|
|
24
|
+
return Promise.resolve(objectUrl);
|
|
25
|
+
}
|
|
26
|
+
const pending = this.pendingImages.get(url);
|
|
27
|
+
if (pending) {
|
|
28
|
+
return pending;
|
|
29
|
+
}
|
|
30
|
+
const promise = loadImage(url);
|
|
31
|
+
this.pendingImages.set(url, promise);
|
|
32
|
+
return promise.finally(() => {
|
|
33
|
+
this.pendingImages.delete(url);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
initialize() {
|
|
37
|
+
if (this.isSharedWorker) {
|
|
38
|
+
globalThis.onconnect = e => {
|
|
39
|
+
const port = e.ports[0];
|
|
40
|
+
port.onmessage = event => {
|
|
41
|
+
const {
|
|
42
|
+
type
|
|
43
|
+
} = event.data;
|
|
44
|
+
switch (type) {
|
|
45
|
+
case 'connect':
|
|
46
|
+
this.setupThread(event.data.thread, port);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
port.start();
|
|
51
|
+
};
|
|
52
|
+
} else {
|
|
53
|
+
globalThis.onmessage = event => {
|
|
54
|
+
const {
|
|
55
|
+
type
|
|
56
|
+
} = event.data;
|
|
57
|
+
switch (type) {
|
|
58
|
+
case 'connect':
|
|
59
|
+
this.setupThread(event.data.thread, event.ports[0]);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
setupThread(thread, port) {
|
|
66
|
+
this.threads.set(thread, port);
|
|
67
|
+
port.onmessage = event => {
|
|
68
|
+
if (event.type === 'close') {
|
|
69
|
+
this.threads.delete(thread);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const {
|
|
73
|
+
type
|
|
74
|
+
} = event.data;
|
|
75
|
+
switch (type) {
|
|
76
|
+
case 'load':
|
|
77
|
+
void this.request(event.data);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async request(event) {
|
|
83
|
+
const {
|
|
84
|
+
thread,
|
|
85
|
+
url
|
|
86
|
+
} = event;
|
|
87
|
+
const objectUrl = await this.fetch(url);
|
|
88
|
+
const port = this.threads.get(thread);
|
|
89
|
+
port.postMessage({
|
|
90
|
+
type: 'success-response',
|
|
91
|
+
thread,
|
|
92
|
+
url: objectUrl
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export { ImageWorker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-worker.js","sources":["../src/image-worker/worker.ts"],"sourcesContent":["import type { RequestEventData, ThreadInitEventData, WorkerThreadEvent } from './types';\n\nconst WorkerScope = (globalThis as unknown as { SharedWorkerGlobalScope: FunctionConstructor }).SharedWorkerGlobalScope;\n\nasync function loadImage(url: string): Promise<string> {\n const response = await fetch(url);\n const fileBlob = await response.blob();\n return URL.createObjectURL(fileBlob);\n}\n\nexport class ImageWorker {\n declare threads: Map<string, MessagePort>;\n declare pendingImages: Map<string, Promise<string>>;\n declare options: { persisted: boolean };\n declare isSharedWorker: boolean;\n declare cache: Map<string, string>;\n\n constructor(options?: { persisted: boolean }) {\n // disable if running on main thread\n if (typeof window !== 'undefined') {\n return;\n }\n this.threads = new Map();\n this.pendingImages = new Map();\n this.options = options || { persisted: false };\n this.isSharedWorker = WorkerScope && globalThis instanceof WorkerScope;\n this.initialize();\n }\n\n fetch(url: string): Promise<string> {\n const objectUrl = this.cache.get(url);\n\n if (objectUrl) {\n return Promise.resolve(objectUrl);\n }\n\n const pending = this.pendingImages.get(url);\n if (pending) {\n return pending;\n }\n\n const promise = loadImage(url);\n this.pendingImages.set(url, promise);\n return promise.finally(() => {\n this.pendingImages.delete(url);\n });\n }\n\n initialize() {\n if (this.isSharedWorker) {\n (globalThis as unknown as { onconnect: typeof globalThis.onmessage }).onconnect = (e) => {\n const port = e.ports[0];\n port.onmessage = (event: MessageEvent<ThreadInitEventData>) => {\n const { type } = event.data;\n\n switch (type) {\n case 'connect':\n this.setupThread(event.data.thread, port);\n break;\n }\n };\n port.start();\n };\n } else {\n globalThis.onmessage = (event: MessageEvent<ThreadInitEventData>) => {\n const { type } = event.data;\n\n switch (type) {\n case 'connect':\n this.setupThread(event.data.thread, event.ports[0]);\n break;\n }\n };\n }\n }\n\n setupThread(thread: string, port: MessagePort) {\n this.threads.set(thread, port);\n port.onmessage = (event: WorkerThreadEvent) => {\n if (event.type === 'close') {\n this.threads.delete(thread);\n return;\n }\n\n const { type } = event.data;\n switch (type) {\n case 'load':\n void this.request(event.data);\n break;\n }\n };\n }\n\n async request(event: RequestEventData) {\n const { thread, url } = event;\n\n const objectUrl = await this.fetch(url);\n const port = this.threads.get(thread)!;\n port.postMessage({ type: 'success-response', thread, url: objectUrl });\n }\n}\n"],"names":["WorkerScope","globalThis","SharedWorkerGlobalScope","loadImage","url","response","fetch","fileBlob","blob","URL","createObjectURL","ImageWorker","constructor","options","window","threads","Map","pendingImages","persisted","isSharedWorker","initialize","objectUrl","cache","get","Promise","resolve","pending","promise","set","finally","delete","onconnect","e","port","ports","onmessage","event","type","data","setupThread","thread","start","request","postMessage"],"mappings":"AAEA,MAAMA,WAAW,GAAIC,UAAU,CAAiEC,uBAAuB,CAAA;AAEvH,eAAeC,SAASA,CAACC,GAAW,EAAmB;AACrD,EAAA,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAACF,GAAG,CAAC,CAAA;AACjC,EAAA,MAAMG,QAAQ,GAAG,MAAMF,QAAQ,CAACG,IAAI,EAAE,CAAA;AACtC,EAAA,OAAOC,GAAG,CAACC,eAAe,CAACH,QAAQ,CAA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AAA,IAAAA;OAAM,GAAGD,KAAK,CAACE,IAAI,CAAA;AAC3B,MAAA,QAAQD,IAAI;AACV,QAAA,KAAK,MAAM;AACT,UAAA,KAAK,IAAI,CAACK,OAAO,CAACN,KAAK,CAACE,IAAI,CAAC,CAAA;AAC7B,UAAA,MAAA;AACJ,OAAA;KACD,CAAA;AACH,GAAA;EAEA,MAAMI,OAAOA,CAACN,KAAuB,EAAE;IACrC,MAAM;MAAEI,MAAM;AAAEpC,MAAAA,GAAAA;AAAI,KAAC,GAAGgC,KAAK,CAAA;IAE7B,MAAMf,SAAS,GAAG,MAAM,IAAI,CAACf,KAAK,CAACF,GAAG,CAAC,CAAA;IACvC,MAAM6B,IAAI,GAAG,IAAI,CAAClB,OAAO,CAACQ,GAAG,CAACiB,MAAM,CAAE,CAAA;IACtCP,IAAI,CAACU,WAAW,CAAC;AAAEN,MAAAA,IAAI,EAAE,kBAAkB;MAAEG,MAAM;AAAEpC,MAAAA,GAAG,EAAEiB,SAAAA;AAAU,KAAC,CAAC,CAAA;AACxE,GAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive-mirror/experiments",
|
|
3
3
|
"description": "Experimental features for EmberData/WarpDrive",
|
|
4
|
-
"version": "0.0.1-alpha.
|
|
4
|
+
"version": "0.0.1-alpha.106",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
7
7
|
"repository": {
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"./worker-fetch": {
|
|
25
25
|
"default": "./dist/worker-fetch.js"
|
|
26
|
+
},
|
|
27
|
+
"./image-worker": {
|
|
28
|
+
"default": "./dist/image-worker.js"
|
|
29
|
+
},
|
|
30
|
+
"./image-fetch": {
|
|
31
|
+
"default": "./dist/image-fetch.js"
|
|
26
32
|
}
|
|
27
33
|
},
|
|
28
34
|
"files": [
|
|
@@ -41,10 +47,10 @@
|
|
|
41
47
|
},
|
|
42
48
|
"peerDependencies": {
|
|
43
49
|
"@sqlite.org/sqlite-wasm": "3.46.0-build2",
|
|
44
|
-
"@ember-data-mirror/request": "5.4.0-alpha.
|
|
45
|
-
"@ember-data-mirror/request-utils": "5.4.0-alpha.
|
|
46
|
-
"@ember-data-mirror/store": "5.4.0-alpha.
|
|
47
|
-
"@warp-drive-mirror/core-types": "0.0.0-alpha.
|
|
50
|
+
"@ember-data-mirror/request": "5.4.0-alpha.106",
|
|
51
|
+
"@ember-data-mirror/request-utils": "5.4.0-alpha.106",
|
|
52
|
+
"@ember-data-mirror/store": "5.4.0-alpha.106",
|
|
53
|
+
"@warp-drive-mirror/core-types": "0.0.0-alpha.92"
|
|
48
54
|
},
|
|
49
55
|
"peerDependenciesMeta": {
|
|
50
56
|
"@sqlite.org/sqlite-wasm": {
|
|
@@ -53,20 +59,20 @@
|
|
|
53
59
|
},
|
|
54
60
|
"dependencies": {
|
|
55
61
|
"@embroider/macros": "^1.16.1",
|
|
56
|
-
"@warp-drive-mirror/build-config": "0.0.0-alpha.
|
|
62
|
+
"@warp-drive-mirror/build-config": "0.0.0-alpha.43"
|
|
57
63
|
},
|
|
58
64
|
"devDependencies": {
|
|
59
65
|
"@babel/core": "^7.24.5",
|
|
60
66
|
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
61
67
|
"@babel/preset-env": "^7.24.5",
|
|
62
68
|
"@babel/preset-typescript": "^7.24.1",
|
|
63
|
-
"@ember-data-mirror/request": "5.4.0-alpha.
|
|
64
|
-
"@ember-data-mirror/request-utils": "5.4.0-alpha.
|
|
65
|
-
"@ember-data-mirror/store": "5.4.0-alpha.
|
|
66
|
-
"@ember-data-mirror/tracking": "5.4.0-alpha.
|
|
69
|
+
"@ember-data-mirror/request": "5.4.0-alpha.106",
|
|
70
|
+
"@ember-data-mirror/request-utils": "5.4.0-alpha.106",
|
|
71
|
+
"@ember-data-mirror/store": "5.4.0-alpha.106",
|
|
72
|
+
"@ember-data-mirror/tracking": "5.4.0-alpha.106",
|
|
67
73
|
"@glimmer/component": "^1.1.2",
|
|
68
|
-
"@warp-drive-mirror/core-types": "0.0.0-alpha.
|
|
69
|
-
"@warp-drive/internal-config": "5.4.0-alpha.
|
|
74
|
+
"@warp-drive-mirror/core-types": "0.0.0-alpha.92",
|
|
75
|
+
"@warp-drive/internal-config": "5.4.0-alpha.106",
|
|
70
76
|
"ember-source": "~5.8.0",
|
|
71
77
|
"pnpm-sync-dependencies-meta-injected": "0.0.14",
|
|
72
78
|
"@sqlite.org/sqlite-wasm": "3.46.0-build2",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-fetch.d.ts","sourceRoot":"","sources":["../src/image-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/// <reference path="./data-worker.d.ts" />
|
|
4
4
|
/// <reference path="./persisted-cache.d.ts" />
|
|
5
5
|
/// <reference path="./worker-fetch.d.ts" />
|
|
6
|
+
/// <reference path="./image-fetch.d.ts" />
|
|
6
7
|
/// <reference path="./data-worker/worker.d.ts" />
|
|
7
8
|
/// <reference path="./data-worker/fetch.d.ts" />
|
|
8
9
|
/// <reference path="./data-worker/types.d.ts" />
|