Skip to content

Conversation

yaisog
Copy link
Contributor

@yaisog yaisog commented Sep 24, 2025

This is a bugfix for #9289.
Since the insertion order is maintained in $tw.modules.titles, this object is used as source tiddler list.
The culprit is not the maintenance of object insertion order (which is preserved in modern JS), but the module definition order. Tiddler modules are currently defined before shadow modules and so appear first during module registration, i.e. subsequent shadow modules will overwrite any tiddler modules with the same exports.
Each group is sorted alphabetically, so plugin shadows currently overwrite core shadows (assuming their name starts with $:/plugins/). The problem is just with tiddlers not overwriting shadows.

The solution proposed here is to swap the order of $tw.wiki.defineTiddlerModules() and $tw.wiki.defineShadowModules() in boot.js, so that tiddlers are defined later.

Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 11057d9
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/68d51fcb15b8b60008be0b25
😎 Deploy Preview https://deploy-preview-9305--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Confirmed: yaisog has already signed the Contributor License Agreement (see contributing.md)

Copy link

github-actions bot commented Sep 24, 2025

📊 Build Size Comparison: empty.html

Branch Size
Base (master) 2418.3 KB
PR 2418.4 KB

Diff: ⬆️ Increase: +0.1 KB

@yaisog yaisog marked this pull request as draft September 24, 2025 17:36
@yaisog
Copy link
Contributor Author

yaisog commented Sep 25, 2025

It turned out that the reason was a different one than originally thought. I have update the OP accordingly.

There is a tiddlerExists() check in defineShadowModules() that may not be required anymore as any tiddlers will overwrite shadows now in forEachModuleOfType(). I did not touch that because of possible repercussions that I cannot foresee.

@yaisog yaisog marked this pull request as ready for review September 25, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant