Skip to content
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

refactor: convert to lit-element and TypeScript #143

Merged
merged 34 commits into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
80217f1
chore: update markdown files
web-padawan Jan 13, 2020
9072ae6
chore: update package.json, remove bower.json
web-padawan Jan 13, 2020
7398210
chore: add and update config files
web-padawan Jan 13, 2020
7a9cfb4
chore: remove demos
web-padawan Jan 13, 2020
7e31d57
chore: cleanup no longer needed test files
web-padawan Jan 13, 2020
9ddc060
test: remove firefox screenshots
web-padawan Jan 28, 2020
dcdfdec
chore: disable all the tests in travis
web-padawan Feb 3, 2020
65f7841
chore: update pre-release warning [skip ci]
web-padawan Feb 5, 2020
33200cf
chore: align ecma version in config [skip ci]
web-padawan Feb 5, 2020
7b1c0c8
refactor: convert to lit-element and TypeScript
web-padawan Feb 3, 2020
59adf56
fix: get drawer scroll height for styling
web-padawan Feb 4, 2020
5b3cfa1
fix: add overflow support to drawer
web-padawan Feb 4, 2020
772d41b
refactor: remove no longer used attribute
web-padawan Feb 4, 2020
848184b
test: add tests for overflow property
web-padawan Feb 4, 2020
497aa89
refactor: rename part to navbar-bottom
web-padawan Feb 3, 2020
1486412
fix: add drawer-opened-changed event
web-padawan Feb 4, 2020
a9f4592
fix: add overlay-changed event
web-padawan Feb 4, 2020
a035e6b
fix: add primary-section-changed event
web-padawan Feb 4, 2020
696d611
chore: bump mixins to latest versions
web-padawan Feb 6, 2020
413bbff
chore: bump dependencies, use media helpers
web-padawan Feb 6, 2020
b6ff745
refactor: convert theme and visual tests
web-padawan Feb 3, 2020
8473b08
fix: handle drawer overflow issue in Lumo
web-padawan Feb 7, 2020
69cf873
chore: bump vaadin-tabs to 4.0.0-alpha2
web-padawan Feb 7, 2020
2b0983b
fix: place drawer after navbar-bottom in markup
web-padawan Feb 13, 2020
e1f103b
refactor: replace root level exports
web-padawan Feb 4, 2020
66eb493
docs: add API docs with api-viewer
web-padawan Feb 4, 2020
07e1799
docs: add scolling areas documentation
web-padawan Feb 5, 2020
ca3a7e2
docs: remove api-viewer demo padding
web-padawan Feb 6, 2020
d324ca6
fix: make drawer fixed when overlay is true
web-padawan Feb 5, 2020
06c44ba
fix: make sure navbar does not shrink
web-padawan Feb 5, 2020
f880e44
fix: iOS navbar support and improvements
web-padawan Feb 5, 2020
7788b6c
chore: remove no longer used files
web-padawan Feb 5, 2020
3f1364c
refactor: only run navbar detection on iOS
web-padawan Feb 5, 2020
9e321bc
fix: restore drawer before appearance
web-padawan Feb 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"extends": "vaadin",
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": [
"html"
],
"globals": {
"Polymer": false,
"Vaadin": false
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"project": "./tsconfig.json"
}
}
12 changes: 3 additions & 9 deletions .gemini.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
rootUrl: http://localhost:8080/components/vaadin-app-layout/test/visual/
rootUrl: http://localhost:8080/test/visual/
gridUrl: http://localhost:4444/wd/hub
screenshotsDir: ./test/visual/screens

system:
plugins:
polyserve:
esm:
port: 8080
sauce: true

browsers:
chrome:
desiredCapabilities:
browserName: "chrome"
version: "66.0"
platform: "Windows 10"

firefox:
desiredCapabilities:
browserName: "firefox"
version: "47.0"
version: "69.0"
platform: "Windows 10"
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,22 @@ node_modules
package-lock.json
yarn.lock
coverage
analysis.json
custom-elements.json
vaadin-*.js
vaadin-*.d.ts
vaadin-*.d.ts.map
vaadin-*.js.map
/src/**/*.js
/src/**/*.js.map
/src/**/*.d.ts
/src/**/*.d.ts.map
/theme/**/*.js
/theme/**/*.js.map
/theme/**/*.d.ts
/theme/**/*.d.ts.map
/test/**/*.js
/test/**/*.js.map
/test/**/*.d.ts
/test/**/*.d.ts.map
/dist
entrypoint.hashmanifest.json
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"printWidth": 120
}
70 changes: 11 additions & 59 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,21 @@
sudo: false
dist: xenial
language: node_js
node_js: 8.11

cache:
directories:
- node_modules
node_js: lts/*

addons:
firefox: "62.0.3"
firefox: latest
chrome: stable

jobs:
include:
- if: type = push
env: TEST_SUITE=unit_tests POLYMER=2
- if: type = push
env: TEST_SUITE=visual_tests POLYMER=2
- if: type = push
env: TEST_SUITE=unit_tests POLYMER=3
- if: type = pull_request
env: POLYMER=2
addons:
firefox: "62.0.3"
chrome: stable
- if: type = pull_request
env: POLYMER=3
addons:
firefox: "62.0.3"
chrome: stable
- if: type = cron
env: TEST_SUITE=unit_tests POLYMER=2

script:
- if [[ "$POLYMER" = "2" ]]; then
npm -q i && npm i -q --no-save bower polymer-cli && bower -q i &&
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
if [[ "$TEST_SUITE" = "visual_tests" ]]; then
npm i -q --no-save gemini@^4.0.0 gemini-sauce gemini-polyserve &&
gemini test test/visual;
else
wct --env saucelabs;
fi;
else
npm run check &&
npm run lint &&
xvfb-run -s '-screen 0 1024x768x24' wct;
fi &&
if [[ "$TRAVIS_EVENT_TYPE" = "cron" && "$TEST_SUITE" = "unit_tests" ]]; then
wct --env saucelabs-cron;
fi;
fi
- if [[ "$POLYMER" = "3" ]]; then
npm --no-save -q install -g yarn bower magi-cli web-component-tester polymer-modulizer &&
rm -rf node_modules &&
magi p3-convert --out . --import-style=name &&
yarn install --flat &&
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
wct --npm --env saucelabs;
else
xvfb-run -s '-screen 0 1024x768x24' wct --npm;
fi;
fi

- if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
npm run test:sauce && npm run test:visual;
else
npm run check:version &&
npm run lint &&
npm test;
fi

after_success:
- if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
cat ${TRAVIS_BUILD_DIR}/coverage/lcov.info | coveralls;
fi
- "cat ${TRAVIS_BUILD_DIR}/coverage/lcov.info | coveralls"
91 changes: 32 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-app-layout)](https://www.npmjs.com/package/@vaadin/vaadin-app-layout)
[![Bower version](https://badgen.net/github/release/vaadin/vaadin-app-layout)](https://github.com/vaadin/vaadin-app-layout/releases)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-app-layout)
[![Build Status](https://travis-ci.org/vaadin/vaadin-app-layout.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-app-layout)
[![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-app-layout/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-app-layout?branch=master)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadin-app-layout-directory-urlidentifier.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)


# <vaadin-app-layout>

[<vaadin-app-layout>](https://vaadin.com/components/vaadin-app-layout) is a Web Component providing a quick and easy way to get a common application layout structure done, part of the [Vaadin components](https://vaadin.com/components).

[Live Demo ↗](https://vaadin.com/components/vaadin-app-layout/html-examples)
|
[API documentation ↗](https://vaadin.com/components/vaadin-app-layout/html-api)

[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-app-layout)](https://www.npmjs.com/package/@vaadin/vaadin-app-layout)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-app-layout)
[![Build Status](https://travis-ci.org/vaadin/vaadin-app-layout.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-app-layout)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/stars/vaadinvaadin-app-layout.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)

> ⚠️ This is a pre-release version built with [`LitElement`](https://github.com/Polymer/lit-element), part of the [next generation of Vaadin web components](https://vaadin.com/blog/next-generation-vaadin-components).
>
> Looking for Vaadin 14 compatible version? Please see the following branches:
> - [2.0 branch](https://github.com/vaadin/vaadin-app-layout/tree/2.0)
> - [2.1 branch](https://github.com/vaadin/vaadin-app-layout/tree/2.1)

[<vaadin-app-layout>](https://vaadin.com/components/vaadin-app-layout) is a Web Component providing a quick and easy way to get a common application layout structure done, part of the [Vaadin components](https://vaadin.com/components).

```html
<vaadin-app-layout>
Expand Down Expand Up @@ -47,30 +49,6 @@

## Installation

The Vaadin components are distributed as Bower and npm packages.
Please note that the version range is the same, as the API has not changed.
You should not mix Bower and npm versions in the same application, though.

Unlike the official Polymer Elements, the converted Polymer 3 compatible Vaadin components
are only published on npm, not pushed to GitHub repositories.

### Polymer 2 and HTML Imports compatible version

Install `vaadin-app-layout`:

```sh
bower i vaadin/vaadin-app-layout --save
```

Once installed, import it in your application:

```html
<link rel="import" href="bower_components/vaadin-app-layout/vaadin-app-layout.html">
<link rel="import" href="bower_components/vaadin-app-layout/vaadin-drawer.toggle.html">
```
### Polymer 3 and ES Modules compatible version


Install `vaadin-app-layout`:

```sh
Expand All @@ -94,54 +72,49 @@ To use the Material theme, import the correspondent file from the `theme/materia

- The components with the Lumo theme:

`theme/lumo/vaadin-app-layout.html`
`theme/lumo/vaadin-drawer-toggle.html`
`theme/lumo/vaadin-app-layout.js`
`theme/lumo/vaadin-drawer-toggle.js`

- The components with the Material theme:

`theme/material/vaadin-app-layout.html`
`theme/material/vaadin-drawer-toggle.html`

- Aliases for `theme/lumo/vaadin-app-layout.html` `theme/lumo/vaadin-drawer-toggle.html`
`theme/material/vaadin-app-layout.js`
`theme/material/vaadin-drawer-toggle.js`

`vaadin-app-layout.html`
`vaadin-drawer-toggle.html`
- Aliases for `theme/lumo/vaadin-app-layout.js` `theme/lumo/vaadin-drawer-toggle.js`

`vaadin-app-layout.js`
`vaadin-drawer-toggle.js`

## Running demos and tests in browser
## Running demos and API docs in a browser

1. Fork the `vaadin-app-layout` repository and clone it locally.

1. Make sure you have [npm](https://www.npmjs.com/) installed.

1. When in the `vaadin-app-layout` directory, run `npm install` and then `bower install` to install dependencies.
1. When in the `vaadin-app-layout` directory, run `npm install` to install dependencies.

1. Make sure you have [polymer-cli](https://www.npmjs.com/package/polymer-cli) installed globally: `npm i -g polymer-cli`.
1. Run `npm start`, browser will automatically open the component API documentation.

1. Run `polymer serve --open`, browser will automatically open the component API documentation.
## Running tests from the command line

1. You can also open demo or in-browser tests by adding **demo** or **test** to the URL, for example:
- When in the `vaadin-app-layout` directory, run `npm test`

- http://127.0.0.1:8080/components/vaadin-app-layout/demo
- http://127.0.0.1:8080/components/vaadin-app-layout/test
- To debug tests in the browser, run `npm run test:debug`


## Running tests from the command line
## Following the coding style

1. When in the `vaadin-app-layout` directory, run `polymer test`
We are using [ESLint](http://eslint.org/) for linting TypeScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.ts` files.


## Following the coding style
## Big Thanks

We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files as well as JavaScript snippets inside `.html` files.
Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs](https://saucelabs.com).


## Contributing

- Make sure your code is compliant with our code linters: `npm run lint`
- Check that tests are passing: `polymer test`
- [Submit a pull request](https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github) with detailed title and description
- Wait for response from one of Vaadin components team members
To contribute to the component, please read [the guideline](https://github.com/vaadin/vaadin-core/blob/master/CONTRIBUTING.md) first.


## License
Expand Down
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: ['@babel/preset-typescript'],
plugins: [
[
'@babel/plugin-proposal-decorators',
{
decoratorsBeforeExport: true
}
],
'@babel/plugin-proposal-class-properties'
],
};
44 changes: 0 additions & 44 deletions bower.json

This file was deleted.

8 changes: 0 additions & 8 deletions demo/.eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions demo/demo-shell.html

This file was deleted.

15 changes: 0 additions & 15 deletions demo/demos.json

This file was deleted.

Loading