[TW5-JsonManglerPlugin] v2.0.2 Update!

209 views
Skip to first unread message

Joshua Fontany

unread,
Feb 18, 2019, 11:56:44 PM2/18/19
to TiddlyWiki
Hi Everyone~

I have caught and squashed quote a few bugs with this update and refactored quite a bit.

I also wrote a new $:/Config tab to allow packing, repacking, unpacking, and editing plugin tiddlers.

Update has been pushed to github: https://github.com/joshuafontany/TW5-JsonManglerPlugin

Demo Wiki: https://joshuafontany.github.io/TW5-JsonManglerPlugin/


This is stable enough for me to move on to refactoring my RenderTable plugin to use the new Json Tiddler logic.

Any feedback appreciated!

Best,
Joshua Fontany

mauloop

unread,
Feb 20, 2019, 11:39:52 AM2/20/19
to TiddlyWiki
Dear Joshua,

I appreciated very much your work, since I'm building a wiki which heavily makes use of JSON data tiddler, and I was investigating for a way to deal with nested JSON object. I just started to experiment with your plugin, but it looks like the ideal answer for my need. Thanks a lot.

I have just a minor question (by now :))). As from your post (and the HelloThere tiddler in your demo wiki as well) the plugin should be rel. 2.0.2. But the version field of the plugin tiddler says rel. 2.0.1. Are there any changes still waiting to be commited or maybe was it just a typo, either in the plugin header or in this post?

Joshua Fontany

unread,
Feb 20, 2019, 3:33:27 PM2/20/19
to tiddl...@googlegroups.com
mauloop,

Thanks so much for catching that. I had rolled back a set of changes just before pushing, and my manual change of the plugin version probably got rolled back as well. This should not affect anything else in the plugin & I have updated the github repository.

Thanks again!

Best,
Joshua Fontnany

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/ZiFBwS_hplE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e3ad130b-40b0-44df-9389-d62a640bd747%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TonyM

unread,
Feb 20, 2019, 5:54:34 PM2/20/19
to TiddlyWiki
Joshua,

Since you are clearly a big user of json, have you a method to "import" from a URI?

Please look at my post here Widget for HTML GET? 

I am keen to operate this on single file wikis which are trivial to host compared to server or node served wikis.

Regards
Tony

Joshua Fontany

unread,
Feb 21, 2019, 3:58:40 PM2/21/19
to tiddl...@googlegroups.com
Hi Tony,

I saw that thread, and yes that has definitely been on my mind (next up is rendering datasets with dynamic sort-able tables, tho).

I think that Jeremy brings up a lot of good points regarding the new(ish) cross-site scripting security measures. Ideally, you would be able to setup "query" tiddlers and send off RESTful requests to whatever server (sql, unsql, couch, etc), get the results dumped into a single tiddler, and then use wikitext controls to "break it apart" into individual "row(obect)-tiddlers".

Much much simpler in the server-style setups..... but we' willl have to see what's possible. Worst case scenario is we have to have a "helper app" to send and retrieve the query, dump to a text file, and then manually drag and drop that onto the single-file Tiddlywiki (not ideal, but it would work). This would require a new "parser" for raw unformatted and unrecognized JSONs, which would set the new tiddler's type to 'application/json' and either generate or let you create a new title.

Best,
Joshua F

TonyM

unread,
Feb 21, 2019, 5:35:15 PM2/21/19
to TiddlyWiki
Thanks Joshua,

There are some great options for helper apps now. We can publish html at a page address with servers or in iframes that may themselves contain javascript, php etc.. Basicaly the source can be contained in the wiki but independently delivered.

My weakness is detailed internet coding and server interaction.

Disqus and intense debate plugins illustrate the interactivity we can add to readonly wikis. I can see a number of paths to pull external content in. I believe we only need a few helpers to open the world of json and xml data to tiddlywiki.

When a wiki is read write because of server permissions, I am an authorised user, such as served on sharepoint, or server authenticated, the wiki file checked out to me. I dont understand why we are handycapped interacting with api's and other services.
And importing data automaticaly.

mauloop

unread,
Feb 23, 2019, 10:41:19 AM2/23/19
to TiddlyWiki
Hi, Joshua.

I run into troubles running Tiddlywiki with both Tiddlymap and JsonMangler plugins. I tested three different setups:

  1. Tiddlywiki 5.1.19 on Node.js with plugins loaded via tiddlywiki.info
  2. Tiddlywiki 5.1.19 on Node.js with plugins addes as tid files (dragging links to plugin tiddlers from the demo web sites)
  3. Tiddliwiki 5.1.19 as a local stand-alone html file
Both setups 1 and 2 don't work. As soon as I click on the map sidebar the following error is raised

tmap+jsonmang-err1.JPG



tmap+jsonmang-err2.JPG



These are the messages logged in the browser console in the meantime:

 TiddlyWebAdaptor: Getting status 
$:/core/modules/utils/logger.js:33  TiddlyWebAdaptor: Status: {"username":"","anonymous":true,"read_only":false,"space":{"recipe":"default"},"tiddlywiki_version":"5.1.19"} 
$:/core/modules/utils/logger.js:33  syncer-browser-tiddlyweb: Retrieving skinny tiddler list 
2(index):1 Failed to load resource: the server responded with a status of 404 (Not Found)
$:/core/modules/utils/logger.js:33  syncer-browser-tiddlyweb: Dispatching 'save' task: $:/StoryList 
(index):11152 Uncaught TypeError: Cannot read property 'to' of undefined
$tw.utils.error @ (index):11152
$:/plugins/felixhayashi/tiddlymap/js/lib/utils/tmap:208 Uncaught TypeError: Cannot read property 'to' of undefined
    at Object.groupByProperty ($:/plugins/felixhayashi/tiddlymap/js/lib/utils/tmap:208)
    at Adapter.getAdjacencyList ($:/plugins/felixhayashi/tiddlymap/js/Adapter:215)
    at Adapter.getNeighbours ($:/plugins/felixhayashi/tiddlymap/js/Adapter:292)
    at Adapter.getGraph ($:/plugins/felixhayashi/tiddlymap/js/Adapter:428)
    at MapWidget.rebuildGraphData ($:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:812)
    at MapWidget.rebuildGraph ($:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:752)
    at MapWidget.initAndRenderGraph ($:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:980)
    at MapWidget.renderFullWidget ($:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:462)
    at MapWidget.render ($:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:393)
    at eval ($:/core/modules/widgets/widget.js:374)
$:/core/modules/utils/logger.js:33  syncer-browser-tiddlyweb: Retrieving skinny tiddler list 
(index):11152 Uncaught NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
$tw.utils.error @ (index):11152
$:/core/modules/widgets/reveal.js:45 Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    at RevealWidget.render ($:/core/modules/widgets/reveal.js:45:9)
    at RevealWidget.Widget.refreshSelf ($:/core/modules/widgets/widget.js:436:7)
    at RevealWidget.refresh ($:/core/modules/widgets/reveal.js:193:10)
    at eval ($:/core/modules/widgets/widget.js:446:27)
    at Object.$tw.utils.each (http://localhost:8080/:11089:12)
    at ListItemWidget.Widget.refreshChildren ($:/core/modules/widgets/widget.js:445:12)
    at ListItemWidget.refresh ($:/core/modules/widgets/list.js:317:14)
    at ListWidget.handleListChanges ($:/core/modules/widgets/list.js:224:38)
    at ListWidget.refresh ($:/core/modules/widgets/list.js:145:17)
    at eval ($:/core/modules/widgets/widget.js:446:27)
$:/core/modules/utils/logger.js:33  syncer-browser-tiddlyweb: Retrieving skinny tiddler list 
$:/core/modules/utils/logger.js:33  syncer-browser-tiddlyweb: Retrieving skinny tiddler list 
$:/core/modules/utils/logger.js:33  syncer-browser-tiddlyweb: Retrieving skinny tiddler list 

Config 3 seems to be working. Unfortunately I work with many wikis served by Node.js and config 1 is my favourite. 

The wikis I used to test are fresh installation with no tiddlers other than the ones coming from the vanilla edition and the ones related to the plugins. Every test has been executed following the same steps in this order:

  1. install Tiddlymap (with dependencies)
  2. Reload both server and browser page
  3. Open the map sidebar tab
  4. Switch some times between default and live view
  5. Install JsonMangler (with dependencies)
  6. Repeat steps 2-4
In all of the tests, troubles came up after step 5 (actually I am a long time user of Tiddlymap on Noder.js and I have never seen a behaviour like this before).

I also tried to remove Tiddlymap end reinstall it after Jsonmangler. It did not solve, but the TM plugin raised the "first run message" popup every time I reload the browser, despite I always  clicked the OK button.

These are all of the infoes I was able to collect. I have no much JS developing experience to debug further. It is very frustrating since JsonMangler is very promising and could help me a lot. I hope @felixhayashi will be notified of this thread, since he could probably give us some useful suggestions.

Hope this feedback could help to improve the plugin. Best regards,

)+(au


Joshua Fontany

unread,
Feb 24, 2019, 2:42:37 PM2/24/19
to TiddlyWiki
Hi mauloop,

I also use Tiddlymap a lot, but have not gotten around to testing with both. This is really good information, as I have also been experiencing similar odd errors with the Bob version of the Node.js setup - which have been proving hard to trace. I wasn't sure if it was something I had made an error with during setup or something my code introduced....

This actually gives me a good idea of how to try to reproduce these errors. TiddlyMap is going to be key in the Edition I'm building, so I will definitely be looking at this. Opened an issue on my github repository.

https://github.com/joshuafontany/TW5-JsonManglerPlugin/issues/3

Thanks!
Joshua F

mauloop

unread,
Feb 24, 2019, 3:54:08 PM2/24/19
to TiddlyWiki
I would be happy to help as a tester. Let me know if needed.

Bye, )+(

Joshua Fontany

unread,
Feb 28, 2019, 4:51:10 AM2/28/19
to TiddlyWiki
I believe I have tracked down the root issue. No more uncaught errors with TiddlyMap, and a lot of the strange Bob server behavior has disappeared.

Tiddlymap still wants you to setup the map settings every time you click on the Active View, though. That needs more investigation.

 I'm going to do more testing tomorrow and then upload the fix.

Ref: https://github.com/joshuafontany/TW5-JsonManglerPlugin/issues/3

Best,
Joshua Fontany
Reply all
Reply to author
Forward
0 new messages