Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jasonkillian
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
jasonkillian
4y ago
Agreed, but it's a pretty big footgun because `useEffect` is often the seemingly easiest way to do the things you list. I've had similar conversations many times with coworkers before when they were using `useEffect` to keep a sta
2.
▲
by
jasonkillian
4y ago
It is a bit more complicated in practice though than "a React component is just a function that rerenders when called". In some ways, the function acts more like a class, and then React, internally, uses it to create "instanc
3.
▲
by
jasonkillian
4y ago
> TypeScript's type annotations are really a DSL embedded into JavaScript. And they can, and, depending on the problem at hand, should be treated as such. I think this is the key. If treated as you describe, meaning the advanced typ
4.
▲
by
jasonkillian
5y ago
Happened to see this thread on HN, (and disclaimer I'm an engineer at Hex) very cool project jwithington! Wanted to take a second to address your comment about performance, lqet. All your points are absolutely fair - I personally apolo
5.
▲
by
jasonkillian
5y ago
In addition to being essentially a combined "filter" and "map", it's also a "better" filter than filter itself in TypeScript in such that it narrows types much more ergonomically[0]. In TypeScript, you mig
6.
▲
by
jasonkillian
5y ago
Wouldn't recommend doing this - if the original array is of significant length this'll get quite slow because `acc.concat` has to create a brand new array of slightly longer length on each iteration it's called. Better to jus
7.
▲
by
jasonkillian
5y ago
I don't disagree with you on readability being important or on the value of developer time. It's just that the marginal costs of `memo`, `useMemo`, and `useCallback` are quite low. They don't add cyclomatic complexity, they d
8.
▲
by
jasonkillian
5y ago
This is a great article and I agree with it fully. The argument that a lot of popular React voices have made, "React is fast and it's prematurely optimizing to worry about memoizing things until a profile shows you need it",
9.
▲
by
jasonkillian
6y ago
It's a current WIP idea for the spec: https://github.com/tc39/proposal-temporal/pull/700 Figuring out a name is still part of the ongoing discussion, so this specific case of `LocalDateTime` isn't a
10.
▲
by
jasonkillian
6y ago
I think this is a great proposal and a huge step in the right direction for JS. I am curious though, is there a reason not to just essentially duplicate the Joda[0]/Java[1]/ThreeTen[2] API? As far as I understand, they are general
11.
▲
by
jasonkillian
6y ago
Hooks are great for simple use cases like `useState`, `useContext`, some uses of `useRef`, etc. and can make the code easier to read and reason about (while conveniently working very well with TypeScript). The rules do start to get really t
12.
▲
by
jasonkillian
7y ago
I've found js-joda is a good JS datetime library: https://github.com/js-joda/js-joda
13.
▲
by
jasonkillian
7y ago
In case it wasn't immediately obvious, there's a Stage 2 tc39 proposal that was spawned from this blog post called Temporal: https://github.com/tc39/proposal-temporal At a glance, it does follow the same idea
14.
▲
by
jasonkillian
8y ago
For context, this was the most requested feature [0] in the isaacs repo of GitHub requests [1]. [0]: https://github.com/isaacs/github/issues/283 [1]: https://github.com/isaacs
15.
▲
New GitHub Feature: Subscriptions View
(github.com)
5 points
by
jasonkillian
8y ago
|
2 comments
16.
▲
by
jasonkillian
8y ago
Weirdly enough, both websites use this exact same quote: "This means you'll need to make an API (application programming interface). It's how all your friendly apps talk to each other." Either plagiarism was involved, or
17.
▲
by
jasonkillian
8y ago
> Surely Node.js is going to be looked back upon as one of the worst mistakes in the history of 21st century programming. Why is that? There were dynamically-typed backend languages long before Node.js became popular. And you now can eas
18.
▲
by
jasonkillian
8y ago
Are you storing a large amount of offline music on an SD card? I've had that cause issues for me in the past. Their guide to fixing issues[0] is generally worth giving a shot. [0]: https://community.spotify.com/t5/
19.
▲
by
jasonkillian
8y ago
The difference is subtle (and took me a bit to figure out!). In the article's example component, the component's "main" function gets re-run on every render and a new `count` variable is created each time. The effect fun
20.
▲
by
jasonkillian
8y ago
Wow, I really don't know what to think of this article. I have to give Dan credit that every time I thought the code started looking really crazy, he'd say something like: "Admittedly, [this] code can be disorienting. It’s mi
21.
▲
by
jasonkillian
8y ago
Type guards are a useful construct, especially when dealing with data from an API that could come in a variety of shapes. However, if you have control over the data shape, in general, it's nicer to take advantage of discriminated union
22.
▲
by
jasonkillian
8y ago
Wrote this article because I was inspired by the amount of data the GitHub API gives easy access to and all the sorts of interesting info that can be gleaned from it. It also raises some interesting questions on how to use this data effecti
23.
▲
Analyzing Code Review Response Times at TrialSpark with GraphQL and Chartify
(medium.com)
6 points
by
jasonkillian
8y ago
|
1 comments
24.
▲
by
jasonkillian
8y ago
Yes, your experience mirrors mine completely. It's quite difficult to get complex higher-order components working correctly, especially if you're throwing in things like defaultProps and propTypes. For example, some issues I'
25.
▲
by
jasonkillian
8y ago
Ah, I didn't realize this, very cool collaboration! For those who are reading this and might find it helpful, here's a link to the official blog post on the work: https://blogs.msdn.microsoft.com/typescript/20
26.
▲
by
jasonkillian
8y ago
How well does Babel transpile TS? My initial instinct is that I'd trust the real TS compiler over Babel, but I've never tried compiling TS with Babel. I assume the real TypeScript compiler still does the type-checking and that wou
27.
▲
by
jasonkillian
8y ago
There are _some_ downsides: * Slightly more complex build workflows * Integrating with non-TypeScript libraries can be difficult depending on the quality of external typings available * Error messages can at times be slightly obtuse (especi
28.
▲
Ask HN: Curriculum ideas for teaching programming to middle school kids
3 points
by
jasonkillian
9y ago
|
2 comments
29.
▲
by
jasonkillian
10y ago
Thanks for the kind words achikin! Blueprint doesn't include anything to simplify layout. However, if you're able to only support relatively modern browsers, flexbox [0] is a great CSS feature that really makes layout easier. If y
30.
▲
by
jasonkillian
10y ago
Good catch, we'll take a look at this. I've filed an issue to track it [0]. [0]: https://github.com/palantir/blueprint/issues/122
More ›