Coder Social home page Coder Social logo

Comments (8)

rsc avatar rsc commented on August 27, 2024

I think that implementing search on the server would be fairly straightforward. That link you found about the tiddlyweb/search API is interesting, but I can't find any evidence that it's used. In particular, I have the jermolene/TiddlyWiki5 repo checked out and can't find any mention of the /search URL. There are some references to a special $:/temp/search tiddler, but no code that does a GET of /search on the tiddlyweb server.

core/modules/commands/server.js has what looks like a local tiddlyweb server (for node.js?), and it doesn't mention search.

plugins/tiddlywiki/tiddlyweb is the tiddlyweb client, and it doesn't mention search either.

Maybe I have an old copy? Or maybe the docs were written as a design but never implemented?

In any event, if you can figure out how to make TiddlyWiki use /search, it should be easy to implement.

from tiddly.

cdent avatar cdent commented on August 27, 2024

plugins/tiddlywiki/tiddlyweb is the tiddlyweb client, and it doesn't mention search either.

I don't think you have an old copy. The functionality provided at /search by the python implementation of TiddlyWeb is one of many things in tiddlyweb that TW5 doesn't (yet?) support. There has been discussion at various times of extending search in either tw5 or tw classic such that a local search can failover to a remote search but as far as I know nothing other than proof of concepts existed. Another option considered (but mostly dismissed) was if a search was made to go ahead and load everything not already loaded.

What probably needs to happen is greater attention to the tiddlyweb plugin in TW5, but I'm not clear on who is actively involved in that.

from tiddly.

willwray avatar willwray commented on August 27, 2024

Searching TiddlyWiki5 GitHub issues for 'search' hits 258 of 568 issues with 112 open.
I only find one that explicitly mentions this search issue;
TiddlyWiki5 #1194: TW5 and TiddlySpace / TiddlyWeb, opened three years ago with input from @cdent.

Unfortunately, due to the recent demise of TiddlySpace, this issue was revived by @pmario and closed by @tobibeer two days ago. As Chris notes, the issues are all still relevant to TiddlyWeb.

A replacement TW5 and TiddlyWeb issue is needed:

  • without the TiddlySpace reference
  • focused on what's needed for this and similar 'tiddly-server' projects using tiddlyweb plugin

Perhaps broader TiddlyServer issues should be separated out:
There appear to be more general 'tiddly-server' architectural issues related to the separation of server-core index.html and to the serving of skinny tiddlers for plugins and macros , c.f. similar sync-adaptor issues.

I'm still interested in workarounds or hacks to get search working.
Is the 'fat' parameter supported such that all tiddlers are fetched non-skinny?

Relevant TW5 'tiddlyweb' discussion:
TiddlyWiki/TiddlyWiki5#2694
TiddlyWiki/TiddlyWiki5#2371

from tiddly.

rsc avatar rsc commented on August 27, 2024

The "skinny tiddler list" is fetched frequently (every minute?), so you don't want to make it fat in general. Even expanding $:/tags/Macros-tagged tiddlers, as I did, is more than I'd like. Ideally I would like to distinguish the first skinny load from the others, so that the first one can be a little less skinny. An equivalent, probably better alternative would be to insert the needed fat tiddlers into index.html itself - that's the real first load, and there are a few tiddlers for which even the first skinny load is too late. If you got that right then I think for example it might be possible to add new modules without regenerating index.html served by this server (rsc/tiddly).

Either way, if you can identify the first load, then you could include all text tiddlers (maybe up to a certain size) in that load, and then the default search would work for them. One of the things I like about the on-demand loading is I can drop PDFs and other large files into my tiddlywiki and they don't slow down ordinary operation. Those shouldn't be fattened in this situation.

I don't see any code using fat=1 in the tiddlyweb plugin, so rsc/tiddly does not support it.

Best thing to investigate is probably how to munge index.html during the initial serve to include full tiddler content for tiddlers matching some condition.

from tiddly.

cdent avatar cdent commented on August 27, 2024

An equivalent, probably better alternative would be to insert the needed fat tiddlers into index.html itself

This is what the tiddlywebwiki plugin for the tiddlyweb server does (for tiddlywiki classic, not 5; there's not yet been similar plugin for 5): rather than having a static index.html, it uses one that is templatized and loads it up with some or all of the tiddlers in a recipe. For large tiddlywikis this proved very slow, and led to a variety of lazy/dynamic loading systems. The one that worked best and might be easiest to translate into this system was for there to be a filter/tag on a suite of tiddlers so that some were labelled as being required at startup. These were injected into index.html when it was read. Everything else was loaded dynamically. If the label was passed as a query string, that could provide some configurability.

tiddlywebwiki: https://github.com/tiddlyweb/tiddlywebwiki

from tiddly.

tobibeer avatar tobibeer commented on August 27, 2024

@cdent, was there some server side-search component in the frontend for anything lazy loaded on TiddlySpace / TWC?

from tiddly.

pmario avatar pmario commented on August 27, 2024

There was no UI in TWc, but if you know the URL pattern, you can initiate a server side search.

from tiddly.

cdent avatar cdent commented on August 27, 2024

@tobibeer not that I recall but it's probably worth mentioning that it was 3 years ago that I stopped paying attention to tiddlyspace, and for the last more than a year I didn't really pay that much attention to the tiddlywiki aspects, as the single page apps using aggregations of tiddlers was always more important to me.

When I implemented dynamic (not the same as lazy) loading for tiddlywiki classic in tank it was in this commt. I'm not sure if that is helpful in any way other than showing one of the strategies.

But yeah, basically what @pmario says: if there's something handling /search you can query it to get more tiddlers. rsc doesn't currently have that.

from tiddly.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.