edge-runtime icon indicating copy to clipboard operation
edge-runtime copied to clipboard

fix(repl,format): fix repl & formatter issues

Open Schniz opened this issue 3 years ago • 1 comments

This PR introduces the following changes:

  • fix(cli): make repl execute all commands in the edge vm instead of copying the values
  • fix(format): include constructor name in the logger

Unfortunately, there an open question that makes this PR to be kept in draft state until we resolve it: when not passing an evaluator, seems like the user code gets executed in a context that allows top-level await. This PR disables it because the code gets evaluated in a vm context that does not allow it, and vm.Module is still experimental.

We need to decide whether we still want to support it, and if we do, we need to add a test for it to make sure we do support it in this PR somehow.

See

  • vm module not allowing top level await: https://github.com/nodejs/node/issues/40898

Schniz avatar Aug 03 '22 08:08 Schniz

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
edge-runtime ✅ Ready (Inspect) Visit Preview Aug 10, 2022 at 6:57AM (UTC)

vercel[bot] avatar Aug 03 '22 08:08 vercel[bot]

👋 was curious if there was any updates on this? Followed the breadcrumb here via #62, which bit me with an expect(response).toBeInstanceOf(ArrayBuffer); line in a Vitest suite. My understanding is that the test is failing because the matchers can't read the constructor name, which I think this would solve 😁

IanMitchell avatar Apr 12 '23 00:04 IanMitchell

@IanMitchell sorry for the late response (I didn't get notified), my changes aren't really related to that. I think that instanceof checks are currently broken and #309 will fix them. Not sure if this is the case with vitest tho but I believe Vitest is using resposne instanceof ArrayBuffer which might fail :sherthonk_holmes:

Schniz avatar May 01 '23 11:05 Schniz