@fluidframework/driver-web-cache 2.3.0-288113 → 2.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/driver-web-cache
2
2
 
3
+ ## 2.3.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.2.0
4
8
 
5
9
  Dependency updates only.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-web-cache";
8
- export declare const pkgVersion = "2.3.0-288113";
8
+ export declare const pkgVersion = "2.3.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,UAAU,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/driver-web-cache";
11
- exports.pkgVersion = "2.3.0-288113";
11
+ exports.pkgVersion = "2.3.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.3.0-288113\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.3.0\";\n"]}
@@ -56,7 +56,6 @@ function runTasks(filter, shouldContinueRunning) {
56
56
  newTaskQueue.push(...taskQueue.slice(index));
57
57
  break;
58
58
  }
59
- // Non null asserting here because we are iterating though taskQueue
60
59
  const taskQueueItem = taskQueue[index];
61
60
  if (filter && !filter(taskQueueItem)) {
62
61
  newTaskQueue.push(taskQueueItem);
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleIdleTask.js","sourceRoot":"","sources":["../src/scheduleIdleTask.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,2CAA2C;AAC3C,IAAI,SAAS,GAAoB,EAAE,CAAC;AAEpC,yDAAyD;AACzD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAgB;IAChD,SAAS,CAAC,IAAI,CAAC;QACd,IAAI;KACJ,CAAC,CAAC;IAEH,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAND,4CAMC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,UAAkB,CAAC;IAC9C,IA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AAC;AAC1B,CAAC;AAED,uCAAuC;AACvC,SAAS,gBAAgB,CAAC,QAGzB;IACA,wEAAwE;IACxE,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,WAAW,CAAC,CAAC;IAClE,iBAAiB,GAAG,KAAK,CAAC;IAE1B,4EAA4E;IAC5E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,kBAAkB,EAAE,CAAC;IACtB,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\ninterface TaskQueueItem {\n\t/** The task to run */\n\ttask: () => void;\n}\n\n// A set of tasks that still have to be run\nlet taskQueue: TaskQueueItem[] = [];\n\n// Set to true when we have a pending idle task scheduled\nlet idleTaskScheduled = false;\n\n/**\n * A function that schedules a non critical task to be run when the browser has cycles available\n * @param task - The task to be executed\n * @param options - Optional configuration for the task execution\n */\nexport function scheduleIdleTask(task: () => void) {\n\ttaskQueue.push({\n\t\ttask,\n\t});\n\n\tensureIdleCallback(2000);\n}\n\n/**\n * Ensures an idle callback has been scheduled for the remaining tasks\n */\nfunction ensureIdleCallback(timeout: number = 0) {\n\tif (!idleTaskScheduled) {\n\t\t// Exception added when eslint rule was added, this should be revisited when modifying this code\n\t\tif (self.requestIdleCallback) {\n\t\t\tself.requestIdleCallback(idleTaskCallback);\n\t\t} else {\n\t\t\tconst deadline = Date.now() + 50;\n\t\t\tself.setTimeout(\n\t\t\t\t() =>\n\t\t\t\t\tidleTaskCallback({\n\t\t\t\t\t\ttimeRemaining: () => Math.max(deadline - Date.now(), 0),\n\t\t\t\t\t\tdidTimeout: false,\n\t\t\t\t\t}),\n\t\t\t\ttimeout,\n\t\t\t);\n\t\t}\n\t\tidleTaskScheduled = true;\n\t}\n}\n\n/**\n * Runs tasks from the task queue\n * @param filter - An optional function that will be called for each task to see if it should run.\n * Returns false for tasks that should not run. If omitted all tasks run.\n * @param shouldContinueRunning - An optional function that will be called to determine if\n * we have enough time to continue running tasks. If omitted, we don't stop running tasks.\n */\nfunction runTasks(\n\tfilter?: (taskQueueItem: TaskQueueItem) => boolean,\n\tshouldContinueRunning?: () => boolean,\n) {\n\t// The next value for the task queue\n\tconst newTaskQueue: TaskQueueItem[] = [];\n\n\tfor (let index = 0; index < taskQueue.length; index += 1) {\n\t\tif (shouldContinueRunning && !shouldContinueRunning()) {\n\t\t\t// Add the tasks we didn't get to to the end of the new task queue\n\t\t\tnewTaskQueue.push(...taskQueue.slice(index));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Non null asserting here because we are iterating though taskQueue\n\t\tconst taskQueueItem = taskQueue[index]!;\n\n\t\tif (filter && !filter(taskQueueItem)) {\n\t\t\tnewTaskQueue.push(taskQueueItem);\n\t\t} else {\n\t\t\ttaskQueueItem.task();\n\t\t}\n\t}\n\n\ttaskQueue = newTaskQueue;\n}\n\n// Runs all the tasks in the task queue\nfunction idleTaskCallback(deadline: {\n\ttimeRemaining: () => number;\n\treadonly didTimeout: boolean;\n}) {\n\t// Minimum time that must be available on deadline to run any more tasks\n\tconst minTaskTime = 10;\n\trunTasks(undefined, () => deadline.timeRemaining() > minTaskTime);\n\tidleTaskScheduled = false;\n\n\t// If we didn't run through the entire queue, schedule another idle callback\n\tif (taskQueue.length > 0) {\n\t\tensureIdleCallback();\n\t}\n}\n"]}
1
+ {"version":3,"file":"scheduleIdleTask.js","sourceRoot":"","sources":["../src/scheduleIdleTask.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,2CAA2C;AAC3C,IAAI,SAAS,GAAoB,EAAE,CAAC;AAEpC,yDAAyD;AACzD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAgB;IAChD,SAAS,CAAC,IAAI,CAAC;QACd,IAAI;KACJ,CAAC,CA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C,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,aAAa,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC;IACF,CAAC;IAED,SAAS,GAAG,YAAY,CAAC;AAC1B,CAAC;AAED,uCAAuC;AACvC,SAAS,gBAAgB,CAAC,QAGzB;IACA,wEAAwE;IACxE,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,WAAW,CAAC,CAAC;IAClE,iBAAiB,GAAG,KAAK,CAAC;IAE1B,4EAA4E;IAC5E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,kBAAkB,EAAE,CAAC;IACtB,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\ninterface TaskQueueItem {\n\t/** The task to run */\n\ttask: () => void;\n}\n\n// A set of tasks that still have to be run\nlet taskQueue: TaskQueueItem[] = [];\n\n// Set to true when we have a pending idle task scheduled\nlet idleTaskScheduled = false;\n\n/**\n * A function that schedules a non critical task to be run when the browser has cycles available\n * @param task - The task to be executed\n * @param options - Optional configuration for the task execution\n */\nexport function scheduleIdleTask(task: () => void) {\n\ttaskQueue.push({\n\t\ttask,\n\t});\n\n\tensureIdleCallback(2000);\n}\n\n/**\n * Ensures an idle callback has been scheduled for the remaining tasks\n */\nfunction ensureIdleCallback(timeout: number = 0) {\n\tif (!idleTaskScheduled) {\n\t\t// Exception added when eslint rule was added, this should be revisited when modifying this code\n\t\tif (self.requestIdleCallback) {\n\t\t\tself.requestIdleCallback(idleTaskCallback);\n\t\t} else {\n\t\t\tconst deadline = Date.now() + 50;\n\t\t\tself.setTimeout(\n\t\t\t\t() =>\n\t\t\t\t\tidleTaskCallback({\n\t\t\t\t\t\ttimeRemaining: () => Math.max(deadline - Date.now(), 0),\n\t\t\t\t\t\tdidTimeout: false,\n\t\t\t\t\t}),\n\t\t\t\ttimeout,\n\t\t\t);\n\t\t}\n\t\tidleTaskScheduled = true;\n\t}\n}\n\n/**\n * Runs tasks from the task queue\n * @param filter - An optional function that will be called for each task to see if it should run.\n * Returns false for tasks that should not run. If omitted all tasks run.\n * @param shouldContinueRunning - An optional function that will be called to determine if\n * we have enough time to continue running tasks. If omitted, we don't stop running tasks.\n */\nfunction runTasks(\n\tfilter?: (taskQueueItem: TaskQueueItem) => boolean,\n\tshouldContinueRunning?: () => boolean,\n) {\n\t// The next value for the task queue\n\tconst newTaskQueue: TaskQueueItem[] = [];\n\n\tfor (let index = 0; index < taskQueue.length; index += 1) {\n\t\tif (shouldContinueRunning && !shouldContinueRunning()) {\n\t\t\t// Add the tasks we didn't get to to the end of the new task queue\n\t\t\tnewTaskQueue.push(...taskQueue.slice(index));\n\t\t\tbreak;\n\t\t}\n\n\t\tconst taskQueueItem = taskQueue[index];\n\n\t\tif (filter && !filter(taskQueueItem)) {\n\t\t\tnewTaskQueue.push(taskQueueItem);\n\t\t} else {\n\t\t\ttaskQueueItem.task();\n\t\t}\n\t}\n\n\ttaskQueue = newTaskQueue;\n}\n\n// Runs all the tasks in the task queue\nfunction idleTaskCallback(deadline: {\n\ttimeRemaining: () => number;\n\treadonly didTimeout: boolean;\n}) {\n\t// Minimum time that must be available on deadline to run any more tasks\n\tconst minTaskTime = 10;\n\trunTasks(undefined, () => deadline.timeRemaining() > minTaskTime);\n\tidleTaskScheduled = false;\n\n\t// If we didn't run through the entire queue, schedule another idle callback\n\tif (taskQueue.length > 0) {\n\t\tensureIdleCallback();\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-web-cache";
8
- export declare const pkgVersion = "2.3.0-288113";
8
+ export declare const pkgVersion = "2.3.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,UAAU,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/driver-web-cache";
8
- export const pkgVersion = "2.3.0-288113";
8
+ export const pkgVersion = "2.3.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.3.0-288113\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.3.0\";\n"]}
@@ -52,7 +52,6 @@ function runTasks(filter, shouldContinueRunning) {
52
52
  newTaskQueue.push(...taskQueue.slice(index));
53
53
  break;
54
54
  }
55
- // Non null asserting here because we are iterating though taskQueue
56
55
  const taskQueueItem = taskQueue[index];
57
56
  if (filter && !filter(taskQueueItem)) {
58
57
  newTaskQueue.push(taskQueueItem);
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleIdleTask.js","sourceRoot":"","sources":["../src/scheduleIdleTask.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,2CAA2C;AAC3C,IAAI,SAAS,GAAoB,EAAE,CAAC;AAEpC,yDAAyD;AACzD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAChD,SAAS,CAAC,IAAI,CAAC;QACd,IAAI;KACJ,CAAC,CAAC;IAEH,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,UAAkB,CAAC;IAC9C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,gGAAgG;QAChG,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC9B,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACP,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;YACjC,IAAI,CAAC,UAAU,CACd,GAAG,EAAE,CACJ,gBAAgB,CAAC;gBAChB,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACvD,UAAU,EAAE,KAAK;aACjB,CAAC,EACH,OAAO,CACP,CAAC;QACH,CAAC;QACD,iBAAiB,GAAG,IAAI,CAAC;IAC1B,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,SAAS,QAAQ,CAChB,MAAkD,EAClD,qBAAqC;IAErC,oCAAoC;IACpC,MAAM,YAAY,GAAoB,EAAE,CAAC;IAEzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1D,IAAI,qBAAqB,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC;YACvD,kEAAkE;YAClE,YAAY,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7C,MAAM;QACP,CAAC;QAED,oEAAoE;QACpE,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAE,CAAC;QAExC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;YACtC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,aAAa,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC;IACF,CAAC;IAED,SAAS,GAAG,YAAY,CAAC;AAC1B,CAAC;AAED,uCAAuC;AACvC,SAAS,gBAAgB,CAAC,QAGzB;IACA,wEAAwE;IACxE,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,WAAW,CAAC,CAAC;IAClE,iBAAiB,GAAG,KAAK,CAAC;IAE1B,4EAA4E;IAC5E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,kBAAkB,EAAE,CAAC;IACtB,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\ninterface TaskQueueItem {\n\t/** The task to run */\n\ttask: () => void;\n}\n\n// A set of tasks that still have to be run\nlet taskQueue: TaskQueueItem[] = [];\n\n// Set to true when we have a pending idle task scheduled\nlet idleTaskScheduled = false;\n\n/**\n * A function that schedules a non critical task to be run when the browser has cycles available\n * @param task - The task to be executed\n * @param options - Optional configuration for the task execution\n */\nexport function scheduleIdleTask(task: () => void) {\n\ttaskQueue.push({\n\t\ttask,\n\t});\n\n\tensureIdleCallback(2000);\n}\n\n/**\n * Ensures an idle callback has been scheduled for the remaining tasks\n */\nfunction ensureIdleCallback(timeout: number = 0) {\n\tif (!idleTaskScheduled) {\n\t\t// Exception added when eslint rule was added, this should be revisited when modifying this code\n\t\tif (self.requestIdleCallback) {\n\t\t\tself.requestIdleCallback(idleTaskCallback);\n\t\t} else {\n\t\t\tconst deadline = Date.now() + 50;\n\t\t\tself.setTimeout(\n\t\t\t\t() =>\n\t\t\t\t\tidleTaskCallback({\n\t\t\t\t\t\ttimeRemaining: () => Math.max(deadline - Date.now(), 0),\n\t\t\t\t\t\tdidTimeout: false,\n\t\t\t\t\t}),\n\t\t\t\ttimeout,\n\t\t\t);\n\t\t}\n\t\tidleTaskScheduled = true;\n\t}\n}\n\n/**\n * Runs tasks from the task queue\n * @param filter - An optional function that will be called for each task to see if it should run.\n * Returns false for tasks that should not run. If omitted all tasks run.\n * @param shouldContinueRunning - An optional function that will be called to determine if\n * we have enough time to continue running tasks. If omitted, we don't stop running tasks.\n */\nfunction runTasks(\n\tfilter?: (taskQueueItem: TaskQueueItem) => boolean,\n\tshouldContinueRunning?: () => boolean,\n) {\n\t// The next value for the task queue\n\tconst newTaskQueue: TaskQueueItem[] = [];\n\n\tfor (let index = 0; index < taskQueue.length; index += 1) {\n\t\tif (shouldContinueRunning && !shouldContinueRunning()) {\n\t\t\t// Add the tasks we didn't get to to the end of the new task queue\n\t\t\tnewTaskQueue.push(...taskQueue.slice(index));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Non null asserting here because we are iterating though taskQueue\n\t\tconst taskQueueItem = taskQueue[index]!;\n\n\t\tif (filter && !filter(taskQueueItem)) {\n\t\t\tnewTaskQueue.push(taskQueueItem);\n\t\t} else {\n\t\t\ttaskQueueItem.task();\n\t\t}\n\t}\n\n\ttaskQueue = newTaskQueue;\n}\n\n// Runs all the tasks in the task queue\nfunction idleTaskCallback(deadline: {\n\ttimeRemaining: () => number;\n\treadonly didTimeout: boolean;\n}) {\n\t// Minimum time that must be available on deadline to run any more tasks\n\tconst minTaskTime = 10;\n\trunTasks(undefined, () => deadline.timeRemaining() > minTaskTime);\n\tidleTaskScheduled = false;\n\n\t// If we didn't run through the entire queue, schedule another idle callback\n\tif (taskQueue.length > 0) {\n\t\tensureIdleCallback();\n\t}\n}\n"]}
1
+ {"version":3,"file":"scheduleIdleTask.js","sourceRoot":"","sources":["../src/scheduleIdleTask.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,2CAA2C;AAC3C,IAAI,SAAS,GAAoB,EAAE,CAAC;AAEpC,yDAAyD;AACzD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAChD,SAAS,CAAC,IAAI,CAAC;QACd,IAAI;KACJ,CAAC,CAAC;IAEH,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,UAAkB,CAAC;IAC9C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,gGAAgG;QAChG,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC9B,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACP,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;YACjC,IAAI,CAAC,UAAU,CACd,GAAG,EAAE,CACJ,gBAAgB,CAAC;gBAChB,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,Q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Content":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\ninterface TaskQueueItem {\n\t/** The task to run */\n\ttask: () => void;\n}\n\n// A set of tasks that still have to be run\nlet taskQueue: TaskQueueItem[] = [];\n\n// Set to true when we have a pending idle task scheduled\nlet idleTaskScheduled = false;\n\n/**\n * A function that schedules a non critical task to be run when the browser has cycles available\n * @param task - The task to be executed\n * @param options - Optional configuration for the task execution\n */\nexport function scheduleIdleTask(task: () => void) {\n\ttaskQueue.push({\n\t\ttask,\n\t});\n\n\tensureIdleCallback(2000);\n}\n\n/**\n * Ensures an idle callback has been scheduled for the remaining tasks\n */\nfunction ensureIdleCallback(timeout: number = 0) {\n\tif (!idleTaskScheduled) {\n\t\t// Exception added when eslint rule was added, this should be revisited when modifying this code\n\t\tif (self.requestIdleCallback) {\n\t\t\tself.requestIdleCallback(idleTaskCallback);\n\t\t} else {\n\t\t\tconst deadline = Date.now() + 50;\n\t\t\tself.setTimeout(\n\t\t\t\t() =>\n\t\t\t\t\tidleTaskCallback({\n\t\t\t\t\t\ttimeRemaining: () => Math.max(deadline - Date.now(), 0),\n\t\t\t\t\t\tdidTimeout: false,\n\t\t\t\t\t}),\n\t\t\t\ttimeout,\n\t\t\t);\n\t\t}\n\t\tidleTaskScheduled = true;\n\t}\n}\n\n/**\n * Runs tasks from the task queue\n * @param filter - An optional function that will be called for each task to see if it should run.\n * Returns false for tasks that should not run. If omitted all tasks run.\n * @param shouldContinueRunning - An optional function that will be called to determine if\n * we have enough time to continue running tasks. If omitted, we don't stop running tasks.\n */\nfunction runTasks(\n\tfilter?: (taskQueueItem: TaskQueueItem) => boolean,\n\tshouldContinueRunning?: () => boolean,\n) {\n\t// The next value for the task queue\n\tconst newTaskQueue: TaskQueueItem[] = [];\n\n\tfor (let index = 0; index < taskQueue.length; index += 1) {\n\t\tif (shouldContinueRunning && !shouldContinueRunning()) {\n\t\t\t// Add the tasks we didn't get to to the end of the new task queue\n\t\t\tnewTaskQueue.push(...taskQueue.slice(index));\n\t\t\tbreak;\n\t\t}\n\n\t\tconst taskQueueItem = taskQueue[index];\n\n\t\tif (filter && !filter(taskQueueItem)) {\n\t\t\tnewTaskQueue.push(taskQueueItem);\n\t\t} else {\n\t\t\ttaskQueueItem.task();\n\t\t}\n\t}\n\n\ttaskQueue = newTaskQueue;\n}\n\n// Runs all the tasks in the task queue\nfunction idleTaskCallback(deadline: {\n\ttimeRemaining: () => number;\n\treadonly didTimeout: boolean;\n}) {\n\t// Minimum time that must be available on deadline to run any more tasks\n\tconst minTaskTime = 10;\n\trunTasks(undefined, () => deadline.timeRemaining() > minTaskTime);\n\tidleTaskScheduled = false;\n\n\t// If we didn't run through the entire queue, schedule another idle callback\n\tif (taskQueue.length > 0) {\n\t\tensureIdleCallback();\n\t}\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.45.1"
8
+ "packageVersion": "7.47.8"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/driver-web-cache",
3
- "version": "2.3.0-288113",
3
+ "version": "2.3.0",
4
4
  "description": "Implementation of the driver caching API for a web browser",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,21 +47,21 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/public.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/core-interfaces": "2.3.0-288113",
51
- "@fluidframework/core-utils": "2.3.0-288113",
52
- "@fluidframework/odsp-driver-definitions": "2.3.0-288113",
53
- "@fluidframework/telemetry-utils": "2.3.0-288113",
50
+ "@fluidframework/core-interfaces": "~2.3.0",
51
+ "@fluidframework/core-utils": "~2.3.0",
52
+ "@fluidframework/odsp-driver-definitions": "~2.3.0",
53
+ "@fluidframework/telemetry-utils": "~2.3.0",
54
54
  "idb": "^6.1.2"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@arethetypeswrong/cli": "^0.15.2",
58
58
  "@biomejs/biome": "~1.8.3",
59
- "@fluid-tools/build-cli": "^0.43.0",
59
+ "@fluid-tools/build-cli": "^0.46.0",
60
60
  "@fluidframework/build-common": "^2.0.3",
61
- "@fluidframework/build-tools": "^0.43.0",
61
+ "@fluidframework/build-tools": "^0.46.0",
62
62
  "@fluidframework/driver-web-cache-previous": "npm:@fluidframework/driver-web-cache@2.2.0",
63
- "@fluidframework/eslint-config-fluid": "^5.3.0",
64
- "@microsoft/api-extractor": "^7.45.1",
63
+ "@fluidframework/eslint-config-fluid": "^5.4.0",
64
+ "@microsoft/api-extractor": "7.47.8",
65
65
  "@types/jest": "29.5.3",
66
66
  "@types/node": "^18.19.0",
67
67
  "concurrently": "^8.2.1",
@@ -74,7 +74,8 @@
74
74
  "typescript": "~5.4.5"
75
75
  },
76
76
  "typeValidation": {
77
- "broken": {}
77
+ "broken": {},
78
+ "entrypoint": "internal"
78
79
  },
79
80
  "scripts": {
80
81
  "api": "fluid-build . --task api",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-web-cache";
9
- export const pkgVersion = "2.3.0-288113";
9
+ export const pkgVersion = "2.3.0";
@@ -71,8 +71,7 @@ function runTasks(
71
71
  break;
72
72
  }
73
73
 
74
- // Non null asserting here because we are iterating though taskQueue
75
- const taskQueueItem = taskQueue[index]!;
74
+ const taskQueueItem = taskQueue[index];
76
75
 
77
76
  if (filter && !filter(taskQueueItem)) {
78
77
  newTaskQueue.push(taskQueueItem);
package/tsconfig.json CHANGED
@@ -7,5 +7,6 @@
7
7
  "outDir": "./lib",
8
8
  "skipLibCheck": true,
9
9
  "exactOptionalPropertyTypes": false,
10
+ "noUncheckedIndexedAccess": false,
10
11
  },
11
12
  }