Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mzgol
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
mzgol
7y ago
Not everything can be handled by a minifier. Consider multiple accesses of `item.prop` where `prop` is optional. You can cache `item.prop` in a variable to avoid multiple checks but the minifier usually cannot revert it back to the previous
2.
▲
by
mzgol
7y ago
Thanks for the terminology fix. With lots of these assertions, especially in the form of `x as unknown as TheProperType` we wouldn't have to increase file size but that would nullify most of the TypeScript gains and would make the code
3.
▲
by
mzgol
7y ago
A nice thing is you can import from `src/jquery.js` directly from the browser without any build process in every modern browser. https://gist.github.com/mgol/af95c1358d4ca9f2d45db4f0c55a74a... https://t
4.
▲
by
mzgol
7y ago
Some of jQuery APIs wouldn't be that easy to convert to TS internally, we'd have to have lots of casting and most likely file size would suffer and that's one thing we care a lot about in the jQuery team. Plus, that would be