Skip to content

Commit

Permalink
Merge pull request #250 from adobe/westbrook/243/tslib
Browse files Browse the repository at this point in the history
perf: use imported TypeScript helpers instead of inlining them
  • Loading branch information
Westbrook Johnson authored Oct 10, 2019
2 parents ec1d79c + 504c952 commit 1fd06fe
Show file tree
Hide file tree
Showing 36 changed files with 140 additions and 29 deletions.
7 changes: 7 additions & 0 deletions __snapshots__/Lightest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# `Lightest`

#### `loads`

```html
<slot></slot>
```
18 changes: 17 additions & 1 deletion __snapshots__/Themes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `Themes`

#### `loads`
#### `loads - light`

```html
<sp-theme-light id="theme">
Expand All @@ -9,3 +9,19 @@
</sp-scale-medium>
</sp-theme-light>
```

#### `loads - dark`

```html
<sp-theme-dark id="theme">
<sp-scale-medium id="scale">
<slot></slot>
</sp-scale-medium>
</sp-theme-dark>
```

#### `loads - unkown`

```html
<slot></slot>
```
12 changes: 2 additions & 10 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@ module.exports = (config) => {
},
coverageIstanbulReporter: {
// TODO(#212): reapply coverage based on source files.
// thresholds: {
// global: {
// statements: 94,
// branches: 82,
// functions: 96,
// lines: 94,
// },
// },
thresholds: {
global: {
statements: 93,
branches: 72,
statements: 95,
branches: 83,
functions: 96,
lines: 95,
},
Expand Down
3 changes: 2 additions & 1 deletion packages/action-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dependencies": {
"@spectrum-web-components/dropdown": "^0.1.3",
"@spectrum-web-components/menu": "^0.1.3",
"@spectrum-web-components/menu-item": "^0.1.3"
"@spectrum-web-components/menu-item": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/banner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@spectrum-web-components/tab-list": "^0.1.3",
"@spectrum-web-components/textfield": "^0.1.3",
"@spectrum-web-components/themes": "^0.1.3",
"@spectrum-web-components/tooltip": "^0.1.0"
"@spectrum-web-components/tooltip": "^0.1.0",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dependencies": {
"@spectrum-web-components/icon": "^0.1.3",
"@spectrum-web-components/icons": "^0.1.3",
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/dropdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@spectrum-web-components/menu": "^0.1.3",
"@spectrum-web-components/menu-item": "^0.1.3",
"@spectrum-web-components/popover": "^0.1.3",
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/dropzone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/iconset": "^0.1.3"
"@spectrum-web-components/iconset": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@spectrum-web-components/iconset": "^0.1.3"
"@spectrum-web-components/iconset": "^0.1.3",
"tslib": "^1.10.0"
},
"peerDependencies": {
"lit-element": "^2.1.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/iconset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/illustrated-message/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/menu-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/menu-item/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@spectrum-web-components/button": "^0.1.3",
"@spectrum-web-components/icon": "^0.1.3",
"@spectrum-web-components/icons": "^0.1.3",
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/overlay-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/overlay-trigger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/overlay-root": "^0.1.3"
"@spectrum-web-components/overlay-root": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/popover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/radio-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/radio": "^0.1.3"
"@spectrum-web-components/radio": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/radio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/sidenav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/slider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/checkbox": "^0.1.3"
"@spectrum-web-components/checkbox": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 3 additions & 0 deletions packages/tab-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/tab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/textfield/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dependencies": {
"@spectrum-web-components/icon": "^0.1.3",
"@spectrum-web-components/icons": "^0.1.3",
"@spectrum-web-components/shared": "^0.1.3"
"@spectrum-web-components/shared": "^0.1.3",
"tslib": "^1.10.0"
}
}
3 changes: 2 additions & 1 deletion packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lit-html": "^1.0.0"
},
"dependencies": {
"@spectrum-web-components/styles": "^0.1.3"
"@spectrum-web-components/styles": "^0.1.3",
"tslib": "^1.10.0"
}
}
39 changes: 38 additions & 1 deletion packages/themes/test/themes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,52 @@ import { Theme } from '../';
import { fixture, elementUpdated, html, expect } from '@open-wc/testing';

describe('Themes', () => {
it('loads - light', async () => {
const el = await fixture<Theme>(
html`
<sp-theme color="light"></sp-theme>
`
);

await elementUpdated(el);

expect(el).shadowDom.to.equalSnapshot();
});
it('loads - dark', async () => {
const el = await fixture<Theme>(
html`
<sp-theme color="dark"></sp-theme>
`
);

await elementUpdated(el);

expect(el).shadowDom.to.equalSnapshot();
});
it('loads - unkown', async () => {
const el = await fixture<Theme>(
html`
<sp-theme color="unknown" scale="unknown"></sp-theme>
`
);

await elementUpdated(el);

expect(el).shadowDom.to.equalSnapshot();
});
});

describe('Lightest', () => {
it('loads', async () => {
const el = await fixture<Theme>(
html`
<sp-Theme></sp-Theme>
<sp-theme-lightest></sp-theme-lightest>
`
);

await elementUpdated(el);

expect(el).to.not.be.undefined;
expect(el).shadowDom.to.equalSnapshot();
});
});
3 changes: 3 additions & 0 deletions packages/tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"peerDependencies": {
"lit-element": "^2.1.0",
"lit-html": "^1.0.0"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"noUnusedLocals": true,
"target": "es2017",
"skipLibCheck": true,
"importHelpers": true,
"types": [
"chai",
"sinon",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16570,7 +16570,7 @@ ts-simple-type@~0.3.5:
resolved "https://registry.yarnpkg.com/ts-simple-type/-/ts-simple-type-0.3.6.tgz#aa5a107c420c3ebe9cf5de2fe426984d0f77c665"
integrity sha512-dybO9ebUqOzldR5+SPP1uQSbxl/uiSIvjRC7dFuU45XE7H+4EoQMuxCFKoZj99qEo7pdDWSx52DEQAPZqL3SFg==

tslib@^1.8.1, tslib@^1.9.0:
tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
Expand Down

0 comments on commit 1fd06fe

Please sign in to comment.