Ship a @remix-run/deno-deploy package? #4577
Replies: 2 comments 4 replies
-
I once had the idea of shipping |
Beta Was this translation helpful? Give feedback.
-
Deploying Deno modules written in TS is standard for Deno Deploy. We happen to use NPM as the distribution mechanism for our It sounds like you are opting out of Deno's built-in typechecking and using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@remix-run/deno
lives on NPM, but is "not an NPM package":remix/packages/remix-deno/.empty.js
Lines 4 to 5 in ea19c12
Unfortunately this makes "hello world" on Deno Deploy a lot harder than it needs to be, IMO. I don't think I actually need a Deno module, just an NPM package like
@remix-run/cloudflare-workers
, but for Deno Deploy.One concrete problem with the Deno module is TypeScript checks. We will not use the Deno CLI to lint or type check; we do this ourselves in our monorepo root. But
import type { MetaFunction } from "@remix-run/deno"
causes errors when we runtsc
:If there are
.ts
files innode_modules/
, and you import from them, then they are considered part of your program, and must follow your rules (skipLibCheck
has no effect on.ts
files, only.d.ts
files). This isn't great!In our case, we worked around these issues by importing types from
@remix-run/server-runtime
instead of@remix-run/deno
, and changing ourserver.ts
toserver.js
to avoid type checks.But I can't help wondering if there's a better way to do this: could
@remix-run/deno
remain a Deno module that hides Deno platform concerns, while a regular@remix-run/deno-deploy
package exposes the parts Remix actually needs, with normal exports and type safety?I am new to this, and I might be missing some things; I just wanted to provide the early feedback that this was a struggle struggle to get to "hello world", and I would love to see Deno Deploy as easy to start with as, say, Cloudflare Workers.
Beta Was this translation helpful? Give feedback.
All reactions