You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 40cd0c5
Browse filesBrowse the repository at this point in the historyBrowse files
Tracking issue: #342
## Stack context
Part 30 of the Option 5 folder-feature stack.
- Previous: #339
- Next: feature-graph guardrails and final documentation
Review this PR as the incremental diff against #339.
## Summary
- split cache-specific support types into internal
`src/storage/CacheTypes.res`
- return `WebWorkersTypes` to the Workers folder
- update Cache, CacheStorage, Window, browser globals, and worker scopes
to use the owning helper modules
- fold the shared Blob/File type identity into foundational `DOM.res`
- remove the internal `BaseFile` helper while preserving
`FileTypes.blob` and `FileTypes.file` aliases
## Why this cleanup is last
Earlier PRs temporarily kept `WebWorkersTypes` with Storage and
`BaseFile` in core so folder moves could remain mechanical. With the
complete graph in place, the ownership directions are now explicit:
Workers depends on Storage, and File aliases the small foundational
identities in DOM.
## Resolved temporary state
- cache and worker support types no longer share one misplaced helper
module
- the standalone `BaseFile` module is removed
- no module-slice exception is required
## Review focus
- preservation of Blob/File type identity through the new DOM aliases
- cache/worker helper ownership
- the unchanged public feature closures
## Verification
- `node_modules/.bin/rescript build --prod --features WebAPI.DOM`
- `node_modules/.bin/rescript build --prod --features WebAPI.Storage`
- `node_modules/.bin/rescript build --prod --features WebAPI.Workers`
- `node_modules/.bin/rescript build --prod --features WebAPI.Window`
- `npm run build`
- `npm test`
- `npm run format:check`
- `git diff --check`
Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the Service Worker life cycle. The Cache interface is also available in window contexts.
3
+
[See Cache on MDN](https://developer.mozilla.org/docs/Web/API/Cache)
4
+
*/
5
+
@editor.completeFrom(Cache)
6
+
typecache=private {}
7
+
8
+
/**
9
+
The storage for Cache objects.
10
+
[See CacheStorage on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage)
Copy file name to clipboardExpand all lines: src/workers/WebWorkersTypes.res
+1-26Lines changed: 1 addition & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,3 @@
1
-
/**
2
-
Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the WebApiServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec.
3
-
[See Cache on MDN](https://developer.mozilla.org/docs/Web/API/Cache)
4
-
*/
5
-
@editor.completeFrom(Cache)
6
-
typecache=private {}
7
-
8
-
/**
9
-
The storage for Cache objects.
10
-
[See CacheStorage on MDN](https://developer.mozilla.org/docs/Web/API/CacheStorage)
11
-
*/
12
-
@editor.completeFrom(CacheStorage)
13
-
typecacheStorage=private {}
14
-
15
-
typecacheQueryOptions= {
16
-
mutableignoreSearch?: bool,
17
-
mutableignoreMethod?: bool,
18
-
mutableignoreVary?: bool,
19
-
}
20
-
21
-
typemultiCacheQueryOptions= {
22
-
...cacheQueryOptions,
23
-
mutablecacheName?: string,
24
-
}
25
-
26
1
typesharedWorker
27
2
28
3
/**
@@ -38,7 +13,7 @@ type workerGlobalScope = private {
38
13
/**
39
14
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/caches)
40
15
*/
41
-
caches: cacheStorage,
16
+
caches: CacheTypes.cacheStorage,
42
17
/**
43
18
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/crossOriginIsolated)
0 commit comments