Week 5 - 2023
The weeknote for 1/30 - 2/5.
Tech
Decorators
-
There was an issue in the decorators proposal of JavaScript. In the first version of the proposal, the decorators are appeared before
export
keyword:@decorator export class MyClass { ... }
But some people argued that
@decorator
should appear 'after' export. This makes more sense if the decorator is considered as 'adjective'. Compare the 2 sentences:export red apple
vsred export apple
. The former makes much more sense obviously.If we follow that argument, the syntax would be:
export @decorator class Apple { ... }
After many many iterations of discussions (I couldn't follow all of them though), @littledan (the champion at that time) concluded that they decided to choose export-before-decorator is the only correct word order about 4 years ago, and it was written in spec.
The spec was later drastically changed, but the part about export-decorator word order was unchanged, and then it was approved to the stage 3. So everybody should've been on the same page about it, but this week this part was suddenly changed.
Someone found that TypeScript implement this in a different way. Actually they implemented to allow decorator-before-export word order in TypeScript syntax on purpose (Some guessed it was because they wanted to keep the examples of Angular working without change). And the discussion started heating a lot.
In the discussion, it was found that TypeScript team is not open to disallowing decorator-before-export syntax. I'm not sure it was because of it, but anyway the current champion @pzuraq was very open to changing it at this point. That was a little surprising to me. That wasn't something I expected to see in TC39 champions. Anyway they accepted the request from TypeScript team and the spec is now the opposite. decorator-before-export is the only correct way to decorate the classes. I've never seen this kind of twist in the spec process in TC39 and was really surprised.
Article
-
I wrote an article about
deno_std
and published in gihyo.jp.
Event
denobata #16
- We had denobata #16. Talked misc things together with @uki00a and @magurotuna. I had to leave in the middle to meet Asher @iuioiua in Yoyogi.