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

Two Darts app, One HTML #15783

Closed
DartBot opened this issue Dec 24, 2013 · 2 comments
Closed

Two Darts app, One HTML #15783

DartBot opened this issue Dec 24, 2013 · 2 comments

Comments

@DartBot
Copy link

DartBot commented Dec 24, 2013

This issue was originally filed by taylor....@gmail.com


Sorry that I Can't find the right template for this. This is more a feature request.

===

URL: http://stackoverflow.com/questions/20702858/can-i-have-have-2-polymer-elements-in-one-html

I have illustrated a bit in the above URI.

Before Dartium is embedded into ever modern browsers, we will need to compile Dart into JS so that it can be run in those browsers and share the thrill that a Dart app can provide.

I did some small tests:

  1. Create a dart to get "Quote Of The Day" from my local database. Works find in Dart. Compiled to JS. Works fine in Chrome.
  2. Repeat 1 and created a "weather information". All is good.

Now I have:

  1. two darts: qotd.dart, weather.dart
  2. two compiled JS something like: qotd.dart.js, weather.dart.js
  3. two html files
  4. other supportive files

resides in their respective directories.

Now imagine I want to show those two darts in my index.html file:

  1. linked the js (qotd.js, weather.js);
  2. inserted the <polymer-element> declaration extracted from the html files

The outcome? Does not work, or more precisely, only one element can work. Which one is working depends on the sequence of the JS loading.

I know the problem lies in the JS files. Probably due to the function names, var names got overridden, or not loaded.

Of course, there are "get around" of this: I can create another Dart app encapsulating the above two.

Disadvantages of doing that:

  1. The new Dart will be very much fixed. If I need a new feature set (say adding a stock qutoe), I need to rewrite the new Dart (besides creating a Stock Quote dart).
  2. Not everyone possesses the Dart programming knowledge.

Imagine if we can do what I intended to in my example:

Dart developers can develop thousands of Darts, thus created a repo. The end users can just grab the JS/Dart/HTML and insert them into their WEB/HTML page and create a highly customizable, rich HTML pages.

Your thoughts on this?

@kwalrath
Copy link
Contributor

kwalrath commented Jun 4, 2014

Removed Area-Documentation label.
Added Area-Site label.

@nicolasgarnier
Copy link
Contributor

This issue has been moved to Github as part of a migration. Please use the Issue on Github going forward: https://github.com/dart-lang/dartlang.org/issues


Added MovedToGithub label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants