-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[CS2] Update docs for classes, breaking changes #4438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@GeoffreyBooth for the classes section, I'd be inclined to leave in the following in the paragraph about
I'd also prefer it if the last paragraph was kept (the mention of static properties in particular is probably value):
It could probably use a simple example, though it didn't have one in the 1.x docs. (I'd be happy to come up with one in a separate PR.) Also, total sidebar, but we could be smarter with I've also just realised that the example for Class methods can’t be used with new (uncommon) could be a bit neater with a static method: class Namespace
@Klass = ->
new Namespace.Klass # throws a TypeError at runtime Also, I wonder if we should put a note somewhere obvious that people should submit issues with their use-cases if they've found awkward changes to work around. I'm sure that there are a good few cases (e.g. |
@connec I want to get away from talking so much about prototypes, since that's a bit confusing re the old implemention vs the new. In my mind the I also don't want to encourage people to use executable class bodies; I feel like that should be almost an undocumented feature, so that there's no obligation for us to keep support for it if it becomes unmanageable. |
Perhaps we should split the sections into "Classes", and another (or subsection) on "Prototypal inheritance" including Regarding ECBs, quite a few CS projects I've seen leverage them to some degree or another (either for class-private variables, static properties, or metaprogramming such as mixins). I don't agree that we shouldn't feel an obligation to keep support for them for as long as possible, as they're one of CS' distinguishing features. Certainly, for the alpha, they will be present and will function as before, so they should be documented as before imo. If something comes up that mandates their removal they should be given their own "breaking changes" entry, and the documentation entry removed. |
Okay, we can keep a mention of executable class bodies, but this needs to be updated:
Taking the last part first, the ES idiomatic way to call parent class functions is I tried to update it, but I don’t understand this as well as I should. Please let me know what I should change. I implemented all your other notes, though I’m leaving out the invitation for people to suggest more work for us 😄 I think executable class bodies and |
4248978
to
e3c22f7
Compare
…r classes and working with prototypes; make breaking changes examples editable whenever possible
e3c22f7
to
09852af
Compare
OK, I'll have a look and update that soon. Sidebar on "(the constructor function)" - honestly I'm not sure. It still might be, with the additional caveat that you can't call it without |
@connec I already rewrote that paragraph to make it more vague and hopefully not incorrect. Any other notes? |
Cool, that LGTM 👍 |
http://rawgit.com/GeoffreyBooth/coffeescript/classes-docs/docs/v2/index.html#classes
http://rawgit.com/GeoffreyBooth/coffeescript/classes-docs/docs/v2/index.html#breaking-changes (ported from https://github.com/jashkenas/coffeescript/wiki/%5BWIP%5D-Breaking-changes-in-CoffeeScript-2)