| 1 | # notable changes in clover's typescript library |
| 2 | |
| 3 | ## v7 |
| 4 | |
| 5 | ### features |
| 6 | |
| 7 | - `meta`'s auto-embed feature now sets all the twitter tags, not just thumbnail. |
| 8 | sorry i might have been dumb when doing the first version of this. |
| 9 | |
| 10 | ## v6 |
| 11 | |
| 12 | ### breaking |
| 13 | |
| 14 | - `meta` fields now distinguishes `undefined` and `null`. `null` acts as "unset" |
| 15 | and `undefined` acts as "fallthru to template". |
| 16 | - rename `error` to `exception` |
| 17 | |
| 18 | ### features |
| 19 | |
| 20 | - `meta` |
| 21 | - `title` can be optional for composition reasons. |
| 22 | - `embed.thumbnailAlt` sets `og:image:alt` + `twitter:image:alt`. |
| 23 | - emits `og:*` tags with `property=` instead of `name=`. |
| 24 | |
| 25 | ## v5 |
| 26 | |
| 27 | ### breaking |
| 28 | |
| 29 | - `render` has been deleted because it was not being used anymore. sad day |
| 30 | because i will never get to prove how easy it is to write a stable Suspense |
| 31 | and PPR implementations in less than 300 lines each. |
| 32 | - deprecated html escaping methods moved to `string.escapeHtmlContent` and |
| 33 | `string.escapeHtmlAttr` |
| 34 | - `render/meta` is moved to `meta`, with a new API for rendering tags |
| 35 | - `meta.render` is renamed to `meta.toHtml`, arguments re-ordered |
| 36 | - `meta.toTags` creates an object compatible with TanStack Router |
| 37 | - the `extra` object now takes an array of React-like elements among some |
| 38 | other supported forms. |
| 39 | - `log` and `progress` have recieved so many bug-fix changes that it is worth |
| 40 | ensuring your application edge cases still work as expected. |
| 41 | - `string.formatByteSize` formats differently. |
| 42 | |
| 43 | ### features |
| 44 | |
| 45 | - new library `http`. |
| 46 | - new library `math`. |
| 47 | - new library `arrays`. |
| 48 | - `log` |
| 49 | - many many many many rendering bug-fixes |
| 50 | - `writeError` writes to stderr with proper logic. |
| 51 | - buffering auto-flushes synchronously when it grows past 64k. |
| 52 | - custom scopes |
| 53 | - `string` |
| 54 | - `formatDurationLetters` spans years to seconds, plus infinity and negatives. |
| 55 | - `mime`'s database contains `.eot` for embedded opentype fonts. |
| 56 | - `async.deferred`. |
| 57 | - `queue.setConcurrency`. |
| 58 | - `subprocess.lookupProcessOnPort`. |
| 59 | - `subprocess/ffmpeg` progress handles fractional framerates (progress bug). |
| 60 | - `string/ansi` gains `clearToEndOfScreen`. |
| 61 | - `progress` estimation, maxHeight, and timer bug fixes. |
| 62 | |
| 63 | ## v4 |
| 64 | |
| 65 | ### breaking |
| 66 | |
| 67 | - the `.ts` suffix in the module name has been dropped |
| 68 | - `log` |
| 69 | - rename `writeLine` to `writeOutput` and `writeError` |
| 70 | - `startWidget` returns `null` if the host is incapable of it |
| 71 | - it also no longer takes `onChange`. call `redraw` on the returned |
| 72 | `WidgetInstance`. |
| 73 | - rename `HeadlessWidgetHost` to `WidgetHost` |
| 74 | - rename `headlessWidgetHost` to `createTerminalWidgetHost` |
| 75 | - rename `HeadlessWidgetEnv` to `TerminalWidgetHostOptions` |
| 76 | - rename `replaceGlobalDestination` to `replaceGlobalMessageDestination` |
| 77 | - rename `formatMessage` to `formatAnsiMessage` |
| 78 | - `WidgetHostOptions` now takes a `lockTerminal` function instead of |
| 79 | `writeInteractive`/`writeOutput` directly. the locking function returns an |
| 80 | interface with these functions, which better aligns with how the draw lock |
| 81 | actually works. additionally, this allows writing more accurate tty bindings |
| 82 | for non-node.js runtimes. the reason for these changes is to support |
| 83 | partially written lines, and handle when external sources desire to do the |
| 84 | same. |
| 85 | - in `getDrawLock`, new required argument `mode`, which can be set to `short` |
| 86 | or `long` to affect how synchronization works. releasing the lock requires |
| 87 | you to give some information about where the cursor was moved to. |
| 88 | - `string/ansi` |
| 89 | - rename `trimToWidth` to `trimForTerminal` |
| 90 | |
| 91 | deprecations without removals: |
| 92 | |
| 93 | - `render.ts` will be deleted with no replacement. in the downstream `sitegen` |
| 94 | project, the codebase is moving to Marko after depending on both renderers. |
| 95 | |
| 96 | ### features |
| 97 | |
| 98 | - you can write `log` messages without a newline. on older libraries, this will |
| 99 | show up as a newline per message since that version was not capable of |
| 100 | displaying it. but done not as a breaking change. |
| 101 | - `process.{stdout,stderr}.write` is intercepted to avoid log interweaving with |
| 102 | `log.ts`/`progress.ts`. this is only done when a widget is created (for |
| 103 | example, calling `progress.start`), so patches are not applied when not |
| 104 | needed. if patching globals is undesirable, you can use an alternative widget |
| 105 | host by calling |
| 106 | `log.replaceGlobalWidgetHost(log.simpleNodeProcessWidgetHost(process))` |
| 107 | - `log.startWidget` returns a `WidgetInstance`, including a mutable `fps` |
| 108 | property. |
| 109 | - `progress.ts` node gains `node.log.write("word ");` to write a message without |
| 110 | a newline. |
| 111 | - `async.delay` handles timers longer than 23 days and `Infinity`. |
| 112 | - `Lru.revive` recieves bug fixes. this function previously didn't really work. |
| 113 | - `ansi` gets more cursor control constants |
| 114 | |
| 115 | ## v3 |
| 116 | |
| 117 | ### breaking |
| 118 | |
| 119 | - `log` dispatching reworked |
| 120 | - delete `log/headless.ts` by moving it into `log` |
| 121 | - headless scopes now emit `log.Message` objects instead of ANSI text, |
| 122 | templating is done in the consumer of the headless logging scope. |
| 123 | - rename `HeadlessWidgetEnv.wait` to `delay`, matching `async.delay` |
| 124 | - `progress` had everything besides `start` and `Node` heavily altered |
| 125 | - promote to top level namespace `lib/progress.ts` |
| 126 | - `Node.estimate` -> `Node.total` |
| 127 | - rename `.null` to `.nullNode` |
| 128 | - `.SortNode` -> `.ReadOnlyNode` |
| 129 | - `.getUnicodeBar` -> `.formatUnicodeBar` |
| 130 | - rework headless rendering story, rename `.Headless` -> `.Root` |
| 131 | - `.rootFromWidgetHost` to source from a widget host |
| 132 | - remove `.internals`, use `.Root` |
| 133 | - deleted `assert.FINITE` |
| 134 | |
| 135 | ### features |
| 136 | |
| 137 | - `progress` has expanded documentation and use cases. |
| 138 | - create headless nodes with `Root` (subclass of `Events`) |
| 139 | - streaming over the wire via `encodeEventStream`, `encodeEventStream`, |
| 140 | `encodeByteStream`, `encodeByteStream`. these APIs produce JSON and Binary |
| 141 | `ReadableStream`s. with work to make `log` better supported in the browser, |
| 142 | progress streams are fully consumable from within a web browser. |
| 143 | - `.attach` to display a decoded root |
| 144 | - expose `.formatAnsi` for external use |
| 145 | - `log` slowly moves towards maturity |
| 146 | - add `.tee` (and `log.Scope.tee`) |
| 147 | - in Node.js, `log` will inject into `console.*` to prevent interweaving logs |
| 148 | with widget output text. this injection is enabled regardless of if widgets |
| 149 | are actually running, but do not otherwise change their behavior. |
| 150 | - `log` scopes render differently in the terminal now |
| 151 | - browser support by calling the correct `console` api to signal warnings and |
| 152 | errors correctly. |
| 153 | - fix assertion failure when creating a widget in the same frame a log message |
| 154 | is written. |
| 155 | - new library `Events.ts` |
| 156 | - new library `bytes.ts` (subject to being moved as it is one function) |
| 157 | - new library `stream.ts` |
| 158 | - new library `testing.ts` |
| 159 | - `string` |
| 160 | - add `encodeUtf8` and `decodeUtf8` |
| 161 | - add `formatByteSize` and `formatBinaryByteSize` and `formatDurationLetters`, |
| 162 | all subject to change as `progress` is used more. |
| 163 | - `async` |
| 164 | - add `.Cancelable` type, constructed with `.makeCancelable` |
| 165 | - add `.delay` |
| 166 | - `ts` |
| 167 | - add `EmptyObject` |
| 168 | - add `Json`, `ToJson`, and `JsonValue` |
| 169 | - add `mixin` |
| 170 | |
| 171 | ## v2 |
| 172 | |
| 173 | ### breaking |
| 174 | |
| 175 | - rework `log.Scope`, remove self call signature so that the `log` module |
| 176 | satisfies `log.Scope`, while adding `log` and `debug` for explicit debugging |
| 177 | logs. documentation prescribes doing `const console = log.scope("module");`. |
| 178 | - remove `packaging.ts` |
| 179 | - move `log/ansi.ts` into `string/ansi.ts` |
| 180 | - move ansi related `string.ts` functions into `string/ansi.ts` |
| 181 | |
| 182 | ### features |
| 183 | |
| 184 | - top level readme now explains general usage patterns. more docs overall. |
| 185 | - new library `async.ts` |
| 186 | - new library `Lru.ts` |
| 187 | - new library `mime.ts` |
| 188 | - new library `render.ts`, `render/jsx-runtime.ts`, `render/meta.ts` |
| 189 | - new library `node.ts` |
| 190 | - new library `subprocess.ts`, `subprocess/ffmpeg.ts` |
| 191 | - add `string.escapeRegExp()` |
| 192 | - add `stack.capture()` |
| 193 | |
| 194 | ## v1 |
| 195 | |
| 196 | - new library `assert.ts` |
| 197 | - new library `log.ts` |
| 198 | - new library `packaging.ts` |
| 199 | - new library `queue.ts` |
| 200 | - new library `string.ts` |
| 201 | - new library `ts.ts` |