From 234667cc31f70deeeb32d6a37d3d649bb08a451f Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Mon, 10 Nov 2025 05:17:29 +0800 Subject: [PATCH] =?UTF-8?q?Add=20@linonetwo=E2=80=99s=20missing=20change?= =?UTF-8?q?=20notes=20(#9409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs (cherry picked from commit eb5d2c50c0e45712eafda0b0e79bd1816b5f8a5b) (cherry picked from commit eecfd35336964c756547f9ea622566f8bab02709) * typo (cherry picked from commit d9129bcaf3f4face613b3f6ccfe06ce6ed45b2d5) --- .../tiddlers/releasenotes/5.4.0/#8258.tid | 36 +++++++++++++++++++ .../tiddlers/releasenotes/5.4.0/#9078.tid | 15 ++++++++ 2 files changed, 51 insertions(+) create mode 100644 editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid create mode 100644 editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid diff --git a/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid b/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid new file mode 100644 index 000000000..14f282c9a --- /dev/null +++ b/editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid @@ -0,0 +1,36 @@ +title: $:/changenotes/5.4.0/#8258 +description: Add ability to serialize WikiText AST nodes back to wikitext strings +tags: $:/tags/ChangeNote +change-type: feature +change-category: developer +links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/8258 +github-contributors: linonetwo + +This PR introduces a new utility `$tw.utils.serializeWikitextParseTree()` that can convert WikiText Abstract Syntax Tree (AST) nodes back into wikitext strings. + +There is also a utility `serializeAttribute` for a single attribute node, like an attribute of a widget. + +!! Use Cases + +* Programmatically manipulating wikitext content by modifying the AST, and use this to write it back +* Building WYSIWYG editors +* Creating wikitext formatters and linters + +!! Implementation + +* New core plugin `tiddlywiki/wikitext-serialize` containing most of the logic +* Separate serialize handlers for each WikiText rule as `module-type: wikiruleserializer` +* Test suite with tag `$:/tags/wikitext-serialize-test-spec` +* It uses each parser's name as rule (`nextMatch.rule.name`), each AST node that needs serialization has a `type` property matching the rule name + +!! Example Usage + +```javascript +// Parse a tiddler's wikitext to AST +var parseTree = $tw.wiki.parseTiddler("MyTiddler").tree; + +// Serialize AST back to wikitext string +var wikitextString = $tw.utils.serializeWikitextParseTree(parseTree).trimEnd(); +``` + +This feature offers new tools for JS plugin developers. It is not a user-facing change. diff --git a/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid b/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid new file mode 100644 index 000000000..de0fe92c0 --- /dev/null +++ b/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid @@ -0,0 +1,15 @@ +title: $:/changenotes/5.4.0/#9078 +description: Web server get-file route now supports HTTP Range headers and streaming +tags: $:/tags/ChangeNote +change-type: enhancement +change-category: nodejs +links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9078 +github-contributors: linonetwo + +The web server's `get-file` route now supports HTTP Range requests and file streaming, enabling better loading and playback of large media files. + +!! Features + +* HTTP Range header: Enables partial content delivery with `206 Partial Content` responses, which is used when the user drags the progress bar in video/audio playback +* Streaming file delivery: Browsers can now properly seek and stream video files from the `/files/` directory. Files are read using Node.js streams for better performance and memory efficiency. +* Resumable downloads: To save interrupted downloads