From b00dc80946cd13f4f0d0749ed7edd87e0d8fc9be Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Fri, 26 Jan 2024 09:23:24 -0800 Subject: [PATCH] Update some TODOs for a 2.0 release --- archive/archive.js | 2 +- archive/compress.js | 7 ++++--- archive/decompress.js | 4 +++- archive/events.js | 6 ++++++ build/README.md | 2 ++ build/image/webp-shim/src/webp.c | 2 ++ image/webp-shim/webp-shim.js | 2 ++ 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/archive/archive.js b/archive/archive.js index 63e5db1..7cfa3c7 100644 --- a/archive/archive.js +++ b/archive/archive.js @@ -9,7 +9,7 @@ * Copyright(c) 2011 Google Inc. */ -// TODO: When up-revving to a major new version, remove this module. +// TODO(2.0): When up-revving to a major new version, remove this module. import { UnarchiveAppendEvent, UnarchiveErrorEvent, UnarchiveEvent, UnarchiveEventType, UnarchiveExtractEvent, UnarchiveFinishEvent, UnarchiveInfoEvent, diff --git a/archive/compress.js b/archive/compress.js index 1afe8c8..b84df5a 100644 --- a/archive/compress.js +++ b/archive/compress.js @@ -10,7 +10,8 @@ import { ZipCompressionMethod, getConnectedPort } from './common.js'; -// NOTE: THIS IS A VERY HACKY WORK-IN-PROGRESS! THE API IS NOT FROZEN! USE AT YOUR OWN RISK! +// TODO(2.0): Remove this comment. +// NOTE: THIS IS A WORK-IN-PROGRESS! THE API IS NOT FROZEN! USE AT YOUR OWN RISK! /** * @typedef FileInfo An object that is sent to the implementation to represent a file to zip. @@ -52,8 +53,8 @@ export const CompressStatus = { /** * A thing that zips files. - * NOTE: THIS IS A VERY HACKY WORK-IN-PROGRESS! THE API IS NOT FROZEN! USE AT YOUR OWN RISK! - * TODO: Make a streaming / event-driven API. + * NOTE: THIS IS A WORK-IN-PROGRESS! THE API IS NOT FROZEN! USE AT YOUR OWN RISK! + * TODO(2.0): Add semantic onXXX methods for an event-driven API. */ export class Zipper { /** diff --git a/archive/decompress.js b/archive/decompress.js index 5613657..e3717f4 100644 --- a/archive/decompress.js +++ b/archive/decompress.js @@ -15,7 +15,7 @@ import { getConnectedPort } from './common.js'; import { findMimeType } from '../file/sniffer.js'; // Exported as a convenience (and also because this module used to contain these). -// TODO(bitjs): Remove this export in a future release? +// TODO(2.0): Remove this export, since they have moved to events.js. export { UnarchiveAppendEvent, UnarchiveErrorEvent, @@ -288,6 +288,8 @@ export class Untarrer extends Unarchiver { getScriptFileName() { return './untar.js'; }; } +// TODO(2.0): When up-revving to a major new version, remove the string type for options. + /** * Factory method that creates an unarchiver based on the byte signature found * in the ArrayBuffer. diff --git a/archive/events.js b/archive/events.js index 8367bc3..ccdafc4 100644 --- a/archive/events.js +++ b/archive/events.js @@ -6,6 +6,12 @@ * Copyright(c) 2023 Google Inc. */ +// TODO(2.0): Consider deprecating the Event subclasses here and: +// 1) Make @typedef structures in jsdoc for all the payloads +// 2) Use CustomEvent for payload event propagation +// 3) Add semantic methods to the archivers (onExtract, onProgress) like the image parsers. +// 4) Move everything into common.js ? + /** * The UnarchiveEvent types. */ diff --git a/build/README.md b/build/README.md index 9494ef4..1f96a6a 100644 --- a/build/README.md +++ b/build/README.md @@ -20,3 +20,5 @@ Assuming you have cloned the repository in /path/to/bitjs: Various library files will be output to /path/to/bitjs/. For example, the /path/to/bitjs/image/webp-shim/ directory will now contain update webp-shim-module.js and webp-shim-module.wasm files. + +# TODO(2.0): Remove this. diff --git a/build/image/webp-shim/src/webp.c b/build/image/webp-shim/src/webp.c index 5deebc2..3b3925e 100644 --- a/build/image/webp-shim/src/webp.c +++ b/build/image/webp-shim/src/webp.c @@ -9,6 +9,8 @@ * Copyright(c) 2020 Google Inc. */ +// TODO(2.0): Remove this. It seems unnecessary given WebP is universally supported now. + #include #include #include "emscripten.h" diff --git a/image/webp-shim/webp-shim.js b/image/webp-shim/webp-shim.js index f9f607b..0a3122a 100644 --- a/image/webp-shim/webp-shim.js +++ b/image/webp-shim/webp-shim.js @@ -6,6 +6,8 @@ * Copyright(c) 2020 Google Inc. */ +// TODO(2.0): Remove this. It seems unnecessary given WebP is universally supported now. + const url = import.meta.url; if (!url.endsWith('/webp-shim.js')) { throw 'webp-shim must be loaded as webp-shim.js';