New Decorators for JS Proposal (Again)

The proposal for decorators in JavaScript has been updated… again. This will mark, if my counting is correct, the 4th major revision of this specification. If anyone is curious about the previous 3 iterations, I have a summary about them here: A Brief History of Decorators in JavaScript.

This new iteration is “based on elements from all past proposals”. While that may sound good at first, possibly meaning taking all the best bits of the past versions and putting them together in one big happy package, I instead think what we’re seeing is more compromises being made to allow for the simplicity of earlier versions to work better with the static nature of the most recent.

For example an @enumerable decorator which would make a member visible during enumeration (and happens to be the example I use for the old iterations in the Brief History link above :stuck_out_tongue_winking_eye: ) is no longer possible.

class MyClass {

    @enumerable // can't do now
    exposed () {}

The last version of the spec was at stage 2 of the proposal process (of 4). Now its marked as up for discussion at the next TC39 meeting happening later this month (September 21st - 24th).

1 Like

I saw your fork of it in passing. What are you up to?

That was just a code typo. Turns out there was another PR open that fixed it too (though I was able to slip mine in first :yum:)

1 Like