문제

  • I have two packages with several polymer custom elements.
  • Each package imports the other
    • One package contains elements that use or derive from the elements in the other package.
    • The other package uses the elements from the imported package just in the demo pages to make them more appealing.
      There are no circular dependencies between elements.
  • In each package I have a folder 'example' that contains a demo page for each custom element.
  • I use the transformers configuration in pubspec.yaml and pub build to build the Javascript version of the demo pages.
    (Because pub build doesn't yet support the example directory for entry points I created a symbolic link web that points to examples.)
  • When I execute pub build the examples are built and several of them work fine.
    Not all though because there are limitations with transformers:

pub build with transformers doesn't support imported packages that have transformers configured in pubspec.yaml.

So my new approach was as suggested at the Dart web-ui group

  • I created a new package
  • The new package imports the two packages with the custom elements.
  • I symlinked all example files from the two custom elements packages to the web/ and web/src directory of the new package.

When I execute pub build all seems fine but when I open the demo pages and debug them I see none of the xxxChanged methods of any of the custom elements get called (except when they are called explicitly from enteredView attached or ready). Other methods like enteredView attached or ready are called though.

A diff between the files (about 14k size) showed several smaller differences but the most (about 98%) are equal. This generated code (not minified) is not easy to decipher at least not for me and I found no hint what could have caused these differences.

Any Idea what can be the source of that problem?

도움이 되었습니까?

해결책

When I add

transformers:
- polymer:
    entry_points: 

(without any entry_points) to the pubspec.yaml of the custom elements packages all works fine in JavaScript too.

EDIT

related issues

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top