Kofi
Kofi
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
Do you have a package.json or deno.json at the root of your project? Did you generate your vite project with the npm package create-vite?
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
I don’t understand why you need to use Deno check if you use VS Code with the Deno extension for LSP
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
in fact all this was painfully useless ❌ Don't deno run -A npm:create-vite-extra ✅ Do deno run -A npm:create-vite Extra have deno.json, but with Deno now, especially with Existing templates out there and Deno2 RCs, it better have a package.json, then you install with deno install and run your package.json task with deno run taskName
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
So basically you were right, also it needed to do: deno add npm:@types/react npm:@types/react-dom
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
Exactly. They probably use vim too much. At least it don’t work on Visual Studio Code. Because yea the project works and reload nicely but LSP is blind to the setup
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
Thank you! I’ll check that as soon as possible 🙏
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
That's pretty bad isn't it?
22 replies
DDeno
Created by Kofi on 2/27/2024 in #help
Deno LSP + React + TypeScript + Vite (--node-modules-dir)
I've managed to solve quite a bit of errors. Don't know if its the right way tho. deno.json I've added
"imports": {
"react": "npm:react@^18.2.0",
"react-dom": "npm:react-dom@^18.2.0"
},
"compilerOptions": {
"lib": [
"dom"
],
"jsx": "react-jsx",
"jsxImportSource": "react",
"types": [
"npm:@types/react",
"npm:@types/react-dom"
]
}
"imports": {
"react": "npm:react@^18.2.0",
"react-dom": "npm:react-dom@^18.2.0"
},
"compilerOptions": {
"lib": [
"dom"
],
"jsx": "react-jsx",
"jsxImportSource": "react",
"types": [
"npm:@types/react",
"npm:@types/react-dom"
]
}
But TypeScript don't give me Type inferrance this way App.tsx
const [count, setCount] = useState(0);
// ...
<button onClick={() => setCount((count) => count + 1)}>
const [count, setCount] = useState(0);
// ...
<button onClick={() => setCount((count) => count + 1)}>
error/lint to: Parameter 'count' implicitly has an 'any' type.deno-ts(7006) Because count is not inferred, the only way I managed to solve this is by annotating the type
<button onClick={() => setCount((count: number) => count + 1)}>
<button onClick={() => setCount((count: number) => count + 1)}>
22 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
I really don’t know how to do it with hono. My index.html is loaded from / from static, then it ask for client.js, and this is why I tried to use the @deno/emit’s transpile call. Even better can I just strip the ts stuff without types check
14 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
Yes I want it in RAM man please 🙏🏾
14 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
Do you know how can I manage to do it?
14 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
I really don’t care it’s slower, 99.99% of application don’t need speed. The only reason I’m on Deno is for no build
14 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
No build steps
14 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
⬆️
14 replies
DDeno
Created by Kofi on 8/30/2024 in #help
@deno/emit's transpile with JSR
I would love something on the fly like Fresh used to be, isn’t with the past Deno.emit() call now replaced with package @deno/emit
14 replies
DDeno
Created by tigawana on 12/26/2023 in #help
List kv items using a partial key
Better yet since Deno 1.38: - in one step
const repos = await Array.fromAsync(kv.list({ prefix: ["repo_pkgjson"] }));
const repos = await Array.fromAsync(kv.list({ prefix: ["repo_pkgjson"] }));
- in two steps
const iter = kv.list({ prefix: ["repo_pkgjson"] });
const repos = await Array.fromAsync(iter);
const iter = kv.list({ prefix: ["repo_pkgjson"] });
const repos = await Array.fromAsync(iter);
And you can still access each of them before storing them. For instance if you just want the Value and not the KV Part Key nor the Versionstamp:
const iter = kv.list({ prefix: ["repo_pkgjson"] });
const repos = await Array.fromAsync(iter, repo => repo.value);
const iter = kv.list({ prefix: ["repo_pkgjson"] });
const repos = await Array.fromAsync(iter, repo => repo.value);
6 replies
DDeno
Created by Billionz on 12/4/2023 in #help
How do you use a private docker hub image on AWS Lightsail?
Can’t you use the one you have on GitHub or GitLab?
4 replies