Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions editions/tw5.com/tiddlers/releasenotes/5.4.0/#8258.tid
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions editions/tw5.com/tiddlers/releasenotes/5.4.0/#9078.tid
Original file line number Diff line number Diff line change
@@ -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