fix(repl,format): fix repl & formatter issues
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
-
vmmodule not allowing top level await: https://github.com/nodejs/node/issues/40898
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) |
👋 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 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 