Skip to content

Commit

Permalink
Prepare 2.0.0 release. (#64)
Browse files Browse the repository at this point in the history
* Prepare 2.0.0 release.
* Make Travis generated files error more readable.
* Bump deps.
  • Loading branch information
aomarks authored Mar 1, 2018
1 parent 1286cc6 commit 0842e69
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 211 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ addons:
before_script:
- npm run format
- npm run build
- git diff --exit-code
- >-
git diff --exit-code || (echo -e
'\n\033[31mERROR:\033[0m Generated files are stale.
Please run "npm install && npm run build" and commit the changes.'
&& false)
script:
- npm run test:setup
- cd test/integration && $(npm bin)/wct
42 changes: 34 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,35 @@

<!-- ## [Unreleased] -->

## [2.0.0] - 2018-02-28
- [BREAKING] It is now always a compilation error to pass an argument to the
`@computed` decorator factory that is not a property of the element class.
Previously this check only applied when the class was explicitly passed as a
generic parameter. Users must no longer pass the class as a generic parameter.
- [BREAKING] It is now a compilation to apply the `@customElement` decorator to
a class which does not extend `Polymer.Element`. Polymer >= 2.4 (which
provides this type) is now a Bower dependency of this package.
- [BREAKING] It is now a compilation error to apply the `@listen` decorator to a
method that is not compatible with the signature `(e: EventTarget) => void`,
or that has `private` or `protected` visibility.
- [BREAKING] It is now a compilation error to pass zero targets to the
`@computed` decorator factory.

## [1.2.0] - 2018-02-21
- An exception is now thrown if both the `tagname` parameter to `@customElement` is provided, and the static `is` class property is set (except in the case that the `is` property is not an own-property of the class). Previously the `is` property would always silently win over the `tagname` when both were set.
- An exception is now thrown if the `@listen` decorator is applied to an element that does not have the `DeclarativeEventListeners` mixin applied.
- An exception is now thrown if both the `tagname` parameter to `@customElement`
is provided, and the static `is` class property is set (except in the case
that the `is` property is not an own-property of the class). Previously the
`is` property would always silently win over the `tagname` when both were set.
- An exception is now thrown if the `@listen` decorator is applied to an element
that does not have the `DeclarativeEventListeners` mixin applied.
- Decorators now have more constrained type signatures.

## [1.1.1] - 2018-02-16
- Remove npm dependency on `reflect-metadata` package.

## [1.1.0] - 2018-02-14
- Allow `@property` to be used together with `@computed` so that its `type` can be set.
- Allow `@property` to be used together with `@computed` so that its `type` can
be set.
- Fix bug where `@observe` could not be used with `Polymer.mixinBehaviors`.

## [1.0.2] - 2018-01-26
Expand All @@ -21,14 +40,21 @@
- Fix malformed warning about missing type.

## [1.0.0] - 2018-01-10
- Generated typings for the `DeclarativeEventListeners` mixin are now available at `mixins/declarative-event-listeners.d.ts`.
- [BREAKING] The `@observe` decorator now takes its dependencies as a rest parameter instead of an array (e.g. `@observe('foo', 'bar')` instead of `@observe(['foo', 'bar'])`).
- [BREAKING] Decorators are now located at `polymer-decorators.js` instead of `global.js` (same for corresponding `.d.ts` file).
- Generated typings for the `DeclarativeEventListeners` mixin are now available
at `mixins/declarative-event-listeners.d.ts`.
- [BREAKING] The `@observe` decorator now takes its dependencies as a rest
parameter instead of an array (e.g. `@observe('foo', 'bar')` instead of
`@observe(['foo', 'bar'])`).
- [BREAKING] Decorators are now located at `polymer-decorators.js` instead of
`global.js` (same for corresponding `.d.ts` file).

## [0.1.2] - 2018-01-04
- Added `observer` and `computed` properties to the `@property` decorator options.
- Added `observer` and `computed` properties to the `@property` decorator
options.
- Added `@listen` decorator and `DeclarativeEventListeners` mixin.
- Fixed bug where use of `Polymer.mixinBehaviors` with `@property` or `@computed` would throw an exception relating to the definition of the element's "properties" property.
- Fixed bug where use of `Polymer.mixinBehaviors` with `@property` or
`@computed` would throw an exception relating to the definition of the
element's "properties" property.

## [0.1.1] - 2017-09-28
- Metadata Reflection polyfill is no longer a bower dependency.
Expand Down
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,6 @@ get fooBar() {
}
```
To set the type of a computed property when the Metadata Reflection API is not
available, apply an additional `@property` decorator. Note that the `@property`
decorator should be applied first, but since decorators are executed bottom up,
it should be written second:
```ts
@computed('foo', 'bar')
@property({type: String})
get fooBar() {
```
To define a computed property with more complex dependency expressions for
which you may want to receive change values as arguments (e.g. sub-properties,
splices, wildcards, etc.), or to set additional property options, define a
Expand Down Expand Up @@ -235,7 +224,8 @@ widgets: NodeListOf<MyWidgetElement>
### `@listen(eventName: string, target: string|EventTarget)`
Add an event listener for `eventName` on `target`. `target` can be an object
reference, or the string id of an element in the shadow root.
reference, or the string id of an element in the shadow root. The method must
match the signature `(e: Event) => void`, and must have `public` visibility.
Note that a `target` referenced by id must be defined statically in the
top-level element template (e.g. not in a `<dom-if>`), because the `$` id map
Expand All @@ -251,7 +241,7 @@ mixin, which is supplied with this package.
class MyElement extends Polymer.DeclarativeEventListeners(Polymer.Element) {
@listen('scroll', document)
protected onDocumentScroll(event: Event) {
onDocumentScroll(event: Event) {
this.scratchChalkboard();
}
}
Expand All @@ -270,7 +260,7 @@ class MyElement extends
Polymer.Element)) {
@listen('tap', 'red-button')
protected onTapRedButton(event: Event) {
onTapRedButton(event: Event) {
this.launchMissile();
}
}
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "polymer-decorators",
"homepage": "https://github.com/Polymer/polymer-decorators",
"version": "1.2.0",
"version": "2.0.0",
"authors": [
"The Polymer Project Authors"
],
Expand Down
2 changes: 1 addition & 1 deletion mixins/declarative-event-listeners.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ declare namespace Polymer {
}

interface DeclarativeEventListeners {
ready(): any;
ready(): void;
}
}
115 changes: 57 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0842e69

Please sign in to comment.