Note that there are some explanatory texts on larger screens.

plurals
  1. POServing uncompiled versions of assets in rails 3.1+
    text
    copied!<p>I am currently working on an integration of Dart into the Rails Asset Pipeline.</p> <p>Compilation is already working; <code>.dart</code> files are compiled into <code>.js</code> by the Asset Pipeline. However, there should also be an uncompiled <code>.dart</code> version that can be interpreted by Dartium.</p> <p>The usual way is that <code>.dart</code> files are included in the html source with a type of <code>"application/dart"</code>. Then there's <a href="https://code.google.com/p/dart/source/browse/trunk/dart/client/dart.js" rel="noreferrer">dart.js</a>, which replaces those <code>.dart</code> files with the corresponding <code>.js</code> version if the browser doesn't understand Dart, replacding <code>foo.dart</code> with <code>foo.dart.js</code>.</p> <p>My problem is, that the asset pipeline is serving the compiled JavaScript version, even if the client requests <code>foo.dart</code>. <code>foo.dart</code> should serve the original, uncompiled version, only <code>foo.dart.js</code> should be compiled.</p> <p>Source for <a href="https://github.com/amiuhle/ruby-dart" rel="noreferrer">ruby-dart</a> and <a href="https://github.com/amiuhle/dart-rails" rel="noreferrer">dart-rails</a></p> <p><strong>Edit</strong>: I thought about just copying the raw <code>.dart</code> files to the public folder, but that's not an option, since the source file that is seen by the Asset Pipeline might include other <code>.dart</code> files, which are then compiled into one single <code>.js</code> file. So, not all <code>.dart</code> files would be copied.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload