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

polymer: dart2js transformers should not run in "pub serve" with Dartium #400

Closed
DartBot opened this issue Jun 5, 2015 · 19 comments
Closed

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

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


I think this is the issue Alan was seeing...

Polymer is supposed to work out-of-the-box in Dartium w/o transforms. All of our transforms are deploy time optimizations or just part of making HTML+dart2js work:

  • inline HTML imports
  • smoke -- polyfill reflection on dart2js
  • optimized @­observable objects
  • extract inline <script> into dart files
  • collect all <script>s for dart2js
  • ... possibly a few other things I'm forgetting ...
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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


Added Pkg-PolymerBuild label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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


Added Area-Pkg label.

@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


This is exactly what Bob and I were discussing this morning.

It's tricky because pub-serve is used both for serving for dartium and for serving for Chrome/FF so people can also iterate there. For the former we want no transformations to be run, for the latter we want all transformations to run. We also want that the entrypoint file that the user loads (index.html) to be the same in both cases.

We can work on making our transformers lazy, but we need from pub a mechanism so we can choose not to run transformers given a particular user agent.


cc @nex3.

@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


Marked this as being blocked by dart-archive/barback#50.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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


ah right. seems Dartium vs non-Dartium is the crucial distinction.


Changed the title to: "polymer: dart2js transformers should not run in "pub serve" with Dartium".

@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


After discussing this more throughout the day. Seems that the best solution we have so far is to have 2 entrypoints for polymer apps when running in pub-serve. Say you have an app with 'web/index.html' as the entrypoint.

What we'll do is the following:

  • web/index.html has a small transformer that injects a small .js script tag upfront
  • if the script detects that Dart is available, there is nothing else to do, we let the rest of the page load as usual
  • otherwise, we use a redirect to change the browser to point at web/index-js.html
  • index-js.html is the result of a lazy transformer that does everything we need.

I'm marking now this blocked on issue dart-archive/code_transformers#17, since that's how we will be able to implement the lazy transformer. In particular, we need to be able to rewrite smoke's mirror import lazily, and since that modifies code in another package, it would need to be handled as a global transformation. We can possibly also run the observe transformers lazily, so we could avoid all work in Dartium.


Marked this as being blocked by dart-archive/code_transformers#17.
Unmarked this as being blocked by dart-archive/barback#50.

@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


Marked this as blocking #401.

@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


Added this to the 1.6 milestone.

@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


Added Priotiy-Medium label.

@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


Removed Priority-Unassigned, Priotiy-Medium labels.
Added Priority-Medium label.

@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


Removed Priority-Medium label.
Added Priority-High label.

@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


Removed this from the 1.6 milestone.
Added Polymer-P-1 label.

@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


Removed Polymer-P-1 label.
Added Polymer-Milestone-Next label.

@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


Added PolymerMilestone-Next label.

@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


Removed Polymer-Milestone-Next label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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


Added this to the 1.6 milestone.

@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


Removed this from the 1.6 milestone.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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


Assigning owner as Priority is High. If this is done in error, please reassign or bump priority down. Thanks!


Set owner to @sigmundch.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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


Unmarked this as blocking #401.

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

No branches or pull requests

3 participants