Giter Site home page Giter Site logo

dart-archive / polymer_elements Goto Github PK

View Code? Open in Web Editor NEW
24.0 28.0 17.0 16.59 MB

Home Page: https://pub.dartlang.org/packages/polymer_elements

License: BSD 3-Clause "New" or "Revised" License

Dart 11.95% HTML 31.62% JavaScript 54.99% Makefile 0.01% CSS 0.47% Shell 0.02% TypeScript 0.92% Python 0.02% Roff 0.02%

polymer_elements's Introduction

Polymer elements

This package wraps the Polymer project's included js elements, providing the following features:

  • Because the elements are bundled into a single pub package, you can add polymer_elements as a dependency in your pubspec. You don't need to install npm or bower.
  • The elements are wrapped with Dart proxy classes, making them easier to interact with from Dart apps.

You can find out more about Polymer elements here: https://elements.polymer-project.org/

Using elements

All elements live at the top level of the lib/ folder.

Import into HTML:

<link rel="import" href="packages/polymer_elements/iron_input.html">

Import into Dart:

import 'package:polymer_elements/iron_input.dart';

polymer_elements's People

Contributors

dam0vm3nt avatar davenotik avatar erikgrimes avatar jakemac53 avatar johnpryan avatar vsheyanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polymer_elements's Issues

Port all the tests!

Community involvement on this one would be great, as there are north of 170 elements/behaviors total. To that end, and also for my own sanity, I am separating this out into a bunch of sub-tasks.

The goal is to just port all existing js tests, not to write tests of our own.

  • Iron Elements (issue)
  • Gold Elements (issue)
  • Platinum Elements (issue)
    • Ran into various issues and decided to remove these from the 1.0 roadmap at least for now. See #12 for the issue to add them back.
  • Neon Elements (issue)
  • Paper Elements (issue)
  • Google Web Components (issue)
  • Molecules (issue)

paper_textarea.dart fails 'basic input attributes are bound to textarea'

  if (attrsAttr is bool) {
          expect(inputAttr, equals("$attrsAttr"));
Expected: 'true'
    Actual: ''
     Which: is different. Both strings start the same, but the given value is missing the following trailing characters: true

  package:test                    expect
  paper_textarea_test.dart 65:11  main.<async>.<fn>.<fn>

Port iron-request status code tests

Left these out on the original implementation since we would need to mock out the server to spoof status codes. Also its not particularly interesting on the dart side.

paper-checkbox failing tests

Setting aria-label attribute doesn't override actual value in component.

<paper-checkbox id="check3" aria-label="Batman">Robin</paper-checkbox>
expect(c.getAttribute('aria-label'), equals("Batman"));

is failing

Port remaining icon sets

There are some additional icon sets in the iron-icons repo.

  • av-icons
  • communication-icons
  • device-icons
  • editor-icons
  • hardware-icons
  • image-icons
  • maps-icons
  • social-icons
  • update-icons

Add helper for mocking server responses in tests

Currently the iron-request, iron-ajax, and iron-form tests are actually serving static files instead of using a mock server. This only supports GET requests, and doesn't allow us to modify response headers/etc, so some tests are being skipped.

This might be a bit complicated since all requests are actually coming from the JS side of things. Might be easiest to just provide a wrapper around a JS mocking library?

paper toggle button tests failing

1) down method is used that seems not to be switching element state
2) all tests are checking aria-checked attribute but examples on main polymer website seems to be modifiying aria-pressed attribute

xp parameter for down helper should be optional

A number of the paper-radio-button tests call the down helper to click the button without the xy parameter. Making it optional and just passing null to the js method doesn't appear to work (the button doesn't get clicked), so creating this issue for now.

automated tests in supported browsers

I noticed when working on a web component using the new elements that they don't necessarily work when run in browsers other than Dartium. Chrome and Firefox are better than Safari. Given that the end target is javascript, seems reasonable that these should be tested against other browsers in javascript form.

A reasonable start might be to setup automated tests on drone.io for webkit based browsers and Chrome, but that would leave out IE, Edge and Safari. Browserstack might be a better option. I'm not sure if there's a free for open source option available anywhere.

iron-form submit doesn't work

Submitting a form like

 <form is="iron-form" id="form" method="post"  action="http://localhost:4040/person/new">
          <paper-input name="firstName" type="text" label="First" style="display: inline-block;" autofocus></paper-input>
          <paper-button><button>Add</button></paper-button>
      </form>

handling the request on the server like so

 var jsonString = await req.transform(UTF8.decoder).join();
      print(req.headers);
      print(jsonString);

results in

user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.0 (Dart) Safari/537.36
connection: keep-alive
accept: */*
accept-language: en-US,en;q=0.8
accept-encoding: gzip, deflate
origin: http://localhost:63342
content-length: 15
host: localhost:4040
content-type: application/x-www-form-urlencoded
referer: http://localhost:63342/polymer_10_demo/web/index.html

[object Object]

Port the Google Web Components tests!

Part of #1. It may end up that some apis are hard to use via js-interop, but porting the tests should flush this out. Please note any issues here. This may also need to be split into a few subtasks.

Set up CI tests

Either through package bots or some other solution, package bots may be the easiest though.

iron-list failing tests

Some of the tests fail when running pub run test -pdartium, but interestingly not when you run them manually.

Port the platinum element tests!

Part of #1.

Relatively small number of elements, but it needs to be investigated how well these will even work via js interop. Porting the tests should be a good way to do this though :).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.