Skip to content

fix(vm): support network imports #5610

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

Merged

Conversation

sheremet-va
Copy link
Member

Description

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@sheremet-va sheremet-va changed the title feat(vm): support network imports fix(vm): support network imports Apr 24, 2024
Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for fastidious-cascaron-4ded94 ready!

Name Link
🔨 Latest commit 2bbf569
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/6630beb6a5718f0008ecf9ec
😎 Deploy Preview https://deploy-preview-5610--fastidious-cascaron-4ded94.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sheremet-va sheremet-va requested a review from hi-ogawa April 24, 2024 12:44
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up.

I wasn't sure if we should enable code execution from network by default.
I'm not really familiar with what people consider secure or insecure, but I think NodeJs and Deno requires explicit flags to enable this, so I was a bit scared of this.
Also a few more limitations on NodeJS are written here https://nodejs.org/api/esm.html#https-and-http-imports, for example, they only support "https" and also they probably don't allow import "file:..." in network modules.

What's your thought?

Also just cross-linking my old PR #4996

@sheremet-va
Copy link
Member Author

What's your thought?

I think we should follow the limitations of Node here. I will update the PR

@sheremet-va sheremet-va force-pushed the feat/support-network-imports-vm branch from ba6ba07 to 2bbf569 Compare April 30, 2024 09:49
@sheremet-va sheremet-va merged commit 103a600 into vitest-dev:main Apr 30, 2024
19 checks passed
@sheremet-va sheremet-va deleted the feat/support-network-imports-vm branch April 30, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants