Live data from Hacker News

Figma’s Journey to TypeScript

figma.com

91–100 of 257 posts

Re: Figma’s Journey to TypeScript

#91
post #63

Earlier quoted context omitted.

It is actually a fairly indicative story. At the start there is a brilliant individual (Evan) who sets up an entire toolchain + core of the product. They then move on (or get pushed out, or get bored), and with the team (and the product) now being much bigger, things get replatformed to a more familiar, widely used stack. The success of these steps heavily depends on how robust the eng culture is at the organisation.…

It's ironic. For the past 5 years I've been writing type strict PHP. People love to shit on PHP yet I found that when I started using strict types my code quality improved, amount of lines needed to produce a result decreased, and necessary unit tests to produce the same result also decreased. Then a few months ago I decided to write a TS project from scratch. For the record I have 18 years of JavaScript experience.…

Yes, so on the only sizeable TS project I did (which was a library, to be used by other teams) I bypassed webpack entirely and went for a mixture of tsc and esbuild. But knowing to steer clear of webpack (or even - that you can!) is a barrier.

Re: Figma’s Journey to TypeScript

#92
post #63

Earlier quoted context omitted.

It is actually a fairly indicative story. At the start there is a brilliant individual (Evan) who sets up an entire toolchain + core of the product. They then move on (or get pushed out, or get bored), and with the team (and the product) now being much bigger, things get replatformed to a more familiar, widely used stack. The success of these steps heavily depends on how robust the eng culture is at the organisation.…

It's ironic. For the past 5 years I've been writing type strict PHP. People love to shit on PHP yet I found that when I started using strict types my code quality improved, amount of lines needed to produce a result decreased, and necessary unit tests to produce the same result also decreased. Then a few months ago I decided to write a TS project from scratch. For the record I have 18 years of JavaScript experience.…

Never start with Webpack. Use Vite with a template and go from there.

Re: Figma’s Journey to TypeScript

#93

Earlier quoted context omitted.

It happened in the PHP community as well, facebook being the poster child, but Yahoo also had a fair number of internal optimizations and I saw a few other companies tweak their way to get better perf/security. Then comes a point where the community catches on and has bigger momentum than the company, so it makes sense to move to the standard implementation. I'd kinda see Google's Borg -> k8s move as slightly similar…

Isn't FB/Meta still on Hack + HVVM?

They are. At this point it's a completely different language with its own stack, as far as I know that will be a core component for the forseable future.

Now they also have modern PHP and some other languages alongside with hack from what I understand.

Re: Figma’s Journey to TypeScript

#94
post #62

Earlier quoted context omitted.

As anything - "it depends"™. I did not notice "every single line of code" getting better at all. Yes, it makes things easier on a large team where people do not have time to do codebase discovery - or where people are moved to be highly interchangeable, on big codebases. Yes, static verification can help those teams and those codebases. But it also introduces a lot of extra work "just to appease the type system". It…

I manage a relatively junior developer who has been using ts ignorer statements a couple of. times. I have said to him, that everytime he feel inclined to either use ts ignorer or do type coercion, he should call me first. every single time it is a reasoning flaw implementing a solution that is sub par and bug riddled. Had they just let types guide them, they would have become better developers and not had broken the…

The worst I had to deal with was converting anything browser-native into data structures that would satisfy the type checker (dealing with native references), and the whole "struct or class instance" dichotomy. Specifically - when there is a lot of DOM-native input (like drag&drop events and their targets and the targets of their targets) that have to be "repackaged" into a TS tree (ending up with properties which would be a JS-version of void*).

An example of what I call "ceremony" would be

  interface BlockIndex {
    [key: string]: UploaderBlock;
  }
  const perServerId = {} as BlockIndex;
  uploaderFiles.map((fe) => fe.blocks.map((b) => b.serverId && (perServerId[b.serverId] = b)));
While somewhat useful, this is in internal code which never gets used directly, and there are 4 lines of ceremony for 1 line of actual code.

Re: Figma’s Journey to TypeScript

#95
post #85

Off topic: Does anyone know of any sites made with Figma so I can see what the UX is like? As a user I don't care about DX if the resulting UX is bad.

You wouldn’t really be able to tell. Figma is often just a tool for working out designs and building up a design system for your site. That later gets translated to your front end by your devs. Figma itself isn’t a styling library like tailwind, etc.

Re: Figma’s Journey to TypeScript

#96
post #51

Earlier quoted context omitted.

That is an impressive misrepresentation of history. PHP and its community were dying by the time FB used it. People here on HN kept talking php down. In 2014 FB made their own flavour of php with a bunch of perf features, called hack. Eventually a lot of the perf features hack made its way into php. FB is still on its own flavour. Php community is still dying.

> PHP and its community were dying by the time FB used it. > Php community is still dying. https://www.tiobe.com/tiobe-index/php/ https://w3techs.com/technologies/overview/programming_langua... Yeah I dunno about that one.

Those stats are based on public information so if someone starts a private project you won't even know it. It makes sense that a mature ecosystem would have fewer open source new projects.

Re: Figma’s Journey to TypeScript

#97
post #77
post #73

Earlier quoted context omitted.

Is that a bad thing? If you're building an MVP, do you really worry about how 2k developers are going to work on this 10 years from now? Requirements change and the code base needs to adjust with those requirements, that's gonna happen no matter what. I've met a lot of people trying to predict future requirements, deciding to overenginer today for a brighter future. I have very rarely seen anyone guess the future req…

Small projects become bigger projects much faster than that! I’m not suggesting that anybody should think too far ahead when it comes to building mvps, but if it’s a choice between a typed language and a dynamic one like JavaScript, baking a poor decision in early is going to hurt later. And later is much sooner than you think. That’s not going to negatively affect your initial velocity, if it does, the team isn’t st…

> That’s not going to negatively affect your initial velocity, if it does, the team isn’t strong enough.

This. Note also that "a poor decision" might as well be "have developers fight the type system instead of delivering UI and pivoting if users don't like it".

Re: Figma’s Journey to TypeScript

#98
post #51

Earlier quoted context omitted.

It happened in the PHP community as well, facebook being the poster child, but Yahoo also had a fair number of internal optimizations and I saw a few other companies tweak their way to get better perf/security. Then comes a point where the community catches on and has bigger momentum than the company, so it makes sense to move to the standard implementation. I'd kinda see Google's Borg -> k8s move as slightly similar…

That is an impressive misrepresentation of history. PHP and its community were dying by the time FB used it. People here on HN kept talking php down. In 2014 FB made their own flavour of php with a bunch of perf features, called hack. Eventually a lot of the perf features hack made its way into php. FB is still on its own flavour. Php community is still dying.

There was a lot of tension relative to where PHP would be going, but php7 got it out of the tunnel (in no small parts because of hack, as you mention, buy not only). Some companies diversified before that, in particular moving to nodejs for instance, but others took php from there as it got a lot of attention again, and php8 didn't disappoint either.

There's still a ton of stuck that could be fixed, and php will always be talked down in some way or another but I don't think it's in a bad position as it is now. There's pretty significant code bases newly built on php right now, even if it's not making the headlines.

Re: Figma’s Journey to TypeScript

#99
post #69
post #62

Earlier quoted context omitted.

As anything - "it depends"™. I did not notice "every single line of code" getting better at all. Yes, it makes things easier on a large team where people do not have time to do codebase discovery - or where people are moved to be highly interchangeable, on big codebases. Yes, static verification can help those teams and those codebases. But it also introduces a lot of extra work "just to appease the type system". It…

Small projects have a habit of getting bigger and small teams have a habit of growing also - usually to deal with the mess of the small project that is now bigger

There are also cases where small teams that have grown grow unproportionally to the size of the product, and while the product is set up in a fairly sane way (and there is little wrong with it!) having 20 fresh people swarm into it destroys both the architecture and the execution. And with a small team enforcing cohesion for both of these is much easier! So a small project might as well stay small, but this should be somewhat a priority.

Mythical man month in action.

Re: Figma’s Journey to TypeScript

#100
post #8

Ah yes.. Switch to Typescript and give up all your advances to get a brand new set of crutches.

I like that typescript catches when I need to do null checks so I don't end up with the most notorious runtime error seared into the brain of every JS developer "cannot read property of undefined".

Some parts are nice, like the string literal typing "this" | "that". Other things are hacky, like "branded types", gross.

But then I think of my commercial codebase which is extremely well tested, regular old JS, and wonder if is worth the hassle.

Post reply on HN