Live data from Hacker News

Removing jQuery from GitHub.com front end

githubengineering.com

1–10 of 26 posts

Re: Removing jQuery from GitHub.com front end

#3
post #2

> Having static type checking helped us have greater confidence around those refactorings Does Github use TypeScript?

> Finally, we wanted to start annotating types with Flow to perform static type checking at build time, and we concluded that the chaining syntax doesn’t lend itself well to static analysis, since almost every result of a jQuery method call is of the same type. We chose Flow over alternatives because, at the time, features such as @flow weak mode allowed us to progressively and efficiently start applying types to a codebase which was largely untyped.

Re: Removing jQuery from GitHub.com front end

#6
post #3
post #2

> Having static type checking helped us have greater confidence around those refactorings Does Github use TypeScript?

> Finally, we wanted to start annotating types with Flow to perform static type checking at build time, and we concluded that the chaining syntax doesn’t lend itself well to static analysis, since almost every result of a jQuery method call is of the same type. We chose Flow over alternatives because, at the time, features such as @flow weak mode allowed us to progressively and efficiently start applying types to a c…

I've never used Flow, but that sounds the same as `--noImplicitAny` or `--strict` in TypeScript.

Re: Removing jQuery from GitHub.com front end

#7

> Set up metrics that tracked ratio of jQuery calls used per overall line of code and monitored that graph over time to make sure that it’s either staying constant or going down, not up. Would love to know how this was done.

I would think you could wrap $ or jQuery or whatever in a hook for metrics.

Re: Removing jQuery from GitHub.com front end

#8

> Set up metrics that tracked ratio of jQuery calls used per overall line of code and monitored that graph over time to make sure that it’s either staying constant or going down, not up. Would love to know how this was done.

I would think you could wrap $ or jQuery or whatever in a hook for metrics.

Right, I can visualize how that'd look from a top-level, but it'd be cool if they could share details. What sort of data did they pass along? Was this a standalone little dev tool on everyone's machine? Talk to a server?

Re: Removing jQuery from GitHub.com front end

#9

> Set up metrics that tracked ratio of jQuery calls used per overall line of code and monitored that graph over time to make sure that it’s either staying constant or going down, not up. Would love to know how this was done.

As a guess, wrap each method in a function that records access and run original method? That way you can get stats for each method.

Re: Removing jQuery from GitHub.com front end

#10

> Set up metrics that tracked ratio of jQuery calls used per overall line of code and monitored that graph over time to make sure that it’s either staying constant or going down, not up. Would love to know how this was done.

Couldn't you just count the number of $ to get a decent idea?
Post reply on HN