Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

The Road to 1.0 #15

Open
9 of 18 tasks
jayphelps opened this issue Aug 1, 2015 · 10 comments
Open
9 of 18 tasks

The Road to 1.0 #15

jayphelps opened this issue Aug 1, 2015 · 10 comments

Comments

@jayphelps
Copy link
Owner

Spec compliancy

  • Update to support both the old and new spec (coming in Babel 6)
  • Implement backward compatibility, if possible ???

Add the remaining tests

decorators

  • autobind
  • debounce
  • deprecate
  • nonconfigurable
  • nonenumerable
  • override
  • readonly
  • suppress-warnings

(private/utils)

  • decorate
  • isDescriptor
  • metaFor

Decide if aliases will continue?

I generally do not like aliases. I'd prefer to have all decorators named as a verb and remove the aliases.

  • @​deprecate (alias: @​deprecated)
  • @​mixin (alias: @​mixins)

Slim builds

  • Support rollup via jsnext:main
  • Allow imports of each decorator to not pull in entire library for browserify/webpack users. Most likely via postinstall or similar, aliasing files into the package root so they can import autobind from 'core-decorators/autobind.
@jayphelps jayphelps added this to the v1.0.0 milestone Aug 1, 2015
@brigand brigand mentioned this issue Aug 26, 2015
@jayphelps jayphelps changed the title Add the remaining tests The Road to 1.0 Oct 2, 2015
@sebmck
Copy link

sebmck commented Oct 5, 2015

I'd recommend not doing a 1.0.0 until Babel 6 as all of your method decorators are going to break probably.

@jayphelps
Copy link
Owner Author

@sebmck I quite literally was JUST seeing you mention changes coming in Babel 6 on twitter. Where can I find the spec changes? I don't immediately notice any changes in https:/wycats/javascript-decorators

@sebmck
Copy link

sebmck commented Oct 5, 2015

@jayphelps
Copy link
Owner Author

@sebmck gracias good sir.

@yordis
Copy link

yordis commented Jan 12, 2016

👍 for remove the aliases.

@Download
Copy link

I'm not fond of aliases either. Having said that, the given example does highlight that currently in Java, @Deprecated is an official annotation provided by the language. Case sensitivity is also an issue here, but my point is that most annotations in Java use nouns i.s.o verbs... And given the declarative 'feel' of decorators, nouns do seem to make sense. @private is also a noun btw, as are @nonconfigurable, @nonenumerable, @readonly and more.

In fact, just for exercise, let me make a list of the decorators from this repo using all nouns:

For Properties and Methods
@readonly
@nonconfigurable
@decorated                     <--

For Properties
@nonenumerable
@lazy                              <--

For Methods
@autobound                   <--
@deprecated                  <-- 
@warningsSuppressed   <--
@enumerable
@overridden                   <--
@debounced                  <--
@throttled                       <--
@timed                           <--

For Classes
@autobound                   <--
@mixin                            (mixin can be both noun and verb)
@argumentsAsserted     <--
@private                         This one will be very ugly as a verb

Thinking about it more, Java mixes nouns and verbs. E.g. @Deprecated v.s. @Override.

I'd say an argument can be made here that it's kinda just a style thing whether to choose nouns or verbs. Some make no sense as verb (@makePrivate? yuck), some look much better as verb, e.g. @override. Some, it's hard to say. @deprecate feels weird, as if it's still about to happen. @deprecated makes much more sense here imho. It's something that happened to something else, in the past. Also @timed feels better to me than @time, it expresses better what it does imho. But again it's taste. So maybe aliases do make sense in these cases. What do you think?

@Download
Copy link

I realize I'm probably improperly using the term 'noun'. Sorry about that, English is not my native language. Anyway they are not verbs is what I mean :)

@dongryphon
Copy link

+1 for @deprecated over @deprecate

@kevinSuttle
Copy link

decorators have now been moved to stage 2.
babel/website#883

@jayphelps
Copy link
Owner Author

@kevinSuttle yup 😄 #84

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants