webbdays
webbdays4mo ago

deno in rust

While working on some feature. We have found a bug. Here is the bug: https://github.com/tailcallhq/tailcall/issues/1570 The codebase is an open source project: tailcallhq/tailcall on github, codebase is using deno_core for its js runtime to call a given function from the given js script. Here is the runtime: https://github.com/tailcallhq/tailcall/blob/main/src/cli/javascript/runtime.rs But when running tests with multiple scripts, we can see old functions in old script executed in runtime persists. which we don't want to happen. unexpected test results. I am not aware of deno_core much. Its obvious to use different scope or context or even isolation. I don't have enough knowledge of how to use the above mentioned. Any or even the smallest help/guidance is welcomed. By the way there is a bounty for it: $50 Thank you.
GitHub
bug: Sandbox loaded files in execution spec · Issue #1570 · tailcal...
Currently when we use the @file:abc.js annotation in a file like foo.md, and try to access it in bar.md we succeed. The expected behaviour is that all files defined in foo.md should be local to tha...
GitHub
tailcall/src/cli/javascript/runtime.rs at main · tailcallhq/tailcall
A high-performance API Platform. Contribute to tailcallhq/tailcall development by creating an account on GitHub.
5 Replies
webbdays
webbdays4mo ago
one can solve it or guide us there in the issue. It is greatly welcomed and appreciated. its a blocker for a new feature currently. someone?
Leokuma
Leokuma4mo ago
I'm not familiar with Tailcall, so maybe what I'm going to say makes no sense, but what if you wrap each markdown's code in inside an IIFE ?
webbdays
webbdays4mo ago
idea is users defines several function once before start of the application. And each func maybe or maynot be called based on some user defined config. not all functions to be called. sorry, i understand your point clearly now. for that we need to parse the given functions individually, and covert it to IIFE function and execute. Nice idea. if you are familar with rust and intrested in bounty and open source can you go and implement this.
Leokuma
Leokuma4mo ago
I'm not familiar with Rust, sorry. But feel free to implement that idea if it really works and there's no better alternative
webbdays
webbdays4mo ago
Sure. I will try.