Is it easy to "port" a library into TW?

70 views
Skip to first unread message

Tony K

unread,
May 26, 2020, 12:35:45 AM5/26/20
to TiddlyWiki
I have seen quite a few "porting" / conversion for different JS libraries into TW. 

would that be hard to do?, I'd like to do it for pixi.js but I am not sure where to start

thanks

Joshua Fontany

unread,
May 26, 2020, 1:06:58 AM5/26/20
to TiddlyWiki
It honestly depends on the what the library does, and your experience with tiddlywiki and javascript. I was fairly new to javascript, especially on node.js, but had background in other scripting and C#.net.

The tiddlywiki architecture, i.e. the raw text -> parse tree -> widget tree -> final DOM, process is very different than other html/js abstraction layers like React, etc. Those work directly on the DOM, but tiddlywiki destroys and re-creates the DOM "at-will" when the underlying tiddler data has changed. This can be a hurdle at first.

If you are just manipulating underlying tiddler data, or creating your own $widget, there are some good examples in the $/:core that you can extend.

Best,
Joshua Fontany

Tony K

unread,
May 26, 2020, 1:13:38 AM5/26/20
to TiddlyWiki
Thanks Joshua for the detailed response

https://github.com/felixhayashi/TW5-Vis.js is a "conversion" or "port" or whatever you wanna call it of vis.js to TW

I'd like to do the save for pixi.js https://github.com/pixijs

PMario

unread,
May 26, 2020, 4:50:20 AM5/26/20
to TiddlyWiki
On Tuesday, May 26, 2020 at 7:13:38 AM UTC+2, Tony K wrote:
 
https://github.com/felixhayashi/TW5-Vis.js is a "conversion" or "port" or whatever you wanna call it of vis.js to TW

Not a conversion, nor a port. ... Most of the time we only need a small "wrapper" function, that makes a TW plugin out of a  3rd party library.

For most libraries, that implement a common-js interface, which uses "export" to make library functions available, it is relatively easy to create a TW plugin. TW also uses a common-js like interface, that works with node.js _and_ the browser at the same time.

It seems pixi does "export" its functions. .. But it would need more tests.

BUT Importing a 3rd party library is only the 1st part of the work to do. ... You'll need to make the functions available for TW users and yourself. So most of the time this needs to create TW widgets.
 
I'd like to do the save for pixi.js https://github.com/pixijs

As written above. It depends which functionality from pixi you want to use.

Learning pixi page has 43 headlines. https://github.com/kittykatattack/learningPixi

So imo it depends on your usecase, which functions you really need.

-mario
Reply all
Reply to author
Forward
0 new messages