Skip to content
This repository was archived by the owner on Dec 19, 2017. It is now read-only.

library package with polymer elements needs a polymer transformer configuration #431

Closed
DartBot opened this issue Jun 5, 2015 · 4 comments
Labels

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/405837?v=3" align="left" width="96" height="96"hspace="10"> Issue by zoechi
Originally opened as dart-lang/sdk#20673


A library package containing polymer elements needs a polymer transformer configuration otherwise the transformer doesn't process these elements.

see also http://stackoverflow.com/questions/25449308

Creating library packages for polymer elements is a common use case.
I don't think that a transformer config is necessary in this case is documented anywhere.

Packages like core-elements/paper-elements don't help much as model because they have the transformer config for the example pages. It's not obvious that the skeleton is necessary even when no entry pages do exist.

transformers:

  • polymer:
        entry_points:

I think there should be a warning message when polymer elements are imported from a package where this is missing.

I knew it and added it but it still didn't work.
It took me a while to discover that I had to kill pub serve to make the change take effect.

When I change the pubspec.yaml of the project pub serve is currently serving it kills itself but it doesn't when the pubspec.yaml of a path dependency is changed.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/405837?v=3" align="left" width="48" height="48"hspace="10"> Comment by zoechi


I just chatted with an enthusiastic and experienced Dart developer who was about to start hating Polymer because the elements didn't work anymore when he moved them to another package.
Any plans to solve this or at least output a hint/warning about the missing transformer config?

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch


Thanks gzoechi for creating the bug!

We should definitely look into providing a better error message for this. The main issue is that we don't yet have global transformers (see issue #422 and issue #368), which we need in order to run all the transformations or none. Currently the issue is that in the example above we end up transforming the entry package (removing dirty-checking), but we don't transform the imported package (which continues to depend on dirty-checking).

Not all the polymer transformers are needed though - for example I believe it is sufficient to include just the observable transformer:

  transformers:
  - observable

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/405837?v=3" align="left" width="48" height="48"hspace="10"> Comment by zoechi


Thanks for the update and the tip with the observable transformer.

@jakemac53
Copy link
Contributor

This is no longer necessary

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants