title: How Can I Lasily/Dynamicaly Load Classes in Dart?
body: <p>I was considering using Dart for a Framework I was going to write.  One of the issues I found was that I could not lazy-load my classes or perform some alternative method of loading more code.  I wish to dynamically load more code when the user browses to different areas of the site without reloading the page ((ab)using the history API), but from what I could tell I would have to load all of the code upfront.  This just wouldn't work because it would give terrible first-load times and every time I change <strong>any</strong> code the users would have to re-download all of the code for the website.</p>
  
  <p>An example of a program that does this in javascript is <a href="http://alexgorbatchev.com/SyntaxHighlighter/" rel="nofollow">SyntaxHighlighter</a>.  There is an option to load brushes only when they are needed.</p>
  
  <p>In dart, you could load an isolate and pass some serialized version back in forth to accomplish syntax highlighting, but for my app I need event listeners and handlers and a lot of DOM and CSS manipulation, there is no way that I am going to write a custom API for doing all of this with primitive types.</p>
  
  <p>I was wondering if there was a way to accomplish this in Dart or if there is anything in the works that would allow this technique to be implemented. (or else it is back to JavaScript).</p>
  
  <p>Thanks, Kevin</p>