Is there a good way to share functions across multiple workflows?

This topic was automatically generated from Slack. You can find the original thread here.

Bharat Kilaru : Hi, I find myself writing several functions that I want to share across different steps and workflows. Is there a good way to do that? Thanks

Dylan Sather (Pipedream) : Have you ever published your own npm package? It’s simpler than it sounds, and by including your functions within that package, you can require the package within any step where you need to use it. We do this internally.

We’re thinking a lot about this problem and would like an easier solution. For example, could we let you author your own shared functions in your user’s settings, which are made available to any step? Or if we support local development, you could envision requiring shared, local JS files from a lib directory that gets deployed with any workflow where you’d like to use it.

Definitely open to ideas here for what you’d like to see. Let me know if the npm solution works for now.

Bharat Kilaru : Haven’t published my own package before, but will consider doing it this way.

Shared functions approach sounds promising.

This issue and linting are the few things that’s forcing me back into my own IDE for development. For this issue, as the page gets really long, it starts going really slow and changing something is hard for a chrome tab to handle

Dylan Sather (Pipedream) : Re: linting, do you use a specific set of ESLint / Prettier rules? At the end of the day this is why we want to support local development, but in the meantime I’m curious if we can improve the UI for you.

And just to confirm, you’re saying you’re seeing UI performance issues? We can definitely look into that. FYI

Bharat Kilaru : Just following up here. Yeah seeing UI slowdowns when there’s large blocks of code in a workflows. I’m using large HTML snippets to send emails. And often the page can barely load. Maybe you could take a look at a few of these workflows that are like that

Dylan Sather (Pipedream) : yes, please do. what username should Bharat share with?

Nacho Caballero : regarding your comment “could we let you author your own shared functions in your user’s settings, which are made available to any step?” Retool did this and it turned into a nightmare for me because they didn’t keep track of versions (any change in the common code could break all workflows using it). Unless you want to implementing versioning, allowing private NPM packages (they’re currently public) makes more sense