Giter Site home page Giter Site logo

dart2ts's Introduction

Polymer.dart

Polymer.dart is a set of comprehensive UI and utility components for building web applications. With Polymer.dart's custom elements, templating, data binding, and other features, you can quickly build structured, encapsulated, client-side web apps.

Polymer.dart is a Dart port of Polymer created and maintained by the Dart team. The Dart team is collaborating with the Polymer team to ensure that polymer.dart elements and polyfills are fully compatible with Polymer.

Polymer.dart replaces Web UI, which has been deprecated.

Learn More

  • The Polymer.dart homepage contains a list of features, project status, installation instructions, tips for upgrading from Web UI, and links to other documentation.

  • See our TodoMVC example on github.

  • For more information about Dart, see http://www.dartlang.org/.

Try It Now

Add the polymer.dart package to your pubspec.yaml file:

dependencies:
  polymer: ^1.0.0

Instead of using any, we recommend using version ranges to avoid getting your project broken on each release. Using a version range lets you upgrade your package at your own pace. You can find the latest version number at https://pub.dartlang.org/packages/polymer.

Note: While in release_candidate stage, we recommend that you pin to a specific version:

dependencies:
  polymer: 1.0.0-rc.1

Building and Deploying

To build a deployable version of your app, add the polymer transformer to your pubspec.yaml file:

transformers:
- polymer:
    entry_points:
    - web/index.html

Then, run pub build.

Testing

Polymer elements can be tested using either the original unittest or new test packages. Just make sure to wait for initPolymer() to complete before running your tests:

@TestOn('browser')
import 'package:polymer/polymer.dart';
import 'package:test/test.dart';

void main() async {
  await initPolymer();
  // Define your tests/groups here.
}

You will also need to define a custom html file for your test (see the README for the test package for more information on this).

Note: If you are using the new test package, it is important that you add the test transformer after the polymer transformer, so it should look roughly like this:

transformer:
- polymer:
    entry_points:
    - test/my_test.html
- test/pub_serve:
    $include: test/**_test{.*,}.dart

Contacting Us

Please file issues in our Issue Tracker or contact us on the Dart Web UI mailing list.

dart2ts's People

Contributors

ajsergeev avatar dam0vm3nt 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dart2ts's Issues

Context.translate shoud return void

Context.translate should not return a value but alter the parent Context or build a value to be retrieved from a getter method.

For example ClassDeclarationContext should add declaration to the LibraryContext or directly to its TSLibrary

Could not find a file named "pubspec.yaml" in

When I run pub global activate -s git https://github.com/polymer-dart/dart2ts.git I get :
Could not find a file named "pubspec.yaml" in "/tmp/pub_QQNVID"

What can the issue be?

pub --version // Pub 2.3.1
dart --version // Dart VM version: 2.3.1 (Unknown timestamp) on "linux_x64"

Unable to resolve asset ID for "dart:ui"

Greetings to all,

I have this issue when trying to build with Dart2TsBuilder , this shows:

[2019-12-10 15:26:38.366725] SEVERE Instance of 'Dart2TsBuilder' on ******|lib/main.dart, Unable to resolve asset ID for "dart:ui"
[2019-12-10 15:26:44.277183] SEVERE Instance of 'Dart2TsBuilder' on ******|lib/main.dart,
ERROR:
Stack Overflow
STACKTRACE:

[2019-12-10 15:26:44.308186] SEVERE Build, Failed after 10503ms
ERROR:
Stack Overflow
STACKTRACE:
package:analyzer/src/context/cache.dart 127           AnalysisCache.get
package:analyzer/src/context/cache.dart 811           CacheEntry._setErrorState.<fn>
dart:collection                                       _HashFieldBase&_HashBase&_OperatorEqualsAndHashCode&SetMixin.forEach
package:analyzer/src/context/cache.dart 808           CacheEntry._setErrorState
package:analyzer/src/context/cache.dart 813           CacheEntry._setErrorState.<fn>
dart:collection                                       _HashFieldBase&_HashBase&_OperatorEqualsAndHashCode&SetMixin.forEach
package:analyzer/src/context/cache.dart 808           CacheEntry._setErrorState
package:analyzer/src/context/cache.dart 813           CacheEntry._setErrorState.<fn>
dart:collection                                       _HashFieldBase&_HashBase&_OperatorEqualsAndHashCode&SetMixin.forEach
package:analyzer/src/context/cache.dart 808           CacheEntry._setErrorState
package:analyzer/src/context/cache.dart 813           CacheEntry._setErrorState.<fn>
.                                                     ...
.                                                     ...
dart:async                                            _Future.then
package:code_transformers/src/resolver_impl.dart 154  ResolverImpl._performResolve
package:code_transformers/src/resolver_impl.dart 90   ResolverImpl.resolve.<fn>
dart:async                                            _Future.whenComplete
package:code_transformers/src/resolver_impl.dart 88   ResolverImpl.resolve
package:code_transformers/src/resolvers.dart 63       Resolvers.get
package:build                                         BuildStepImpl.resolver
package:dart2ts/src/code_generator.dart 118           _BaseBuilder.build
dart:async                                            new Future.microtask
package:dart2ts/src/code_generator.dart 117           `_BaseBuilder.build

Also I refactored analyzer package code but still not working , any ideas?

Regards

Debug output

Would love to see a debug output option for dart2ds execution.

Currently trying to convert a project to TS and getting

NoSuchMethodError: The method 'writeCode' was called on null.

Unfortunately the stack trace doesn't help a novice like myself. Would be nice to know which file it was attempted to translate

I have to fix some things before I was able to compile and run the test sample

Hi, basically:

  1. I have to get rid of Function in dart code, replace it by typedef (I'm using dart SDK 1.22 )
  2. I have to add ts libs to tsconfig.json
    "experimentalDecorators" :true,
  • "lib": [
  •  "dom",
    
  •  "es2015",
    
  •  "esnext.asynciterable"
    
    ]
  1. I have to copy dart-sdk (ts) into e2e_test/lib

Very interesting project, thanks!!!

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.