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

Convert to Polymer 3, add events type definitions #230

Merged
merged 29 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a65e221
Remove iOS 10 workarounds from tests
web-padawan Jan 19, 2021
9589af9
Remove demo and related dependencies
web-padawan Jan 19, 2021
539d87d
Convert to Polymer 3 with magi-cli
web-padawan Jan 19, 2021
135318a
Sort package.json, add module entry
web-padawan Jan 19, 2021
14f629c
Commit typings to version control
web-padawan Jan 19, 2021
9612b62
Cleanup typings, extend HTMLElement
web-padawan Jan 19, 2021
069900e
Cleanup and sort Polymer imports
web-padawan Jan 19, 2021
7c8794e
Extract logic to mixins and helpers
web-padawan Jan 19, 2021
37e62bc
Fix newlines, cleanup JSDoc
web-padawan Jan 19, 2021
2324d69
Remove IE11 specific styles
web-padawan Jan 19, 2021
92f6c06
Replace dom-module with registerStyles
web-padawan Jan 19, 2021
bbd69e7
Move helper methods to dialog overlay
web-padawan Jan 20, 2021
4bdecb9
Convert unit tests to web-test-runner
web-padawan Jan 20, 2021
c404367
Convert visual tests to hermione-esm
web-padawan Jan 20, 2021
ca6e880
Add ESLint, Prettier, Stylelint and magi
web-padawan Jan 20, 2021
c6513ef
Remove ShadyDOM check from the test
web-padawan Jan 20, 2021
b7c35ed
Add web-dev-server and start script
web-padawan Jan 20, 2021
4da15bc
Fix API docs, add prestart script
web-padawan Jan 20, 2021
96e91fb
Mark internal helpers as protected
web-padawan Jan 20, 2021
0d5e2a0
Replace Travis with GitHub actions
web-padawan Jan 20, 2021
d0aa150
Reorganize type definitions
web-padawan Jan 20, 2021
cca4b63
Update vaadin-lumo-styles version
web-padawan Jan 20, 2021
b34eb35
Bump vaadin-text-field version
web-padawan Jan 21, 2021
def4842
Update and cleanup README
web-padawan Jan 21, 2021
3163c46
Build API docs with rollup
web-padawan Jan 21, 2021
99085f1
Add type definitions for custom events
web-padawan Jan 21, 2021
49fd040
Add JSDoc annotations for custom events
web-padawan Jan 21, 2021
066b6bc
Fix HTML prettier formatting
web-padawan Jan 21, 2021
76b24de
Add test for a version getter
web-padawan Jan 21, 2021
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
16 changes: 8 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"extends": "vaadin",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": [
"html"
],
"globals": {
"Polymer": false,
"Vaadin": false
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
}
}
22 changes: 0 additions & 22 deletions .gemini.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/sauce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: sauce

on:
push:
branches:
- '**'
tags-ignore:
- '*.*'

jobs:
unit-tests:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: SauceLabs tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:sauce

visual-tests:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Visual tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:visual
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tests

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Check version
run: npm run check-version

- name: Lint JavaScript
run: npm run lint:js

- name: Lint CSS
run: npm run lint:css

- name: Lint typings
run: npm run lint:types

unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Unit tests
run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
package-lock.json
yarn.lock
coverage
dist
analysis.json
21 changes: 21 additions & 0 deletions .hermione.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
browsers: {
chrome: {
baseUrl: 'http://localhost:8080/test/visual/',
screenshotsDir: () => 'test/visual/screens/vaadin-dialog',
desiredCapabilities: {
browserName: 'chrome',
version: '85.0',
platform: 'Windows 10'
}
}
},
plugins: {
'hermione-esm': {
port: 8080
},
'hermione-sauce': {
verbose: false
}
}
};
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none",
"htmlWhitespaceSensitivity": "strict"
}
5 changes: 4 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "stylelint-config-vaadin"
"extends": [
"stylelint-config-vaadin",
"stylelint-config-prettier"
]
}
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

84 changes: 25 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-dialog)](https://www.npmjs.com/package/@vaadin/vaadin-dialog)
[![Bower version](https://badgen.net/github/release/vaadin/vaadin-dialog)](https://github.com/vaadin/vaadin-dialog/releases)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-dialog)
[![Build Status](https://travis-ci.org/vaadin/vaadin-dialog.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-dialog)
[![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-dialog/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-dialog?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-dialog)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-dialog.svg)](https://vaadin.com/directory/component/vaadinvaadin-dialog)

# <vaadin-dialog>

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


[<vaadin-dialog>](https://vaadin.com/components/vaadin-dialog) is a Web Component for customized modal dialogs, part of the [Vaadin components](https://vaadin.com/components).

<!--
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="vaadin-dialog.html">
<next-code-block></next-code-block>
</template>
</custom-element-demo>
```
-->
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-dialog)](https://www.npmjs.com/package/@vaadin/vaadin-dialog)
[![Build Status](https://travis-ci.org/vaadin/vaadin-dialog.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-dialog)
[![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 webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-dialog)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-dialog)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-dialog.svg)](https://vaadin.com/directory/component/vaadinvaadin-dialog)
[![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)

```html
<vaadin-dialog opened>
</vaadin-dialog>
<vaadin-dialog opened></vaadin-dialog>

<script>
const dialog = document.querySelector('vaadin-dialog');
Expand All @@ -44,28 +29,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-dialog`:

```sh
bower i vaadin/vaadin-dialog --save
```

Once installed, import it in your application:

```html
<link rel="import" href="bower_components/vaadin-dialog/vaadin-dialog.html">
```
### Polymer 3 and ES Modules Compatible Version

Install `vaadin-dialog`:

```sh
Expand All @@ -88,41 +51,44 @@ To use the Material theme, import the correspondent file from the `theme/materia

- The component with the Lumo theme:

`theme/lumo/vaadin-dialog.html`
`theme/lumo/vaadin-dialog.js`

- The component with the Material theme:

`theme/material/vaadin-dialog.html`
`theme/material/vaadin-dialog.js`

- Alias for `theme/lumo/vaadin-dialog.html`:
- Alias for `theme/lumo/vaadin-dialog.js`:

`vaadin-dialog.html`
`vaadin-dialog.js`


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

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

1. Make sure you have [npm](https://www.npmjs.com/) and [Bower](https://bower.io) installed.
1. Make sure you have [node.js](https://nodejs.org/) 12.x installed.

1. When in the `vaadin-dialog` directory, run `npm install` and then `bower install` to install dependencies.
1. Make sure you have [npm](https://www.npmjs.com/) installed.

1. Run `npm start`, browser will automatically open the component API documentation.
1. When in the `vaadin-dialog` directory, run `npm install` to install dependencies.

1. You can also open demo or in-browser tests by adding **demo** or **test** to the URL, for example:
1. Run `npm start`, browser will automatically open the component API documentation.

- http://127.0.0.1:3000/components/vaadin-dialog/demo
- http://127.0.0.1:3000/components/vaadin-dialog/test
1. You can also open visual tests, for example:

- http://127.0.0.1:8000/test/visual/default.html

## Running tests from the command line

1. When in the `vaadin-dialog` directory, run `polymer test`
1. When in the `vaadin-dialog` directory, run `npm test`

## Debugging tests in the browser

1. Run `npm run debug`, then choose manual mode (M) and open the link in browser.

## Following the coding style

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.
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.


## Big Thanks
Expand Down
Loading