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:



1 Like

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.

Dear all, about custom plug-ins is there any reference about them? I have been studying the marketplace section and I don’t understand if it is possible to create view components following a certain set of programming principles and then import them externally (like webcomponents in a tool like Visual Studio Code) and then import them into the marketplace. Can this be achieved? I mean build view components in javascript outside appgyvers ambient and import them in the marketplace?

1 Like

Hi! At the moment we don’t have support for third party plugins, which would mean React Native code written outside of Composer but used in the apps, but we have plans to enable this.

Thanks! Here’s another feature that might be usefull at least as a alternative resource. To be able to connect to CDN resources: CSS’s and Javascripts. This would, at least for some use cases, let us advance with some custom features not available now in the Composer…

3 Likes

Hey @Harri_Sarsa, would it be possible to import this library from Backendless using the method you are suggesting? I am also curious, can you use a custom JS function as input to another custom JS function? That is, passing something like console.log (or more complex) as output of function A and then using it as input of function B and call it there (maybe with a difference name).