-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stage 3 reviews #66
Comments
Are these reviews needed for there to be progress on this proposal? |
@RWOverdijk yes, see the process document |
Ah thanks. Anything I can do to help? I've been following decorators for a while now and I'd like to see it get approved. :) |
@RWOverdijk Do you have any concerns with the current state of this proposal? If so, please file issues about them. If you can read the specification text closely to identify any possible problems, that will be a big help. |
@littledan I do not, no. The proposal looks good imo. The only thing I have slight confusion about is how I would store metadata for a field (property) based on the class reference (so not per instance). Before I used to get the target (example decorator I once wrote here) and now it's a meta object to define the field, and I can't see a target being documented. Other than that, I dislike the syntax ( TL;DR; LGTM 👍 |
@RWOverdijk You can do whatever to a class in the |
Of course... You can return a finisher for a field. I mis-read this line:
Thanks. Then no, zero remarks. |
I have gone over the proposal and still have concerns with patterns around privacy and writing robust code, but do not see that as directly needing to block this proposal for stage 3 after the effort @littledan and @rbuckton have done to try and find alternatives. I will defer those requirements and find alternative ways of solving for them that are more universally applicable. Reading the spec text, I do not have any remaining issues for stage 3 and feel it can advance. |
I reviewed the grammar implications of it. It looks good, although I wonder about the pros and cons of allowing |
Filed a PR with some tweaks I found during review, otherwise LGTM from an editor's standpoint. I still have personal concerns; primarily that I think decorators should go after |
@littledan If I understood correctly, issue #106 seems to have been discussed and approved of. Where are we now in respect to promoting this proposal to Stage 3? |
@pwhissell This proposal is on the agenda for the July 2018 TC39 meeting for consideration for Stage 3. |
Thank you I think your link is broken it should probably be https://github.com/tc39/agendas/blob/master/2018/07.md |
@pwhissell Thanks, fixed. Yeah, check out the past agendas to see our awesome slide decks! |
What happened at the meeting? What is the progress on stage 3? |
Looks like this week's meeting outlines some of the concerns. However, I'd really like to read some of the more detailed conversations that lead to the "blocker" label being applied. |
@david0178418 all assigned stage 3 reviewers need to sign off before the proposal can reach stage 3; so this issue is a stage 3 blocker, and there's two boxes unchecked. I suspect that doesn't answer your overall question, but it should explain why the process requires that this github issue be a stage 3 blocker. |
That definitely makes sense. However, the last meeting had "Decorators fortowards[sic] Stage 3" proposed, but that was clearly shot down (leading to @ffMathy 's question). The slides I linked give some insight into the concerns, but it'd be more valuable to see some of the actual discussion that may have happened around this since it's such a big feature. |
At this point, the main remaining unresolved issue is the ordering of decorators and export. |
Thanks @littledan, but can you be more specific? What is it about those areas that are not optimal? |
@ffMathy Some people really want decorators before export, and others really want export before decorators. I think it'd be OK either way; I don't see a fatal flaw with either option. My impression is that it's more important to standardize decorators than to get this detail "right" one way or the other. TC39 is a consensus-based body, so the strongly opinionated parties will have to come to an agreement for decorators to move forwards. |
Hopefully https://github.com/search?utf8=✓&q="decoratorsBeforeExport%3A+true"&type=Code and https://github.com/search?utf8=✓&q="decoratorsBeforeExport%3A+false"&type=Code will give us meaningful stats about Babel's |
I would be careful about using those queries. I would bet the vast majority of current usages are either legacy or private. |
The decorators before export group is probably a silent majority. I base this off of conversations over the past year or so when discussing this proposal with other developers and everyone has expressed shock/disapproval when I reveal I'm doing my best not to influence initial instinct on placement... I have not yet seen someone write by instinct
They never inline it. They always put it on its own line. |
Is the preference completely driven by people's preference for vs
If that's the case, this would be a terrible case of bike-shedding. |
I am deeply concerned that |
I see the problem, and I do think both cases make sense. Decorators can't apply to exports, so they always apply to classes when placed above them. what's wrong with supporting both? If I had to choose, I'd say before export, simply because I've never written a decorator inline like that, especially because I sometimes use multiple. So +1 on On the other hand, semantically it's weird. You're decorating a class that's being exported, rather than exporting a decorated class. So also a +1 for adding it after If my voice mattered, and I had to choose, I'd say before export. |
@RWOverdijk you can export classes later in the file. class Foo {...}
//As named
export {
Foo
}
//or as default
export default Foo; |
Exporting at the end of the file is what I'm opting for in my code for the time being while all this is being worked out. For what it's worth, I think logical consistency should win here and the decorators should follow exports. |
@david0178418 logical consistency with what? We have two perspectives here. Some of us see the |
@jsg2021 that's the root of the disagreement for many; i believe |
Except that To me,
We also went to great lengths to differentiate return { foo, baz: bar };
// vs
export { foo, bar as baz }; The only similarity between the two is the odd corner case of ** As a side note, I do wonder how often modifying the placement of a static member will be used (especially due to [[HomeObject]] semantics), though we can't exactly restrict it. |
I think @ljharb hits at the heart of this. Modifiers like Take the following:
In this case, However, by flipping the decorator and export, the value modifying keywords are grouped together. edit: derp on the function decoration |
@rbuckton is more convincing to me. I still struggle with deviation from other languages... Java: @somthing
public class Foo {
} |
This comment has been minimized.
This comment has been minimized.
Forgive the derp on the decorators on a function. I keep trying to do that in my code even though it's clearly not valid 🙃. I think it comes from the fact that it's just syntactic sugar for a function. But I think that actually adds to why post-export makes sense. Since decorators are just functions that take in values and modify them, the |
Let's continue this conversation about decorator/export ordering in #69 . This thread is for Stage 3 reviews. |
Removed @gsathya as a reviewer at his request |
There have been some edits of the specification following the previous Stage 3 reviews, so I would appreciate a further review ahead of the upcoming January 2019 TC39 meeting, if folks have time. To summarize the changelog and motivation:
|
* Editorial: Consistently use the Oxford comma (re #66) * fixup
Some potentially controversial aspects of this proposal which need consensus for Stage 3 are highlighted at stage 3 blocker . In particular:
The use case involved in both of these issues here are essential for the proposal, and we've been designing the class fields and private methods proposals with these decorators capabilities in mind for several years, so I'd like to not reduce the power of decorators here. |
what is the current status of decorators? |
@pwhissell We've moved to a new model, but there are still several details to work out. See a description in README.md |
When they'll land on stage 3 ? |
Closing this is favor of #442, which is for the latest iteration of this proposal. |
Thanks to everyone who signed up to do a Stage 3 review of decorators for the March TC39 meeting. Filing bugs in this repository is a great way to give feedback.
If it would be useful for any of you, I'd be happy to schedule a call where we can go over the proposal as a small group and we can discuss issues that way. Just let me know.
If you have reviewed this proposal and want to sign off on it as is, please say so on this thread and I'll check the box.
Editors:
The text was updated successfully, but these errors were encountered: