Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support modules #2

Open
brettinternet opened this issue Oct 31, 2020 · 3 comments
Open

Support modules #2

brettinternet opened this issue Oct 31, 2020 · 3 comments
Labels
feature Library improvement

Comments

@brettinternet
Copy link

I think the default Deno runtime options don't support module resolution. I'm not familiar with the Deno API, how difficult would it be to enable this feature?

@Bromeon
Copy link
Owner

Bromeon commented Nov 1, 2020

I assume you mean something like this? https://deno.land/manual/examples/import_export

I'm not sure if I want to support dynamically loading modules from the internet (for sandboxing reasons), or implement a complex dependency resolution. For local JS modules (import/export), I would need to look into them and what Deno offers.

Do you have a concrete use case in mind?

@brettinternet
Copy link
Author

Yes, forgive me for being so terse. Importing both local modules and modules from node_modules would be interesting. The use case for this would be to be able to use libraries from NPM within the sandbox.

@Bromeon
Copy link
Owner

Bromeon commented Aug 25, 2021

Sorry for the late reply. Back then there was no easy way to have modules in an embedded Rust application.
Directions I got were:

  • try to use swc and its bundler
  • look how Deno's CLI crate does it
    • however that spans caching, module loader and a few unrelated things
  • use the deno_core dependency resolver, but provide own module loader

Probably the last option is the most promising, but it would need more research to know what exactly it entails. Maybe documentation on this part has improved in the meantime, if someone has experience or inputs, that would be helpful!

@Bromeon Bromeon added the feature Library improvement label Aug 25, 2021
andrewtoth referenced this issue in picahq/js-sandbox-ios Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Library improvement
Projects
None yet
Development

No branches or pull requests

2 participants