Git Product home page Git Product logo

todo_ddc's Introduction

Sample mini todo APP for Polymer2-Dart-DDC Project

This is a very sample dart polymer-2 (polymerized) project to demostrate how to use polymerize to build polymer-2 apps using Dart..

How to build

  1. update deps with pub get
  2. run pub build

How to run the project

  1. do a pub serve
  2. Open a browser on http://localhost:8080

todo_ddc's People

Contributors

andrey-zakharov avatar dam0vm3nt avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

todo_ddc's Issues

todo_ddc doesnt run.

Hi, Vittorio!

I have updated polimerize_elements in a hope of fixing some errors in console while running todo_ddc,
but with latest generated files (
I've still got:

Uncaught TypeError: Cannot read property 'addEventListener' of null
    at HTMLElement.attached (paper-input-container.html:509)
    at HTMLElement.attached (class.html:210)
    at HTMLElement.connectedCallback (legacy-element-mixin.html:72)
    at HTMLElement._attachDom (element-mixin.html:653)
    at HTMLElement._readyClients (element-mixin.html:630)
    at HTMLElement._flushClients (property-effects.html:1576)
    at HTMLElement._propertiesChanged (property-effects.html:1731)
    at HTMLElement._flushProperties (property-accessors.html:443)
    at HTMLElement._flushProperties (property-effects.html:1629)
    at HTMLElement.ready (property-effects.html:1663)`
attached @ paper-input-container.html:509
attached @ class.html:210
connectedCallback @ legacy-element-mixin.html:72
_attachDom @ element-mixin.html:653
_readyClients @ element-mixin.html:630
_flushClients @ property-effects.html:1576
_propertiesChanged @ property-effects.html:1731
_flushProperties @ property-accessors.html:443
_flushProperties @ property-effects.html:1629
ready @ property-effects.html:1663
ready @ legacy-element-mixin.html:135
ready @ class.html:201
ready @ class.html:201
ready @ class.html:201
ready @ class.html:201
ready @ class.html:201
_flushProperties @ property-effects.html:1627
connectedCallback @ element-mixin.html:607
connectedCallback @ legacy-element-mixin.html:70
_attachDom @ element-mixin.html:653
_readyClients @ element-mixin.html:630
_flushClients @ property-effects.html:1576
_propertiesChanged @ property-effects.html:1731
_flushProperties @ property-accessors.html:443
_flushProperties @ property-effects.html:1629
ready @ property-effects.html:1663
ready @ legacy-element-mixin.html:135
ready @ class.html:201
_flushProperties @ property-effects.html:1627
connectedCallback @ element-mixin.html:607
connectedCallback @ legacy-element-mixin.html:70
connectedCallback @ polymer-redux.js:121
polymerize @ polymerize.js:130
(anonymous) @ todo_main.mod.html:43
scope.require @ imd.html:6
(anonymous) @ todo_main.mod.html:42

looks like input missing in paper decorator or something else.

I've took sources from this but hack it to use
https://github.com/andrey-zakharov/polymerize_elements

which contains latest generated files for polyner 2.0.0.rc6.

Could you please, point me to direction where to dig in.
Thanx.

Invalid argument(s): Could not find an option named "package-default-analysis-options".

Well, this is freaking weird:

ryan@DevPC-LX ~/stuff/todo_ddc master $ bazel build default
..............
INFO: Found 1 target...
ERROR: /home/ryan/.cache/bazel/_bazel_ryan/3964bd745b00ca954e33bbf6c14e12de/external/logging/BUILD:8:1: Polymerizing ../logging/logging.js failed: polymerize failed: error executing command bazel-out/host/bin/external/polymerize_tool/polymerize -o /tmp/out bazel -s external/logging/lib/logging.dart -T bazel-out/local-fastbuild/bin/external/logging/logging_template.map -M ... (remaining 15 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 255.
Unhandled exception:
Invalid argument(s): Could not find an option named "package-default-analysis-options".
#0      ArgResults.[] (package:args/src/arg_results.dart:60)
#1      createContextBuilderOptions (package:analyzer/src/command_line/arguments.dart:99)
#2      AnalyzerOptions.AnalyzerOptions.fromArguments (package:dev_compiler/src/analyzer/context.dart:72)
#3      _buildOne (package:polymerize/polymerize.dart:227)
<asynchronous suspension>
#4      runInBazelMode (package:polymerize/polymerize.dart:1193)
<asynchronous suspension>
#5      main (package:polymerize/polymerize.dart:1127)
<asynchronous suspension>
#6      main (http://localhost:37146/polymerize.dart:3)
#7      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:263)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
Target //:default failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /media/ryan/stuff/todo_ddc/BUILD:5:1 Polymerizing ../logging/logging.js failed: polymerize failed: error executing command bazel-out/host/bin/external/polymerize_tool/polymerize -o /tmp/out bazel -s external/logging/lib/logging.dart -T bazel-out/local-fastbuild/bin/external/logging/logging_template.map -M ... (remaining 15 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 255.
INFO: Elapsed time: 69.072s, Critical Path: 0.90s
ryan@DevPC-LX ~/stuff/todo_ddc master $ 

Building on Windows

I tried building this on Windows 10 Pro x64, but got the following error

λ pub run polymerize:polymerize build
2017.32.08 21:32:48.893 polymerize      [INFO]: Updating build files ... (rules=v0.12.5, dart=C:\tools\dart-sdk\bin)
2017.32.08 21:32:49.155 polymerize      [SEVERE]:       ERROR: Unsupported operation: PackageInfo.loadConfig doesn't support URI scheme "c:".
 AT: package:package_resolver/src/utils.dart 37                   loadConfigMap
package:package_resolver/src/sync_package_resolver.dart 107  SyncPackageResolver.loadConfig
package:package_resolver/src/package_resolver.dart 100       PackageResolver.loadConfig
package:polymerize/src/dep_analyzer.dart 120                 InternalContext._init
package:polymerize/src/dep_analyzer.dart 86                  InternalContext.create.<fn>
dart:collection                                              _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent
package:polymerize/src/dep_analyzer.dart 84                  InternalContext.create
package:polymerize/src/dep_analyzer.dart 257                 WorkspaceBuilder.build
package:polymerize/src/dep_analyzer.dart 242                 WorkspaceBuilder.create
package:polymerize/src/build_command.dart 29                 build
package:polymerize/polymerize.dart 176                       processRequestArgs
package:polymerize/polymerize.dart 135                       _main
package:polymerize/polymerize.dart 43                        main.<fn>
package:stack_trace                                          Chain.capture
package:polymerize/polymerize.dart 42                        main
http://localhost:60351/polymerize.dart 3                     main
===== asynchronous gap ===========================
dart:async                                                   _Completer.completeError
package:package_resolver/src/utils.dart 42                   loadConfigMap
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:package_resolver/src/utils.dart 20                   loadConfigMap
package:package_resolver/src/sync_package_resolver.dart 107  SyncPackageResolver.loadConfig
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:package_resolver/src/sync_package_resolver.dart 104  SyncPackageResolver.loadConfig
package:package_resolver/src/package_resolver.dart 100       PackageResolver.loadConfig
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:package_resolver/src/package_resolver.dart 99        PackageResolver.loadConfig
package:polymerize/src/dep_analyzer.dart 120                 InternalContext._init
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 109                 InternalContext._init
package:polymerize/src/dep_analyzer.dart 86                  InternalContext.create.<fn>
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 84                  InternalContext.create.<fn>
dart:collection                                              _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent
package:polymerize/src/dep_analyzer.dart 84                  InternalContext.create
package:polymerize/src/dep_analyzer.dart 257                 WorkspaceBuilder.build
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 251                 WorkspaceBuilder.build
package:polymerize/src/dep_analyzer.dart 242                 WorkspaceBuilder.create
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 237                 WorkspaceBuilder.create
package:polymerize/src/build_command.dart 29                 build
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/build_command.dart 10                 build
package:polymerize/polymerize.dart 176                       processRequestArgs
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/polymerize.dart 166                       processRequestArgs
package:polymerize/polymerize.dart 135                       _main
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/polymerize.dart 53                        _main
package:polymerize/polymerize.dart 43                        main.<fn>
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/polymerize.dart 42                        main.<fn>
package:stack_trace                                          Chain.capture
package:polymerize/polymerize.dart 42                        main

Unsupported operation: PackageInfo.loadConfig doesn't support URI scheme "c:".
Unsupported operation: PackageInfo.loadConfig doesn't support URI scheme "c:".

My environment is the following:

  • Windows 10 Pro x64 (v1703)
  • installed dart-sdk v1.23.0 and bazel 0.5.1 through chocolatey

Can't build project on Mac

Can't build project, I get next error:

kelegorms-MacBook-Air:todo_ddc kelegorm$ pub run polymerize:polymerize build
2017.05.08 16:05:27.207 polymerize      [INFO]: Updating build files ... (rules=v0.12.5, dart=/usr/local/Cellar/dart/1.23.0/libexec/bin)
2017.05.08 16:05:39.367 polymerize      [INFO]: Running bazel ...
........................................................................
____Loading package: 
ERROR: while parsing ':all': error loading package '': Encountered error while reading extension file 'BUILD.todo_ddc.bzl': no such package '@build_files//': No WORKSPACE file found in /private/var/tmp/_bazel_kelegorm/2170e5122cfe820df5b8e16ad977b970/external/build_files.

What I have missed?

Is there a way to writer unit tests for polymerized apps?

Hey there,

I am currently evaluating your work and it is sure the best way to create a dart+polymer2 app.

But, I have tried to write some unit test for the example with no luck. Is there any hint to write some test against the components/modules?

Tank you very much.

Polymer version conflict

I get this error when I build the project

INFO: Found 1 target...
INFO: From Download JS dependencies with bower.json:
Running bower with bazel-out/local-fastbuild/bin/bower.json
Downloading JS components
Bower install finished :  , bower                        ECONFLICT Unable to find suitable version for webcomponentsjs

ERROR: /Users/egrimes/Documents/Development/third_party/polymer_dart/todo_ddc/BUILD:26:1: output 'bower_components' was not created.
ERROR: /Users/egrimes/Documents/Development/third_party/polymer_dart/todo_ddc/BUILD:26:1: not all outputs were created or valid.

Running bower install from inside bazel-out/local-fastbuild/bin

Please note that,
    polymer-redux#0dc3f6154f depends on polymer#2.0-preview which resolved to polymer#d46694e5d5
    app-layout#dcdef13998, app-route#80d7e272aa, iron-a11y-announcer#a901dfea66, iron-a11y-keys-behavior#6559b9800e, iron-autogrow-textarea#f4c6b40172, iron-behaviors#a27904b516, iron-checked-element-behavior#6257d75137, iron-fit-behavior#7accb98360, iron-flex-layout#ec9a1f91d9, iron-form-element-behavior#e5975d6a19, iron-icon#55fe529584, iron-icons#bfd36eb23e, iron-iconset-svg#1ba09ae80e, iron-image#0d79e38f19, iron-input#9d06d7d7db, iron-list#d707d2100b, iron-location#8afe46bfe1, iron-media-query#6dc49cdc2b, iron-meta#1421651c70, iron-overlay-behavior#b01cc2f5d7, iron-range-behavior#8f9446d38a, iron-resizable-behavior#4c10452634, iron-scroll-target-behavior#301eea2725, iron-selector#e7107b383f, iron-validatable-behavior#325063248a, neon-animation#339624d382, paper-behaviors#f08f03835f, paper-button#5339eebf82, paper-card#2961fb5efb, paper-checkbox#eca71dedaa, paper-dialog#dd145aae58, paper-dialog-behavior#3234c4b2d2, paper-icon-button#ffb9c64bcf, paper-input#1901d421e2, paper-material#ea55d542bc, paper-progress#4288414477, paper-radio-button#685aaf4d2c, paper-ripple#f82228704f, paper-spinner#fc94bdeca3, paper-styles#86e6abcc81, paper-toast#fc5f1e40bc depends on polymer#^2.0.0-rc.1 which resolved to polymer#2.0.0-rc.1
    _polymerize_generated_bower_file_ depends on polymer#2.0.0-rc.1 which resolved to polymer#2.0.0-rc.1
Resort to using polymer#2.0-preview which resolved to polymer#d46694e5d5
Code incompatibilities may occur.

Unable to find a suitable version for webcomponentsjs, please choose one by typing one of the numbers below:
    1) webcomponentsjs#v1.0.0-rc.4 which resolved to 1.0.0-rc.4 and is required by polymer#2.0.0-rc.1
    2) webcomponentsjs#v1.0.0-rc.5 which resolved to 1.0.0-rc.5 and is required by polymer#2.0.0-rc.2, polymer#d46694e5d5

It looks like polymer-redux has it's own reference to polymer. If that's the case, should polymer-redux maybe be moved to it's own package outside of polymer-element so that polymer-element is not tied to polymer-redux's version?

Simple example

Need more simple example for show how to use polymerize.
I have some structure of files: https://gist.github.com/Rasarts/978a83559413291b02a759a9ce797797

When I run pub serve, I get:

Loading source assets... 
Serving polymer_dcc web on http://localhost:8080
Build completed successfully
[web] GET  → (cached) polymer_dcc|web/index.html
[web] GET require.js → Could not find asset polymer_dcc|web/require.js.
[web] GET polymer_element/src/webcomponentsjs/webcomponents-lite.js → Could not find asset polymer_dcc|web/polymer_element/src/webcomponentsjs/webcomponents-lite.js.
[web] GET polymer_element/src/polymer/polymer.html → Could not find asset polymer_dcc|web/polymer_element/src/polymer/polymer.html.
[web] GET polymer_dcc/my_other_tag.html → Could not find asset polymer_dcc|web/polymer_dcc/my_other_tag.html.

my_other_tag.html ?

In browser I get nothing, but in browser console:

localhost/:3 GET http://localhost:8080/require.js 
localhost/:4 GET http://localhost:8080/polymer_element/src/webcomponentsjs/webcomponents-lite.js 
localhost/:5 GET http://localhost:8080/polymer_element/src/polymer/polymer.html 404 (Not Found)
localhost/:6 GET http://localhost:8080/polymer_dcc/my_other_tag.html 404 (Not Found)

How I can make this work with polymerize?

Dart VM version: 1.24.2 (Thu Jun 22 08:43:26 2017) on "linux_x64"
Google Chrome: Version 59.0.3071.115 (Official Build) (64-bit)

upgrade to latest ddc (sdk v. 1.23.0)

Latest ddc (v.1.23.0 sdk) changed the way they translate properties. They now declare a different symbol for each prop and use that to store and retrieve the actual value inside the object, than declaring property getters and setter for it.

Polymer2.x seams to have problems with that because it want's to declare its own property getters and setters in order to implement property effects. There's a wa for this that needs to be injected in polymer-dart components in order to make it work again.

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.