The JS sandbox first tries to import the node file using ES module syntax (await import(...)), and falls back to CommonJS require syntax if that fails.
Allows node functions to be exported using export default ... as well as module.exports = ..., and should hopefully allow us to convert whole sift backends to ES modules.
I don't know exactly how the SDK works when running without docker, but since the file I changed in the SDK (when running without docker) is an exact match for this file, I assume changing it here will also affect running JS nodes locally without docker.
View this PR with "Hide whitespace"
The JS sandbox first tries to import the node file using ES module syntax (
await import(...)
), and falls back to CommonJS require syntax if that fails.Allows node functions to be exported using
export default ...
as well asmodule.exports = ...
, and should hopefully allow us to convert whole sift backends to ES modules.I don't know exactly how the SDK works when running without docker, but since the file I changed in the SDK (when running without docker) is an exact match for this file, I assume changing it here will also affect running JS nodes locally without docker.