-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Improve Node Compat Mode #12577
Comments
Next.js is currently blocked on missing support for IPC for subprocesses ( |
Is it using the "sendHandle" feature of IPC channels, or does it send only JSON messages? |
@piscisaureus it looks like only this signature is used: send(message: Serializable, callback?: (error: Error | null) => void): boolean; |
Parcel uses "native addons" ( |
https://nodejs.org/api/tls.html for mongodb |
I'm tring to run webpack in deno. Problems and solutions:
|
Thanks for the info @Jack-Works
This is tracked in denoland/std#1622
This should work without a problem, Deno support dynamic imports and should resolve the package properly, can you point me to the relevant part in your branch?
In compat mode
This is being worked on.
Good solution, there's nothing we can do with |
This comment has been minimized.
This comment has been minimized.
This resolution algorithm is already supported by Deno in the compat mode. Thank you for reproduction, I will take a look and investigate, probably some kind of bug in the implementation. |
This comment has been minimized.
This comment has been minimized.
No, in compat mode, both CJS and ESM resolution works as in Node.js, see https://deno.land/manual@main/npm_nodejs/compatibility_mode#how-does-it-work
We implemented a separate ESM resolver that follows Node.js algorithm: https://github.com/denoland/deno/blob/main/cli/compat/esm_resolver.rs |
Oh, that's cool. Is it possible to specify a Worker is in the compat mode? Because my goal is to compile webpack in a Worker and use the main thread to schedule multiple tasks. |
No, not yet. There's denoland/std#1151 for that. |
I also need to specify a smaller range of security permissions (e.g. No network access) in the worker. I can do that in the Worker but is that possible in |
No, I suggest to open a new issue in |
I confirmed that |
#13227 should probably be included here |
Ran unit tests of ESLint using the below command in eslint repository (I stripped
with #!/bin/sh
DENO_NODE_COMPAT_URL=file:///path/to/denoland/deno_std/ deno run --no-check --unstable --compat -A $@ I got this result
I haven't analyzed these 534 errors yet, but at least 98.3% of test cases passed. |
To help any unlucky soul who will try to come up with a way to test any of these claims :) I want to present to you a bit of a document on the actual state of Vite compatibility (i.e. running Vite with deno --compat). How to start testing (requires node/yarn, also huge thanks to Ryan on the starting point with rollup): mkdir deno-project && cd deno-project && yarn init deno-project -y
yarn add vite @vitejs/plugin-react @types/node
date > ./index.html
deno run --no-check --unstable --compat -A ./node_modules/.bin/vite You will see
Build command doesn't work even in this simple case.
If you run
Also, if you add a config file import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()]
}); it will crash:
|
vite compatibility is also tracked in this issue denoland/std#2055 For ChildProcess.ref/unref APIs, we first needs to implement vite is also blocked by |
Thanks for looking into it @JLarky. Last time I checked (~February) I was able to run |
@kt3k thank you for the link! that would have helped ^_^
Interesting! I will check if I can find an older version of vite that is compatible with Deno. Also, I don't know if this is on topic, but I couldn't find this information anywhere. Is there a way to run |
If you use mac or linux, you can replace #!/bin/sh
deno run --no-check --unstable --compat -A $@ And the commands like |
just wait to see WinterCG's job, such as universe the api first target gradually.imaging the last result: nodejs-------sync-----------polyfill-----------little difference, but not popular anymore |
Hi, Node streams V4 with better readable stream support was released - it'd be neat if Deno used it instead of its own implementation of Node streams since it contains a bunch of bug fixes and new APIs. |
Thanks for the heads up @benjamingr, could you link to relevant bits that we could reuse? |
This is the release https://github.com/nodejs/readable-stream/releases/tag/v4.0.0 - it updates Node streams to be compatible with Node.js 18 (and not 10) which contains a ton of new APIs (like iterator helpers). It should be consumable directly in Deno since it works in browsers. |
See also nodejs/readable-stream#451 |
Yeah though that predates the streams V4 release |
Deno has panicked.
Platform: linux x86_64
|
How is this coming along ? |
I'm going to close this issue now as we removed --compat mode and focus our efforts on better compatibility using |
Make various popular projects run:
blocked on http client workblocked on tls std/node: support the "tls" module std#1475should more or less work - maybe broke on timeout (feat(node): add Timeout class std#1699)child_process.send
(compat: Add required APIs for "child_process.send" #12879)blocked on tlsFeatures:
The text was updated successfully, but these errors were encountered: