Re: [twdev] Re: My plugin needs a modified core tid - how?

2019-07-11 Thread Jeremy Ruston
Hi Mat

> My wider question is HOW a user should request "hooks" and what are the 
> conditions around it? I have not done any request. I'm asking because I want 
> to know HOW to request something like this, if at all reasonable. The 
> background here is that Jeremy has previously explicitly stated an ambition 
> to have "hooks" in the code. As should be clear in my original post, I'm 
> uncertain what exactly constitutes a "hook" but think that what I asking 
> about would be one. (Is it?)

Discussions on the group are a great way to explore solutions to problems, and 
sometimes specific proposals for core changes will drop out of those. Once 
there’s a concrete proposal GitHub is often the right place to work on it.

> I'm an advanced user who pushes some of the limits in TW. My handicap is also 
> my strength, namely that I don't know javascript so I need to solve 
> everything within TW itself. This exposes limitations in TW in a way that 
> people who solve it via non-TW means probably don't see as limitations in the 
> same way. Obviusly, the more sophisticated TW gets the more "fringy" requests 
> are made - the basic functionality is there and works well - but what TW can 
> do is there thanks to Jeremys incredible work in combination with input from 
> the community both in therms of code and mere ideas and expressed needs.

Yes indeed. I’ve long lost count of the number of TW5 enhancements that would 
never have happened had not somebody asked the right question at the right time.

Best wishes

Jeremy

> 
> <:-)
> 
> -- 
> 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 tiddlywikidev+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywikidev@googlegroups.com 
> .
> 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/e0b88d8b-cd14-4946-af0b-6e3e659a5040%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/40D2BE13-05BC-40D3-B57A-40369A996169%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: My plugin needs a modified core tid - how?

2019-07-11 Thread Jeremy Ruston
Hi Ed, Mat,

Good to see you back, and good luck with your recovery. Your concerns echo some 
of my mine over the years, but happily I don’t think they apply to most of the 
conversation here.

The context is that we use system tags as a common extensibility mechanism 
throughout the core user interface, and it has proven to work successfully. 
From Mat’s question arises the proposal of bringing that same extensibility 
mechanism to the way that plugin information panels are displayed.

I’ll respond to Mat’s specific questions momentarily.

Best wishes

Jeremy

> On 11 Jul 2019, at 14:18, Ed Dixon  wrote:
> 
> Hi all. 
> 
> Been a long time since I have done anything with TW5 or anything else for 
> that matter, still recovering from brain surgery where damage was definitely 
> done but I have been lurking both forums all along (for years now without a 
> word!) and regretfully find trying to use even the most basic functionality 
> of TW a challenge due to its already built-in amazing flexibility and 
> functionality. So I may be way off on this and want to say up front, first 
> and foremost, I mean absolutely no disrespect to anyone involved here. 
> However, as I am understanding this, I simply can not stand to watch this 
> thread continue much longer. I can picture Jeremy right now trying to figure 
> out how to allow an end user turn his fine-tuned jet airplane into a space 
> station at the cost of other useful functionality he may be trying to add, He 
> has proven to work very diligently on feature requests (usually very 
> successfully) to provide needs that also meet the applications goals but this 
> one is simply too much to ask IMHO and I do hope Jeremy seriously gives that 
> consideration. I made a similar request years ago to meet a specific need 
> that I no longer have, and couldn't implement now even if he gave me 
> supervised directions complete with pictures on how to do so. Despite all 
> that he probably did add that functionality (I can't even remember what it 
> was at this point) and hope it didn't cost him too much time or if so it did 
> turn out to be of use to the project as a whole. 
> 
> That said, My first instinct to a thread suggesting a core change would be to 
> fork it and go for it yourself (which is what I wish I had done while I still 
> had the chops to try to do so) I am a little surprised this hasn't already 
> been suggested. He can always implement those changes back into the core if 
> it meets his requirements without the cost of a lot of his own time (GOD 
> bless GIT). But be prepared to meet all the needs of his overall goals with 
> TW5 and ALL the complexities that imply. Such as the Internal mechanisms that 
> other core mechanisms may rely on that are based on the one you intend to 
> change, the responsiveness of the application, clarity, and functionality for 
> the typical and advanced end-user, testing to make sure changes have not 
> broken any other functionality, any and all security implications involved, 
> and everything else that Jeremy so diligently provides us with this amazing 
> tool. 
> 
> I can understand a need to add special functionality a specific project might 
> require at the cost of some of this (as I think was my case, my memory is 
> shot) but given that the core has been built with the ability to transclude 
> even itself providing what I feel is as much flexibility as one could expect 
> and should allow almost anything within reason to be possible,. perhaps at 
> this point, TW5 has reached a point of maximum returns in regards to adding 
> new plugin programming features (especially if they are for specific needs 
> and not the project as a whole)? (again all IMHO and yes I admit I am a total 
> fanboy, his work on this is and was totally mind-blowing at least for me 
> anyway LOL!). 
> 
> Thanks for taking the time to read all this if you made it this far I tend to 
> rant on and on at this point... 
> 
> On Friday, July 5, 2019 at 2:51:08 PM UTC-5, Mat wrote:
> So I'm working on a plugin that, among other things, will give plugin update 
> alerts. (never mind how)
> 
> I want to show this alert in the regular plugin list, ideally in the 
> $:/core/ui/Components/plugin-info tiddler which is the one showing each 
> separate plugin as a "row" in the plugin list.
> 
> How should one approach manipulating core components? It is one matter for 
> personal tweaking but not so good when making public plugins. ...besides, 
> whose shadow tiddler wins? Once my overwrite is in a plugin it is no longer 
> an overwrite but a shadow, so which one should the system choose?
> 
> Jeremy has mentioned putting in hooks which I interpret to mean things for 
> these sort of matters... so should I just "request a hook" and specify 
> exactly where? Or maybe I'm using the term "hook" in a faul way.
> 
> <:-)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWikiDev" group.
> To unsubscribe from 

Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread Brian Theado
Bimlas,

If the npm modules you want are compatible with the browser, then you can
bundle them into a tiddler and load them directly in the browser. It can be
tricky to get it working.  I've had the most success using browserify
--standalone
to get it bundled in a way that it will work with TW's require. If the
library provides a umd bundle, I think that usually that works as well.
I've also used webpack before to bundle the code.

But if the module needs to execute functionality only available in node,
then Jeremy's suggestion is the way to go.

Brian

On Thu, Jul 11, 2019 at 6:55 AM bimlas  wrote:

> The sync mechanism seems to be usable, I go around the topic, thank you
> for the idea!
>
> PS.: According to your comment
> ,
> if you would like GitLab saver to 5.1.20, please merge the request
> , otherwise mark it
> with "post-v5.1.20" just to give me some feedback. :)
>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> 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/0a206645-1cfa-4de9-9563-f4b91dc43bf7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/CAO5X8CwfZEAxmNMpDaxgudovCY86p4dqZ794giLKTGq34AkbyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: My plugin needs a modified core tid - how?

2019-07-11 Thread Mat
Ed, good to see you here and thanks for your thoughts - but I don't 
understand you point.

First, my question is how should a user insert something in "items" that 
are seen in the pluging list. Don't you think this is a fair question? 
Jeremy kindly answered, referring to a technique that is simply not 
applicable here because the individual items there are not built up by a 
listwidget. (The plugin *list* itself is, but the display of the individual 
items is not).

My wider question is HOW a user should request "hooks" and what are the 
conditions around it? I have not done any request. I'm asking because I 
want to know HOW to request something like this, if at all reasonable. The 
background here is that Jeremy has previously explicitly stated an ambition 
to have "hooks" in the code. As should be clear in my original post, I'm 
uncertain what exactly constitutes a "hook" but think that what I asking 
about would be one. (Is it?)

I'm an advanced user who pushes some of the limits in TW. My handicap is 
also my strength, namely that I don't know javascript so I need to solve 
everything within TW itself. This exposes limitations in TW in a way that 
people who solve it via non-TW means probably don't see as limitations in 
the same way. Obviusly, the more sophisticated TW gets the more "fringy" 
requests are made - the basic functionality is there and works well - but 
what TW can do is there thanks to Jeremys incredible work in combination 
with input from the community both in therms of code and mere ideas and 
expressed needs.

<:-)

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/e0b88d8b-cd14-4946-af0b-6e3e659a5040%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: My plugin needs a modified core tid - how?

2019-07-11 Thread Ed Dixon
Hi all. 

Been a long time since I have done anything with TW5 or anything else for 
that matter, still recovering from brain surgery where damage was 
definitely done but I have been lurking both forums all along (for years 
now without a word!) and regretfully find trying to use even the most basic 
functionality of TW a challenge due to its already built-in amazing 
flexibility and functionality. So I may be way off on this and want to say 
up front, first and foremost, I mean absolutely no disrespect to anyone 
involved here. However, as I am understanding this, I simply can not stand 
to watch this thread continue much longer. I can picture Jeremy right now 
trying to figure out how to allow an end user turn his fine-tuned jet 
airplane into a space station at the cost of other useful functionality he 
may be trying to add, He has proven to work very diligently on feature 
requests (usually very successfully) to provide needs that also meet the 
applications goals but this one is simply too much to ask IMHO and I do 
hope Jeremy seriously gives that consideration. I made a similar request 
years ago to meet a specific need that I no longer have, and couldn't 
implement now even if he gave me supervised directions complete with 
pictures on how to do so. Despite all that he probably did add that 
functionality (I can't even remember what it was at this point) and hope it 
didn't cost him too much time or if so it did turn out to be of use to the 
project as a whole. 

That said, My first instinct to a thread suggesting a core change would be 
to fork it and go for it yourself (which is what I wish I had done while I 
still had the chops to try to do so) I am a little surprised this hasn't 
already been suggested. He can always implement those changes back into the 
core if it meets his requirements without the cost of a lot of his own time 
(GOD bless GIT). But be prepared to meet all the needs of his overall goals 
with TW5 and *ALL* the complexities that imply. Such as the Internal 
mechanisms that other core mechanisms may rely on that are based on the one 
you intend to change, the responsiveness of the application, clarity, and 
functionality for the typical and advanced end-user, testing to make sure 
changes have not broken any other functionality, any and all security 
implications involved, and everything else that Jeremy so diligently 
provides us with this amazing tool. 

I can understand a need to add special functionality a specific project 
might require at the cost of some of this (as I think was my case, my 
memory is shot) but given that the core has been built with the ability to 
transclude even itself providing what I feel is as much flexibility as one 
could expect and should allow almost anything within reason to be 
possible,. perhaps at this point, TW5 has reached a point of maximum 
returns in regards to adding new plugin programming features (especially if 
they are for specific needs and not the project as a whole)? (again all 
IMHO and yes I admit I am a total fanboy, his work on this is and was 
totally mind-blowing at least for me anyway LOL!). 

Thanks for taking the time to read all this if you made it this far I tend 
to rant on and on at this point... 

On Friday, July 5, 2019 at 2:51:08 PM UTC-5, Mat wrote:
>
> So I'm working on a plugin that, among other things, will give plugin 
> update alerts. (never mind how)
>
> I want to show this alert in the regular plugin list, ideally in 
> the $:/core/ui/Components/plugin-info tiddler which is the one showing each 
> separate plugin as a "row" in the plugin list.
>
> How should one approach manipulating core components? It is one matter for 
> personal tweaking but not so good when making public plugins. ...besides, 
> whose shadow tiddler wins? Once my overwrite is in a plugin it is no longer 
> an overwrite but a shadow, so which one should the system choose?
>
> Jeremy has mentioned putting in hooks which I interpret to mean things for 
> these sort of matters... so should I just "request a hook" and specify 
> exactly where? Or maybe I'm using the term "hook" in a faul way.
>
> <:-)
>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/2183b04d-fdea-4e0e-a990-38dc8411cf0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: Hey plugin authors! Where do you serve your plugins?

2019-07-11 Thread Mat
OK thanks, so if I undestand, you publish via the first variant i.e

Via a public wiki hosted on some server (tiddlyspot, private, github website
> )


Do you know if there are any more alternatives than the ones I mention?
 
<:-)

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/edcda4b4-54a9-4d5f-a666-7144809fe44d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: Hey plugin authors! Where do you serve your plugins?

2019-07-11 Thread PMario
Hi Mat, 

I did create an edition for every plugin, which can be reached from here:  
https://wikilabs.github.io/

-m

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/92fed54b-7eab-4f2f-8b65-176d0a6f74a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Hey plugin authors! Where do you serve your plugins?

2019-07-11 Thread Mat
[Intentional double post from the TW group. Kindly answer in either.]

Where/how do plugin authors serve their plugins to the public?

As far as I can tell, it is:

Via a public wiki hosted on some server (tiddlyspot, private, github 
website)
Via github as "code" (visitors don't really "see" what the plugin does)

Do these to cover 99% of the cases or am I missing some *common* other 
option?

Yes, there is also the option to create your own plugin library that people 
can install to get access to your plugins but this is extremely uncommon. I 
believe only Jed and Tobias has done this, except for native TW of course.

Thank you.

<:-)

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/edd05738-7b6a-4449-ba2f-636841bb90db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread bimlas
The sync mechanism seems to be usable, I go around the topic, thank you for 
the idea!

PS.: According to your comment 
, 
if you would like GitLab saver to 5.1.20, please merge the request 
, otherwise mark it 
with "post-v5.1.20" just to give me some feedback. :) 

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/0a206645-1cfa-4de9-9563-f4b91dc43bf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread Jeremy Ruston
Hi bimlas

> Maybe it's basically a bad way of thinking, so I am reformatting the 
> question: how can I use NPM modules in a widget?

Ah, OK, you’re asking if it is possible from the browser to invoke a function 
that is running on the server. That would be some kind of RPC mechanism, and we 
don’t have that, I’m afraid.

If you have something running in the browser that wants to talk to something on 
the server the simplest way to do it is to build on the sync mechanism: have 
the browser create a tiddler with some flags that gets synced to the server. 
The serverside code picks up the tiddler (by searching for the same flags), and 
then performs some operation, putting the results back in the same tiddler.

Alternatively, you can use websockets or serversentevents to communicate 
directly from code running in the browser to code running in the server.

Best wishes

Jeremy.

> 
> -- 
> 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 tiddlywikidev+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywikidev@googlegroups.com 
> .
> 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/72c2fe2f-b746-4a2b-9d50-224b6e18ff4f%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/5E6F029D-436F-40AD-8D9B-92783E883D93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread bimlas
Maybe it's basically a bad way of thinking, so I am reformatting the 
question: how can I use NPM modules in a widget?

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/72c2fe2f-b746-4a2b-9d50-224b6e18ff4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread bimlas
Jeremy,

Thank you for your reply, but I still don't understand that although it can 
recognize Node in the code, $:/info/node is always "no" in the browser, so 
it does not load utils-node modules. How do I use them, for example, in 
widgets? For example, if I want to use the $tw.utils.getEditionInfo() 

 
method in my browser, how do I do it?

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/bb100b08-1aea-4ea2-9096-03680064faba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread Jeremy Ruston
Hi bimlas

Apologies, I should have pointed out that $tw.node having the value {} does 
evaluate to true, as expected.

Best wishes

Jeremy

> On 11 Jul 2019, at 10:54, Jeremy Ruston  wrote:
> 
> Hi bimlas
> 
> $tw.boot.boot() is an async function, and takes a callback. TW won’t be fully 
> initialised until it gets to the callback. So try something like:
> 
> var $tw = require("./boot/boot.js").TiddlyWiki();
> 
> $tw.boot.argv = ['myproject', '--listen'];
> 
> $tw.boot.boot(function() {
>   console.log($tw.node);
>   console.log($tw.wiki.getTiddlerText('$:/info/node'));
> });
> 
> Best wishes
> 
> Jeremy
> 
>> On 11 Jul 2019, at 10:52, bimlas > > wrote:
>> 
>> To be clear: I need Node because I want to use NPM modules.
>> 
>> 2019. július 11., csütörtök 11:34:31 UTC+2 időpontban bimlas a következőt 
>> írta:
>> Dear all,
>> 
>> In a Node.js Javascript project, I want to use TiddlyWiki to display data.
>> 
>> To run Node methods, I need to create modules with "module-type: utils-node" 
>> (if I understand it well), thus I can reach them through $tw.utils. These 
>> will only be loaded by TiddlyWiki if $:/info/node is "yes" (so the value of 
>> $tw.node is not null). I have several Node wiki, checked in each (in the 
>> browser), but it seems that nowhere does it detects that the wiki is running 
>> under Node, because viewing $:/info/node in the browser says "no".
>> 
>> I'm confused, because if I check in the code, it detects that it is running 
>> under Node.
>> 
>> $tw.boot.argv = ['myproject', '--listen'];
>> $tw.boot.boot();
>> 
>> 
>> console.log($tw.node);
>> // {}
>> console.log($tw.wiki.getTiddlerText('$:/info/node'));
>> // yes
>> 
>> If I create a widget that uses this Node module, it doesn't work in the 
>> browser, instead of the widget, RSOD appears: $tw.utils.myNodeFunction is 
>> not a function
>> 
>> My question is how can I use the Node module in the browser?
>> 
>> -- 
>> 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 tiddlywikidev+unsubscr...@googlegroups.com 
>> .
>> To post to this group, send email to tiddlywikidev@googlegroups.com 
>> .
>> 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/3e0d6bc9-86c3-443c-8146-81acc7c98809%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/84606DC0-4971-4E5D-95E8-113B179CC710%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to use Node modules in browser?

2019-07-11 Thread Jeremy Ruston
Hi bimlas

$tw.boot.boot() is an async function, and takes a callback. TW won’t be fully 
initialised until it gets to the callback. So try something like:

var $tw = require("./boot/boot.js").TiddlyWiki();

$tw.boot.argv = ['myproject', '--listen'];

$tw.boot.boot(function() {
console.log($tw.node);
console.log($tw.wiki.getTiddlerText('$:/info/node'));
});

Best wishes

Jeremy

> On 11 Jul 2019, at 10:52, bimlas  wrote:
> 
> To be clear: I need Node because I want to use NPM modules.
> 
> 2019. július 11., csütörtök 11:34:31 UTC+2 időpontban bimlas a következőt 
> írta:
> Dear all,
> 
> In a Node.js Javascript project, I want to use TiddlyWiki to display data.
> 
> To run Node methods, I need to create modules with "module-type: utils-node" 
> (if I understand it well), thus I can reach them through $tw.utils. These 
> will only be loaded by TiddlyWiki if $:/info/node is "yes" (so the value of 
> $tw.node is not null). I have several Node wiki, checked in each (in the 
> browser), but it seems that nowhere does it detects that the wiki is running 
> under Node, because viewing $:/info/node in the browser says "no".
> 
> I'm confused, because if I check in the code, it detects that it is running 
> under Node.
> 
> $tw.boot.argv = ['myproject', '--listen'];
> $tw.boot.boot();
> 
> 
> console.log($tw.node);
> // {}
> console.log($tw.wiki.getTiddlerText('$:/info/node'));
> // yes
> 
> If I create a widget that uses this Node module, it doesn't work in the 
> browser, instead of the widget, RSOD appears: $tw.utils.myNodeFunction is not 
> a function
> 
> My question is how can I use the Node module in the browser?
> 
> -- 
> 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 tiddlywikidev+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywikidev@googlegroups.com 
> .
> 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/3e0d6bc9-86c3-443c-8146-81acc7c98809%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/4F2E1BB0-08C2-40D1-AEFD-4883879DC6CE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: How to use Node modules in browser?

2019-07-11 Thread bimlas
To be clear: I need Node because I want to use NPM modules.

2019. július 11., csütörtök 11:34:31 UTC+2 időpontban bimlas a következőt 
írta:
>
> Dear all,
>
> In a Node.js Javascript project, I want to use TiddlyWiki to display data.
>
> To run Node methods, I need to create modules with "module-type: 
> utils-node" (if I understand it well), thus I can reach them through 
> $tw.utils. These will only be loaded by TiddlyWiki if $:/info/node is "yes" 
> (so the value of $tw.node is not null). I have several Node wiki, checked 
> in each (in the browser), but it seems that nowhere does it detects that 
> the wiki is running under Node, because viewing $:/info/node in the browser 
> says "no".
>
> I'm confused, because if I check in the code, it detects that it is 
> running under Node.
>
> $tw.boot.argv = ['myproject', '--listen'];
> $tw.boot.boot();
>
>
> console.log($tw.node);
> // {}
> console.log($tw.wiki.getTiddlerText('$:/info/node'));
> // yes
>
> If I create a widget that uses this Node module, it doesn't work in the 
> browser, instead of the widget, RSOD appears: $tw.utils.myNodeFunction is 
> not a function
>
> My question is how can I use the Node module in the browser?
>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/3e0d6bc9-86c3-443c-8146-81acc7c98809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] How to use Node modules in browser?

2019-07-11 Thread bimlas
Dear all,

In a Node.js Javascript project, I want to use TiddlyWiki to display data.

To run Node methods, I need to create modules with "module-type: 
utils-node" (if I understand it well), thus I can reach them through 
$tw.utils. These will only be loaded by TiddlyWiki if $:/info/node is "yes" 
(so the value of $tw.node is not null). I have several Node wiki, checked 
in each (in the browser), but it seems that nowhere does it detects that 
the wiki is running under Node, because viewing $:/info/node in the browser 
says "no".

I'm confused, because if I check in the code, it detects that it is running 
under Node.

$tw.boot.argv = ['myproject', '--listen'];
$tw.boot.boot();


console.log($tw.node);
// {}
console.log($tw.wiki.getTiddlerText('$:/info/node'));
// yes

If I create a widget that uses this Node module, it doesn't work in the 
browser, instead of the widget, RSOD appears: $tw.utils.myNodeFunction is 
not a function

My question is how can I use the Node module in the browser?

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
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/4acae129-913e-4be6-a925-71bb998a5aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.