hazo_files 1.5.1 → 1.5.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.
package/CHANGE_LOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.2] - 2026-05-18
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- `useFileUpload` no longer emits the React dev warning *"The result of getServerSnapshot should be cached to avoid an infinite loop"*. The third argument to `useSyncExternalStore` now points at a module-level frozen `EMPTY_ACTIVE_JOBS` constant instead of allocating a fresh `[]` per call, so React's reference identity check holds across renders.
|
|
12
|
+
|
|
8
13
|
## 1.5.0
|
|
9
14
|
|
|
10
15
|
- **NEW**: `background_upload` module — UploadManager, Job, PipelineExecutor for pipelines that survive React component unmount.
|
|
@@ -391,6 +391,7 @@ function HazoFileUploadProvider({
|
|
|
391
391
|
|
|
392
392
|
// src/background_upload/react/use-file-upload.ts
|
|
393
393
|
var import_react4 = require("react");
|
|
394
|
+
var EMPTY_ACTIVE_JOBS = Object.freeze([]);
|
|
394
395
|
function useFileUpload() {
|
|
395
396
|
const manager = (0, import_react4.useContext)(FileUploadContext);
|
|
396
397
|
if (!manager) {
|
|
@@ -417,7 +418,7 @@ function useFileUpload() {
|
|
|
417
418
|
snapshot_ref.current = next;
|
|
418
419
|
return next;
|
|
419
420
|
},
|
|
420
|
-
() =>
|
|
421
|
+
() => EMPTY_ACTIVE_JOBS
|
|
421
422
|
);
|
|
422
423
|
const submit_batch = (0, import_react4.useCallback)(
|
|
423
424
|
(options) => manager.submit_batch(options),
|
|
@@ -351,6 +351,7 @@ function HazoFileUploadProvider({
|
|
|
351
351
|
|
|
352
352
|
// src/background_upload/react/use-file-upload.ts
|
|
353
353
|
import { useContext, useCallback, useRef as useRef2, useSyncExternalStore } from "react";
|
|
354
|
+
var EMPTY_ACTIVE_JOBS = Object.freeze([]);
|
|
354
355
|
function useFileUpload() {
|
|
355
356
|
const manager = useContext(FileUploadContext);
|
|
356
357
|
if (!manager) {
|
|
@@ -377,7 +378,7 @@ function useFileUpload() {
|
|
|
377
378
|
snapshot_ref.current = next;
|
|
378
379
|
return next;
|
|
379
380
|
},
|
|
380
|
-
() =>
|
|
381
|
+
() => EMPTY_ACTIVE_JOBS
|
|
381
382
|
);
|
|
382
383
|
const submit_batch = useCallback(
|
|
383
384
|
(options) => manager.submit_batch(options),
|