Skip to content
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

Setting up a Fresh project to work with Deno KV is obscure #2344

Open
skybrian opened this issue Mar 1, 2024 · 1 comment
Open

Setting up a Fresh project to work with Deno KV is obscure #2344

skybrian opened this issue Mar 1, 2024 · 1 comment

Comments

@skybrian
Copy link

skybrian commented Mar 1, 2024

If I create a project using ‘deno init’ then the Language Server (and therefore VS Code) can type-check code that uses Deno KV by default. (Though it won’t run unless you enable Deno KV, since it’s an unstable API.)

If I create a new Fresh project then it doesn’t work.

The reason for this is the reference declarations at the top of main.ts. To enable type checking for unstable API’s, turning on unstable API’s in either VS Code’s settings or in deno.json doesn’t work. You need to edit main.ts and add a reference declaration.

(Actually the reference declaration can be anywhere, but main.ts is the logical place to put it.)

This seems needlessly obscure. My suggestion: enable type-checking for unstable API’s by default. There is still another step to actually use them, but this is more consistent with non-Fresh projects and with the ‘deno check’ command.

@skybrian
Copy link
Author

skybrian commented Mar 7, 2024

More context: Deno changed in early January to always type-check unstable API's.

See: denoland/deno#21825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant