-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hello!
Kulala works amazingly for my needs but some devs on our team work with httpYac on VSCode. One big difference is that this works fine on kulala:
async function main() {
request.variables.set('computed_request_body', await heavyComputationOrFetch())
}
main()...while on httpYac we would need a top-level await, meaning:
async function main() {
request.variables.set('computed_request_body', await heavyComputationOrFetch())
}
await main()Node.js already supports top-level awaits, but AFAIK they are available only for ES Modules (.mjs), while I believe Kulala creates a CommonJS (.js) file for running the script.
Possible solution
- Allow
.mjsscripts, which can be identified by their file extension- This could also mean supporting the
importsyntax (currently not supported by httpYac, but flagged, but supported by intellij), since simply changing the generated script asmjsthrowsReferenceError: require is not defined in ES module scope, you can use import instead.
- This could also mean supporting the
Additional info
Here's a related issue for plugin compatibility, but I believe that supporting ESM here would be a win even if the import is not supported by httpYac.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request