Skip to content

Commit

Permalink
Release 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Feb 17, 2018
2 parents 614c512 + f9a016b commit 4e44ac5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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

## [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.
- Fix bug where `@observe` could not be used with `Polymer.mixinBehaviors`.
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.1.0",
"version": "1.1.1",
"authors": [
"The Polymer Project Authors"
],
Expand Down
7 changes: 1 addition & 6 deletions package-lock.json

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

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polymer/decorators",
"version": "1.1.0",
"version": "1.1.1",
"description": "TypeScript decorators for Polymer 2.0",
"main": "lib/decorators.js",
"types": "lib/decorators.d.ts",
Expand All @@ -23,9 +23,7 @@
"url": "https://github.com/Polymer/polymer-decorators/issues"
},
"homepage": "https://github.com/Polymer/polymer-decorators#readme",
"dependencies": {
"reflect-metadata": "^0.1.10"
},
"dependencies": {},
"devDependencies": {
"@polymer/gen-typescript-declarations": "^1.1.3",
"clang-format": "^1.0.55",
Expand Down
8 changes: 4 additions & 4 deletions polymer-decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ this.Polymer.decorators = (function (exports) {
* Google as part of the polymer project is also subject to an additional IP
* rights grant found at http://polymer.github.io/PATENTS.txt
*/
/// <reference types="reflect-metadata" />
/**
* A TypeScript class decorator factory that defines a custom element with name
* `tagname` and the decorated class. If `tagname` is not provided, the static
Expand All @@ -37,9 +36,10 @@ function createProperty(proto, name, options) {
}
const finalOpts = Object.assign({}, proto.constructor.properties[name], options);
if (!finalOpts.type) {
if (window.Reflect && Reflect.hasMetadata && Reflect.getMetadata &&
Reflect.hasMetadata('design:type', proto, name)) {
finalOpts.type = Reflect.getMetadata('design:type', proto, name);
const reflect = window.Reflect;
if (reflect.hasMetadata && reflect.getMetadata &&
reflect.hasMetadata('design:type', proto, name)) {
finalOpts.type = reflect.getMetadata('design:type', proto, name);
}
else {
console.error(`A type could not be found for ${name}. ` +
Expand Down
9 changes: 4 additions & 5 deletions src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
* rights grant found at http://polymer.github.io/PATENTS.txt
*/

/// <reference types="reflect-metadata" />

/**
* A TypeScript class decorator factory that defines a custom element with name
* `tagname` and the decorated class. If `tagname` is not provided, the static
Expand Down Expand Up @@ -58,9 +56,10 @@ function createProperty(
};

if (!finalOpts.type) {
if ((window as any).Reflect && Reflect.hasMetadata && Reflect.getMetadata &&
Reflect.hasMetadata('design:type', proto, name)) {
finalOpts.type = Reflect.getMetadata('design:type', proto, name);
const reflect = (window as any).Reflect;
if (reflect.hasMetadata && reflect.getMetadata &&
reflect.hasMetadata('design:type', proto, name)) {
finalOpts.type = reflect.getMetadata('design:type', proto, name);
} else {
console.error(
`A type could not be found for ${name}. ` +
Expand Down

0 comments on commit 4e44ac5

Please sign in to comment.