-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Deno support #754
Comments
Short: No. Long: Deno bundles tsc with itself and, apart from it being a completely insane model, it prevents us from using compiler plugins that are needed for execution tracing & optimizations additionally the module pattern that Deno uses is non-standard. Advice: Treat Deno like any other JS target and compile TS independently it will be faster to run and more reliable. |
Thank you for the answer, the explanation, and the advice! |
Re-opening for posterity, following a discussion with a deno contributor https://twitter.com/MichaelArnaldi/status/1478344273007460354 the only solution to ever support deno will be to fork deno. I personally have no bandwidth to do that but if anyone wants to try I'd be happy to help. |
Looks like the upcoming version Effect will be usable with Deno? That's very exciting. Ideally there would be a little sample project for this :) |
So Deno in theory can be used given we no longer rely on module augmentation for HKTs and all imports are global imports compliant with esm, that said HKTs aren't final and will be part of On the topic of effect with TS+ and tracing it is unfortunately not a possibility in the short term given that the Deno stack is pretty tightly coupled with the tsc they use and the compilation chain, it would require a fork and potentially a re-join after a while if a stable integration is developed |
@mikearnaldi Did you change your mind about the esm? I remember you told me it's a no-go if I understood it correctly. |
@steida no pretty much the same opinion, we cannot publish a package with |
@mikearnaldi What if this lib would be written in Deno and compiled/transpiled to Node/whatever? There are a few advantages. |
@steida there are a few advantages and also many disadvantages, this library is written in TS+, the design of Deno doesn't allow for custom compilers to be used so it isn't a possibility (and even if it was the module structure of using https imports isn't something I like nor that I'll ever envision using). A potential path forward if anyone is interested enough may be to fork Deno, at least temporarily, and get support for TS+, if that happens it may make sense |
@mikearnaldi, I think Deno 2.0 which is in RC phase, aims to have full Node.js compatibility? Could this be working now? I quickly tried spinning up a new Deno project with the latest RC and added some lines: import { Effect } from "npm:effect";
const program = Effect.log("Program works");
const programSucceed = Effect.tryPromise({
try: async () => {
return await Promise.resolve("Promise resolved");
},
catch(err) {
return new Error("Promise rejected", { cause: err });
},
});
const programReject = Effect.tryPromise({
try: async () => {
return await Promise.reject("Promise rejected");
},
catch: (err) => {
return new Error("Promise rejected", { cause: err });
},
});
const all = Effect.all([program, programSucceed, programReject]).pipe(
Effect.catchAll((err) =>
Effect.logError({
where: "catchAll",
message: err.message,
cause: err.cause,
}),
),
);
Effect.runPromise(all); Output: timestamp=2024-09-25T00:22:07.003Z level=INFO fiber=#0 message="Program works"
timestamp=2024-09-25T00:22:07.004Z level=ERROR fiber=#0 message="{
\"where\": \"catchAll\",
\"message\": \"Promise rejected\",
\"cause\": \"Promise rejected\"
}" |
With npm imports the library works fine indeed |
I came here because I was not able to find a platform implementation for deno. So the current status is that it is not officially supported, and that only works with |
So first of all using the npm prefix doesn't mean it's not supported it just means you're using npm as a registry, Deno and JSR are different projects and publishing on JSR exposes a Pandora box in terms of potential duplication of packsges, keeping a single publish is the safest bet, hopefully JSR will implement npm compatibility in the sense that JSR packages can depend on NPM (at the moment the opposite is true). The other thing is, Effect officially supports Deno too but this isn't the case for ecosystem modules like effect/platform, this isn't because we have a case against Deno but rather because we have a single monorepo and tooling where we can easily test standard runtimes such as node, bun, browser, edge, and unfortunately in the same setup Deno doesn't work, the day that Deno supports monorepo like we have will be the day we add Deno support to platform |
Did you mean to say that backward? JSR supports packages that depend on npm packages, npm just doesn't support JSR (natively, I think published packages should also be able to use the npm-registry compat layer that the
Deno supports npm workspaces as of (denoland/deno#18546). Vitest compat is also getting active work (denoland/deno#23882); I just tried it and it works great, though coverage is broken on stable (it might fixed on canary right now, I haven't tried it). I'd guess coverage will probably get fixed by 2.1. Are there any other blockers? I've started implementing it in Footnotes
|
Are there any plans to support Deno?
The text was updated successfully, but these errors were encountered: