Git Product home page Git Product logo

tiddlyweb-sse's Introduction

tiddlyweb-sse

This plugin runs in both the browser and server to sync changes immediately instead of waiting for polling. It adds a route to the server which sends server-sent events to the client, and loads an EventSource in the client to call $tw.syncer.syncFromServer().

The plugin may be quickly included in a wiki by adding "++C:\path\to\tiddlyweb-sse\dist" before the data folder.

node tiddlywiki.js "++C:\path\to\tiddlyweb-sse\dist" "C:\my\datafolder" --listen

It may also be included in the data folder by putting either the contents of the dist folder or the single plugin.info bundle (available from the releases page) in the folder plugins/tiddlyweb-sse.

https://github.com/twcloud/tiddlyweb-sse/releases

This also works properly with TiddlyServer, although it still requires adding the plugin to each individual data folder. If you want a way to specify plugins besides those in core in the tiddlywiki.info file, you can use environment variables to tell TiddlyWiki where else to look for these.

tiddlyweb-sse's People

Contributors

arlen22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiddlyweb-sse's Issues

Release a plugin in proper format

Hi @Arlen22 , the tiddlers field in plugin you released will be wiped out by

https://github.com/Jermolene/TiddlyWiki5/blob/a12a9bd93941748e20c5748170ed22cf5fb7cff0/core/modules/deserializers.js#L30-L38

So the generated plugin is not passing the plugin-library building process (while is useable by drag into a wiki)

Please do as other plugins does:

Change

	"dependents": "",
	"type": "application/json",
	"tiddlers": {
		"$:/plugins/twcloud/tiddlyweb-sse/readme": {
			"title": "$:/plugins/twcloud/tiddlyweb-sse/readme",
			"text": "This plugin runs in both the browser and server to sync changes immediately instead of waiting for polling. It adds a route to the server which sends server-sent events to the client, and loads an EventSource in the client to call $tw.syncer.syncFromServer(). \n\n[[Source code|https://github.com/twcloud/tiddlyweb-sse]]\r\n"
		},

To

 	"dependents": "",
 	"type": "application/json",
 	"text": "{\"tiddlers\":{\"$:/plugins/twcloud/tiddlyweb-sse/readme\":{\"title\":\"$:/plugins/twcloud/tiddlyweb-sse/readme\",\"text\":\"This plugin runs in both the browser and server to sync changes immediately instead of waiting for polling. It adds a route to the server which sends server-sent events to the client, and loads an EventSource in the client to call $tw.syncer.syncFromServer(). \\n\\n[[Source code|https://github.com/twcloud/tiddlyweb-sse]]\\r\\n\"},

Like other authors does:

{"title":"$:/plugins/dullroar/sitemap","description":"TiddlyWiki5 plugin to generate sitemap.xml.","author":"Jim Lehmer","version":"0.0.2","core-version":">=5.0.8","source":"https://github.com/dullroar/TW5-sitemap","plugin-type":"plugin","dependents":"","type":"application/json","text":"{\"tiddlers\":{\"RenderSitemap\":{\"title\":\"RenderSitemap\",\"created\":\"20150104141300000\",\"creator\":\"Jim\",\"extension\":\".xml\",\"modified\":\"20150104141300000\",\"modifier\":\"Jim\",\"tags\":\"static $:/tags/Exporter","type":"text/vnd.tiddlywiki","text":"\\define renderContent()\n<$text text=<<sitemapentries filter:\"\"\"$(exportFilter)$\"\"\">>/>\n\\end\n<>"},"sitemap":{"title":"sitemap",

Does this work already in the core tw?

@Arlen22 I see you have opened a series of PRs, and the last one is Jermolene/TiddlyWiki5#5882 . IIRC you have one of them merged?

I'm writing watch-fs plugin that will update nodejs cache if fs changed, and I may need SSE to get this change sync to the client.

So do I need to depend on this plugin to get my plugin working?

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.