Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
redabacha committed Oct 20, 2024
1 parent 2a86c02 commit b345c29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ deno run -A npm:create-remix@latest --no-install --template redabacha/remix-deno

And then run `deno install` in the created directory.

## Using JSR/HTTPS imports
## Using JSR and HTTPS imports

Thanks to the [@deno/vite-plugin](https://github.com/denoland/deno-vite-plugin),
it's possible to use packages from JSR and from HTTPS imports within the `app/`
directory which will get included in the server or browser bundles as needed.
This currently has a caveat where you need to manually declare the imports using
the `declare module` syntax as
[seen here](https://github.com/redabacha/remix-deno-template/tree/main/app/env.d.ts#L11)
for example in order to convince the Typescript type checker it exists.
it's possible to use packages from JSR and imports from HTTPS URLs (via the
[deno.json `imports` field](https://docs.deno.com/runtime/fundamentals/modules/#managing-third-party-modules-and-libraries))
within the `app/` directory which will get included in the server and/or browser
bundles as needed. This currently has a caveat where you need to manually
declare the imports using the `declare module` syntax as
[seen here](./app/env.d.ts#L11) in order to convince the Typescript type checker
it exists. This isn't necessary if the Deno type checker is used for the entire
project.

## Using only the Deno type checker
## Using the Deno type checker for the entire project

Currently the VSCode Deno extension has an issue with auto-import suggestions
for npm packages which makes not fully ideal for development at the moment, see
[this issue](https://github.com/denoland/vscode_deno/issues/1177) for more
information. However
[here's a working branch](https://github.com/redabacha/remix-deno-vite-template/tree/using-deno-typechecker)
that uses only the Deno type checker for all files in the project with no
dependency on typescript.
that uses only the Deno type checker for all files with no direct dependency on
typescript.

# Remix + Deno

Expand Down
2 changes: 1 addition & 1 deletion app/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ declare module "react-dom/server.browser" {
export * from "react-dom/server";
}

// JSR packages must be declared manually as tsc isn't aware of deno imports
// Imports from deno.json must be declared here manually as tsc isn't aware of them.
// TODO: create a script to declare these modules based on deno.json with typings
declare module '@std/text';

0 comments on commit b345c29

Please sign in to comment.