Replies: 2 comments
-
Hi @inmysocks I think it might be clearer to do this: if(!$tw.boot.tasks.suppressLoadingTiddlers) {
if($tw.boot.tasks.readBrowserTiddlers) {
$tw.loadTiddlersBrowser();
} else {
$tw.loadTiddlersNode();
}
} The interactions between the two flags are clearer: set |
Beta Was this translation helpful? Give feedback.
0 replies
-
(edited the above to add missing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For part of my experiments I would like to be able to load every tiddler from a database back-end, even the core.
One benefit of this is that I could make a signed bundle for OSX (and maybe windows and linux as well, I haven't tried on either of them)
I have found two ways that almost do this, but neither will work without editing boot.js
the first is to replace line 2352 in boot.js where it calls $tw.loadTiddlersNode() with a hook like this:
unfortunately that leads to a chicken-egg problem where the function that I want to change is what is responsible for loading the plugin that contains what I want to use instead. That took an embarrassingly long time to realise.
You could add in the code for adding hooks to the script that calls the boot function without breaking anything, but you would still need the hook to be invoked in boot.js.
The other option is to put load the tiddlers using an external script and populate the $tw.preloadTiddlers array with everything. The problem with this is that the if statement used to pick $tw.loadTiddlersBrowser and $tw.loadTiddlersNode doesn't give a way to skip both of them.
The two solutions I have come up with is to either move the definition of the hooks mechanism into bootprefix.js so that the hook changing which loading function to use can work, or to add some flag like $tw.noLoadingTiddlers and change the load tiddlers section to
so if $tw.noLoadingTiddlers is set everything must be loaded into the $tw.preloadTiddlers array.
I prefer the option to load hooks earlier because that would open up possibilities like adding a new plugin type for boot plugins that you could use the register new file types that can be loaded during the boot process without having to edit boot.js. Plugins like this would have to be different than normal plugins, but I think it would work.
I would like some input from other people before moving forward because there may be a simpler way to do this.
Beta Was this translation helpful? Give feedback.
All reactions