Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jmesserly opened this issue Jun 3, 2014 · 20 comments
Closed
Assignees
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@jmesserly
Copy link

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 ...
@jmesserly
Copy link
Author

Added Pkg-PolymerBuild label.

@jmesserly
Copy link
Author

Added Area-Pkg label.

@sigmundch
Copy link
Member

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.

@sigmundch
Copy link
Member

Marked this as being blocked by #19169.

@jmesserly
Copy link
Author

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".

@sigmundch
Copy link
Member

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 #18489, 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 #18489.
Unmarked this as being blocked by #19169.

@sigmundch
Copy link
Member

Marked this as blocking #19174.

@sigmundch
Copy link
Member

Added this to the 1.6 milestone.

@sigmundch
Copy link
Member

Added Priotiy-Medium label.

@sigmundch
Copy link
Member

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

@sigmundch
Copy link
Member

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

@sigmundch
Copy link
Member

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

@sigmundch
Copy link
Member

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

@sigmundch
Copy link
Member

Added PolymerMilestone-Next label.

@sigmundch
Copy link
Member

Removed Polymer-Milestone-Next label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Added this to the 1.6 milestone.

@sigmundch
Copy link
Member

Removed this from the 1.6 milestone.

@sethladd
Copy link
Contributor

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


Set owner to @sigmundch.

@nex3
Copy link
Member

nex3 commented Jul 29, 2014

Unmarked this as blocking #19174.

@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#400.

@DartBot DartBot closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

6 participants