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

feat: support Bun by using ShadowRealm #4111

Closed
wants to merge 3 commits into from

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Sep 11, 2023

Description

Currently, all jsdom tests are failing because bun doesn't seem to correctly support VM module.

The reason why other tests are failing is still unknown to me,

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:.

@stackblitz
Copy link

stackblitz bot commented Sep 11, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Sep 11, 2023

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit d44ef13
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/65032212085b8b0008307243

@sheremet-va sheremet-va marked this pull request as draft September 11, 2023 15:16
@AriPerkkio
Copy link
Member

all jsdom tests are failing because bun doesn't seem to correctly support VM module.

The compatibility page says that "VM modules" are not supported but I interpreted that as "importModuleDynamically does not work". Maybe I'm just reading this wrong. 🙃

It does say that core node:vm functionalities are implemented. I think JSDOM was using createContext+runInContext which seem to be exported: https://github.com/oven-sh/bun/blob/51d3d4382281f789f8175079ed426a63529eb3e7/src/js/node/vm.ts#L8. I haven't yet had time to try this out but maybe there's something still missing.

@sheremet-va
Copy link
Member Author

ShadowRealm was moved back to Stage 2. This PR is already outdated, and by the time ShadowRealm is in stage 3 again, it will be severely outdated. Let's revisit this when ShadowRealm is stable.

@sheremet-va sheremet-va closed this Feb 7, 2024
@sheremet-va sheremet-va deleted the feat/support-bun branch February 7, 2024 12:28
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