[Question] How to use nodebox-runtime in browser without any online resource's support
lifubang opened this issue ยท 7 comments
Hello, I have following codesandbox
projects for many years. Thank you for let these excellent codes open source.
When I test nodebox-runtime
in local machine accoding to https://sandpack.codesandbox.io/docs/advanced-usage/nodebox
. I found that we need to load some runtime support resouces from https://nodebox-runtime.codesandbox.io
and https://rm127lp-3000.nodebox.codesandbox.io
.
My question is that how to use nodebox-runtime
without any online resource's support? Because users in my area can't load these resouces without VPN
.
I think it will be better if we have a pure node js runtime in browser. We can run it without load any other online resources when in running period.
Thanks.
Everything is just static files, but it needs to live somewhere, you can host it on-prem if you want, if you want an entirely offline solution there is only one solution which is native software like Node, Deno, Bun, ...
If you want an on-premise setup you will need to reach out because we aren't allowed to publish the code of the runtime publicly. Reach out for that at sales@codesandbox.io
Thank you for your reply. Do you know whether there are some other pure nodejs runtimes implemented in the browser or not?
For example, we can use it likes this?
<script type="text/javascript" src="anodejsruntimeinbrowser.js"></script>
<script type="text/javascript">
var nodescript = `const buf = Buffer.from('hello');
console.log(buf.toString());
`;
anodejsruntimeinbrowser.run(nodescript);
// we will get 'hello' here.
</script>
We only need to load this one js anodejsruntimeinbrowser.js
from cdn.
This is kind of how nodebox works already? The cdn is just our endpoints by default, unless you want something that isn't sandboxed to a new domain/iframe that does not exist afaik (you can probably build a minimal version using browserify modules)
This is kind of how nodebox works already?
I think it may be no. Besides installing @codesandbox/nodebox
, we have to connect to https://nodebox-runtime.codesandbox.io
when running nodejs scripts in browser.
So, I think there is no fully open source projects in this area(running nodejs/webpack in browser). All the open source projects are all about how to use it(looks like SDK), not about how to implement it?
This is just a discussion, I advise the leader in this area should became the fully open source in this area, like kubernetes
, docker
, mongodb
or redis
. I think it will help you gain more users, and it will help to establish a healthy community ecological environment in this area.
Unfortunately, we did not fully open-source Nodebox for a variety of reasons, some of which are outside of our control. We believe this technology may be the future of improved DX. So, we will continue to explore whether we can open-source it in the future.
Also we are also not allowed to disclose those reasons, but please understand that we are deeply frustrated by the fact that we cannot open source right now. Generally, it's a frustrating situation to be in, both for us and others, because we cannot disclose why. We are exploring whether we can still open-source this in the future, though. And if that happens, we can post an update here.
@danilowoz Just checking in a year later; have you been able to fully open source Nodebox? Would love to give it a go, but the proprietary nature scares our corporate security team :(