Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
danvk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
danvk
2y ago
You can work around this by typing your import statement inside-out: import {} from 'fs'; Then move your cursor back inside the {} and you'll have nice autocomplete. Works with object destructuring, too.
32.
▲
by
danvk
3y ago
Or 2037.
33.
▲
by
danvk
3y ago
What about Object.fromEntries? See https://github.com/tc39/proposal-array-grouping for why this isn’t a method on Array.prototype.
34.
▲
by
danvk
3y ago
Thanks for the correction, Paul (and for the great email client and JS Compiler!). I've added a note to the article. The focus on inlining as a performance win makes a lot of sense. It's hard to get back into the pre-JIT IE6 minds
35.
▲
by
danvk
3y ago
Beyond that the branding is also confusing. Is it Closure? The Closure Compiler? Closure Tools? Google Closure? I used it for years and I'm still not clear which is right.
36.
▲
by
danvk
3y ago
That is an interesting note (and news to me as the article author). Note that they used Closure in its "simple" mode, rather than "advanced", which is what the post is mainly talking about. I wonder if React still uses C
37.
▲
by
danvk
3y ago
The lack of RTTI in TypeScript _is_ definitely a pain but the jump to "must use decorators" and "TypeScript is not a server language" is unjustified. There are many approaches to validation and RTTI with TS. For example,
38.
▲
TypeScript and SQL: Six Ways to Bridge the Divide
(effectivetypescript.com)
2 points
by
danvk
3y ago
|
3 comments
39.
▲
by
danvk
3y ago
I built something that sounds very similar at my last company called crosswalk. Open sourced here: https://github.com/danvk/crosswalk One thing that worked surprisingly well: codegen TypeScript types from your database
40.
▲
by
danvk
3y ago
This is fascinating. It reminds me of the infamous MCAS on the Boeing 737 MAX. A system was designed, implemented and rigorously tested to be used in a specific scenario. A decision was then made much later to use it in a very different sce
41.
▲
by
danvk
4y ago
Graphing Calculator was incredibly helpful for me when I was learning Calculus in school since it let me visualize everything I was learning interactively. Grapher just isn’t the same!
42.
▲
by
danvk
4y ago
I'm curious about the results, but remember that this article is talking about the type declarations files that tsc has to read (.d.ts files), not the JS that winds up in your bundle.
43.
▲
by
danvk
4y ago
Yes, the underlying issue has been resolved and so this should be a relatively easy fix for any project using `googleapis`. It's not mentioned in the article, but we also added an eslint rule to ban importing `googleapis` so that this
44.
▲
by
danvk
4y ago
This is the size of the type declarations files (.d.ts files) that `tsc` pulls in when compiling your code. This is distinct from bundle size. Tree shaking is a big win for bundle size. One of my big takeaways from looking at these visualiz
45.
▲
by
danvk
4y ago
My understanding is that skipLibCheck skips _type checking_ .d.ts files, i.e. looking for type errors in them. But tsc still has to read those files since you might refer to their types in your own code, which TypeScript will type check.
46.
▲
What's TypeScript compiling? Use a treemap to find out
(effectivetypescript.com)
406 points
by
danvk
4y ago
|
140 comments
47.
▲
by
danvk
4y ago
Are the photons that land in between the instruments just lost? Why not make them cover more of the space?
48.
▲
by
danvk
5y ago
Postponed by one day due to weather. New launch date is Christmas Day.
49.
▲
by
danvk
5y ago
By default, Node has a relatively low limit on the amount of memory it will use (I believe 1GB). As you get close to this, it thrashes as it tries to garbage collect more and more frequently. You can increase the limit by running `node --ma
50.
▲
by
danvk
5y ago
The 2012 article states: > Specifically, we ran analyses examining whether the two conditions differed in the number of instances wherein reported odometer mileages ended with 0, 5, 00, 50, 000, or 500. Numbers that end with these digits
51.
▲
by
danvk
5y ago
There are many forks of schemats out there that add various features. Here’s mine: https://github.com/danvk/pg-to-ts It copies Postgres comments over to JSDoc/TSDoc comments, emits some data about foreign key rela
52.
▲
by
danvk
6y ago
Why is it so important to express this as one SQL query? Why not just run the two simple queries? It feels as though two different types of things are being joined.
53.
▲
by
danvk
6y ago
I’d love a tool (that’s not Acrobat) to manage comments on PDFs.
54.
▲
by
danvk
6y ago
The longer I use React, the more I appreciate the power of being able to pass children to components.
55.
▲
by
danvk
6y ago
Could you say a little more about the sort of project you’d use Alpine on? “filled a massive void many people didn't even know existed” is certainly intriguing!
56.
▲
by
danvk
6y ago
Could this be useful for astronomers?
57.
▲
by
danvk
6y ago
If you prefer the "or throw" approach to handling null values, you can write a little helper to get something like it in TypeScript: function assert<T>(v: T | null | undefined, message?: string): asserts v is T {
58.
▲
by
danvk
6y ago
Can someone say more about the JavaScript optimization?
59.
▲
by
danvk
6y ago
I've run into many more performance issues with editor latency (i.e. tsserver) than with compiling (tsc). Unfortunately, these tend to be harder to diagnose. The worst turned out to be a crashing bug in tsserver that manifested as auto
60.
▲
TypeScript splits the atom A first look at TS 4.1's new template literal types
(effectivetypescript.com)
3 points
by
danvk
6y ago
|
0 comments
More ›