Hi Conner Apologies for being late to respond. You're doing some interesting stuff.
The current approach for communicating between the browser and the server is to layer things on top of the existing tiddler synchronisation mechanism. This reflects a principle in TiddlyWiki's design: to strive for the minimum number of mechanisms, and to reuse them as much as possible. In this case, you could use a single system tiddler to coordinate things. To trigger the command, the browser UI might set the text of the tiddler $:/commands/gitlog to the name of a tiddler that should contain the results of the gitlog command. The server has a wiki store change event handler that looks for modifications to that tiddler, and fires off the gitlog command when it sees the tiddler text changing. On completion, the server process would place the results of the command in the specified tiddler. The tiddler value would eventually propagate to the browser where a simple transclusion will cause it to be displayed where required. There are some issues: currently there's a 60 second lag for changes to propagate from the server to the browser. That's partly because the polling mechanism is not very sophisticated. That all needs improving, but it's probably easier than introducing a wholly new transport system. Best wishes Jeremy On Wed, May 31, 2017 at 1:30 PM, Conner Phillips < [email protected]> wrote: > Okay, this says that "Note that JavaScript > <http://tiddlywiki.com/dev/index.html#JavaScript> macros work on both the > client and the server, and so do not have access to the browser DOM." > > However, the issue true issue is that I am trying to load an npm module > server side. The browser keeps complaining it isn't able to find it > though.The specific module in question is simple-git > > On Wednesday, May 31, 2017 at 4:28:17 AM UTC+2, Matthew Lauber wrote: >> >> Since you can write a javascript macro, it is _possible_ to use any of >> the functionality that the tiddlywiki itself provides. Therefore it is >> possible to run ajax requests to query the API. That said, I'm going to >> bet it's not the easiest thing in the world. This is probably a good place >> to start. http://tiddlywiki.com/dev/index.html#JavaScript%20Macros I'd >> also take a look at the files here for examples. https://github.com/J >> ermolene/TiddlyWiki5/tree/master/core/modules/macros >> >> On Monday, May 29, 2017 at 5:57:36 PM UTC-4, Conner Phillips wrote: >>> >>> What I would like to do: >>> >>> Add a history tab to the ViewTemplate >>> >>> This tab displays the results of a query to the server which runs and >>> parses some git log commands. >>> >>> It seems in the past this was strictly not possible, but now I'm not so >>> sure. >>> >> -- > You received this message because you are subscribed to the Google Groups > "TiddlyWikiDev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/tiddlywikidev. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/tiddlywikidev/eaed9876-dbd0-4b78-85b9-445301d7b5f8% > 40googlegroups.com > <https://groups.google.com/d/msgid/tiddlywikidev/eaed9876-dbd0-4b78-85b9-445301d7b5f8%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Jeremy Ruston mailto:[email protected] -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/CAPKKYJYnGTBith74%2B%2B0ZqDOx_sFr6%2B78TiTobc4oBq7%3DH%2BL48g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
