Javascript "<script src=" equivalent

Is there a method in the custom javascript builder in the logic flow builder to add src’s such as shown here:



Hi, seems like this question is missing some info. Do you still face this issue or is this thread obsolete?

Thanks for your reply. It’s a current vs. obsolete issue.

I see now that the post didn’t include the example I thought I had pasted in.

Let me try again:

<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gun/sea.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gun/lib/webrtc.js"></script>
<script>
further code dependent on the src's listed above would be inserted here
</script>

I don’t see how to do this in the custom javascript logic component.
Perhaps the src files can be added as inputs (?) with the “dependent” javascript being added in the JAvascript section:

Some possibly helpful related information:

My goal is to be able to use gundb, a P2P, pubsub, graph, JSON database and it doesn’t have REST endpoints, instead having CRUD activities entirely managed in javascript.

So, I can’t use the app data path as defined in Appgyver and am hoping to set app, page, and field variables and fields within custom javascript flow functions.

Since gundb relied on “src” reference javascript libraries which are referred to by the “CRUD” specific javascript, I either need to be able to import these libraries at the app level or … possibly(???) but not preferably … copy-paste the full JS of each of these libraries into each custom javascript component where they are need for the component-specific “dependent” javascript.

Hopefully, one method or the other is possible?

Still hoping to get some feedback on this possible avenue…

Sorry to leave this hanging! Importing custom libraries is not possible yet, but will be with the third-party plugins. For now, you can hack around this by copypasting the library code into the JavaScript node, but that’s not optimal in most cases. Sorry!

Thanks, Harri.

yep, I had thought of the copy-paste hack but … is there a line or file size limit for the JS node?

Shouldn’t be a hard limit, but you might run into performance issues if you have a node that’s run many times and it always loads a huge dependency from scratch.

OK, Thanks!

I’ll probably just try it and see. :slight_smile:

In my case, that may be a significant factor since the custom libraries would be needed for each create, read, update or delete REST request … and there could be more than one of each on a page.