Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lucacasonato
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
lucacasonato
4y ago
Just to preemptively clear up some confusion: Deno is *not* removing type-checking. The only change is that type checking is now it's own subcommand: `deno check`, instead of happening as part of `deno run`. See last releases' blo
92.
▲
by
lucacasonato
4y ago
Did you read the rationale explained in last releases' blog post[0]? [0]: https://deno.com/blog/v1.21#deno-check-and-the-path-to-not-t...
93.
▲
by
lucacasonato
4y ago
I think you need to categorize divergence into two parts: a) Divergence in implementation on the same API surface (e.g setTimeout in Node) b) Divergence in API surface for a similar implementation (e.g WHATWG streams vs Node streams) The fo
94.
▲
Speeding up Prettier locally and on your CI with dprint
(david.deno.dev)
201 points
by
lucacasonato
4y ago
|
50 comments
95.
▲
by
lucacasonato
5y ago
Deno Deploy ( https://deno.com/deploy ) uses the same optimizations as CFW to achieve effectively 0ms cold starts. Netlify Edge Functions are still in beta and don't have all of the same optimizations yet, but we're
96.
▲
by
lucacasonato
5y ago
We probably will eventually. A talk like this takes a _lot_ of time to prepare though, so it's not on the top of our priority list. But it will happen eventually. The TLDR is that Deno Deploy works pretty similarly to CFW in that it ca
97.
▲
by
lucacasonato
5y ago
Deno can in theory do the pre-initialization that wizer does for JS too. We have all of the infrastructure for it, we just have not gotten around to actually implementing it yet.
98.
▲
by
lucacasonato
5y ago
Actually `context.rewrite` returns a `Promise<Response>`. The `async` isn't necessary here, but it also doesn't particularly hurt. You can return a `Promise` from an async function no problem.
99.
▲
by
lucacasonato
5y ago
Netlify and Supabase use Deno's infrastructure for code execution ( https://deno.com/deploy/subhosting ). Vercel hosts their edge functions on Cloudflare (nothing to do with Deno). Slack's Deno runtime is hoste
100.
▲
by
lucacasonato
5y ago
Yeah, I agree it is definitely worth trying! I think all the talk around SES will push JS as a whole further towards something that could support capability based permissions securely in the future.
101.
▲
by
lucacasonato
5y ago
Yup, SES is very interesting, and I think it can solve this problem in the future. As this post is about the here and now though, and SES is not yet ready for widespread adoption, I think my point stands that at this current time it is not
102.
▲
by
lucacasonato
5y ago
If it was 2000, or even 2010, I'd agree with you. But that ship has unfortunately sailed. People modify the prototype all the time. If we were to freeze all prototypes right now in JS, a lot of existing code would break.
103.
▲
by
lucacasonato
5y ago
> The fundamental problem with npm is that any package you install has full access to do whatever it wants on your computer. Let me try to answer more concisely at a higher level: Due to JS being a very dynamic language, it is at this ti
104.
▲
by
lucacasonato
5y ago
Yup, SES would address this. But SES also needs to bring with it a paradigm shift for JS: a) Folks would have to load each bit of code they want separate permissions for in a separate compartment. This won't be easy. b) Runtimes will n
105.
▲
by
lucacasonato
5y ago
Yup, for sure. I think capability based ShadowRealms are also totally doable. I'm sure we'll add those for Deno once we add support for ShadowRealms.
106.
▲
by
lucacasonato
5y ago
Deno core team member and TC39 delegate here. We have pondered about capability based security for Deno in the past. Our conclusion has always been that this is not possible to do securely in JS without freezing all prototypes and objects b
107.
▲
by
lucacasonato
5y ago
Or you can use `deno vendor` to check in your dependencies into version control, or put a caching HTTP proxy between you and the origin server. Don’t be fooled: Node & NPM have these same problems.
108.
▲
by
lucacasonato
5y ago
Yup, this is very unfortunate, but sadly a browser cross origin privacy protection. We can not fix it without injecting some third party code into your site automatically (which we don’t want to do).
109.
▲
by
lucacasonato
5y ago
Also check out https://fresh.deno.dev
110.
▲
by
lucacasonato
5y ago
Deno Deploy is serverless, and Deno CLI is always on, so you can do either with the same code
111.
▲
by
lucacasonato
5y ago
There is another blog post coming up in a couple of weeks (hopefully) that will demo this.
112.
▲
by
lucacasonato
5y ago
It’s actually not needed at all for runtime. It’s purely for editor experience and type checking.
113.
▲
by
lucacasonato
5y ago
The `ssr` function uses the twind module to extract the classes and generate plain CSS.
114.
▲
by
lucacasonato
5y ago
I think you might have misunderstood the blog post. It is server-side rendering on the edge, shipping nothing more than plain HTML/CSS to the browser. There is no client side JS *at all* here.
115.
▲
by
lucacasonato
5y ago
You should be branching on the existence of `document` to discover if you are running in a DOM context, not `window`. Using `window` to branch SSR and CSR code will also inevitably will give false positives/negatives in workers and wor
116.
▲
by
lucacasonato
5y ago
Try `--no-check` when using `--watch` and you already get type errors from your IDE. Should speed up hot reload and hot restarts significantly :-)
117.
▲
by
lucacasonato
5y ago
> with no way to change it You are so wrong. If you would have done maybe 3 minutes of Googling you would know we support import maps, which allow you to arbitrary rewrite specifiers, even deep inside of the module graph.
118.
▲
by
lucacasonato
5y ago
> So you immediately pinpointed the difference: with Node I can run my own registry and easily set up npm/yarn to never load packages from anywhere else. Deno loads code from random urls. Which is why we support a) import maps which
119.
▲
by
lucacasonato
5y ago
And we have lock files to verify integrity. This is no different to module loading in Node. If you don’t trust your registry, you should not be loading code from it!
120.
▲
by
lucacasonato
5y ago
How much memory do you have? It should use a prebuilt version of V8 by default to speed up the build process.
More ›