deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

compat: tracking issue for Vite

Open kt3k opened this issue 3 years ago • 1 comments

This issue tracks the issues for executing basic example of vite in compat mode

A typical workflow we try to support is:

yarn create vite
cd vite-project
yarn
yarn dev

With deno compat mode warpper script (the script should be named node and in your $PATH):

#!/bin/sh
DENO_NODE_COMPAT_URL=file:///path/to/your/deno_std/ deno run --no-check --unstable --compat -A $@

(DENO_NODE_COMPAT_URL=... part is optional)

  • [x] Not implemented: ChildProcess.unref() used in esbuild
  • [x] Not implemented: ChildProcess.ref() used in esbuild
  • [x] Internal server error: require$$0$5.URLSearchParams is not a constructor thrown in dev server runtime #2056
  • [x] Internal server error: fs__namespace.createReadStream is not a function thrown in dev server runtime #1435
  • [ ] 'upgrade' event is not implemented on http.Server
    • used here https://github.com/vitejs/vite/blob/c7fc7c34029f109bb716c6a2888022b2f4c40e3d/packages/vite/src/node/server/ws.ts#L39
    • https://github.com/denoland/deno_std/issues/2061
  • [x] process.stdout.clearLine is not a function
  • [x] https://github.com/denoland/deno_std/issues/2494

kt3k avatar Mar 23 '22 09:03 kt3k

Tentative implementation of ReadStream: https://github.com/denoland/deno_std/pull/1435

bartlomieju avatar Mar 23 '22 14:03 bartlomieju

Is this issue still relevant since the --compat flag has been removed? Vite support is more or less here (minus the need for the node_modules folder, rollup seems blocked on that) from what I've seen from community projects

lino-levan avatar Nov 01 '22 03:11 lino-levan

Let's close this as the basic features of vite work now via npm: specifier.

ref: https://www.youtube.com/watch?v=Zjojo9wdvmY

Is this issue still relevant since the --compat flag has been removed?

npm module compatibility issues are still relevant. Please replace --compat part with npm: specifier when reading them. --compat and npm: uses the same underlying API shims (which is std/node). So many issues should apply for both.

kt3k avatar Nov 01 '22 06:11 kt3k