httpyac icon indicating copy to clipboard operation
httpyac copied to clipboard

Bug/Feature: Allow compatibility between plugins for modules running promises

Open estacioneto opened this issue 8 months ago • 0 comments

Hi!

First of all, thanks for the awesome plugin! It's way better than the other HTTP Clients and it helps me a lot everyday.

My example is when I have something like:

< ./script.cjs

POST /example
{{computed_request_body}}

and on script.cjs:

async function main() {
  request.variables.set('computed_request_body', await heavyComputationOrFetch())
}

main()

When using kulala.nvim, for example, it works and computed_request_body is set, while for this to work on httpYac we need to set a top-level await (otherwise the variable is set only for when running the request again). Kulala.nvim doesn't need the top-level await because it runs the script in node and waits for its execution and I'd like to know if there's a possibility that httpYac does this as well.

Thanks again for building this amazing plugin!

estacioneto avatar Jun 06 '25 08:06 estacioneto