Problems with Dart/Polymer build output files / everything compiled/pasted into index.html - dart

I'm probably missing something very basic here, but I've spent quite a while searching for just about any term I could come up with.
I wanted to check out Dart and Dart.Polymer, so I grabbed some examples from various tutorials. I managed to get everything working, but it seems ALL HTML/JS/CSS content from custom Polymer elements and paper-/iron-/... elements get pasted to index.html, along with various other JavaScript stuff.
This leads to my index.html being 16.000+ lines long in release mode builds, (20.000 in debug) in this Dart Academy Tutorial, and here is the corresponding source in GitHub
The tutorial also links to a live version that has pretty HTML/imports.
The same happens with the basic Polymer sample project in Webstorm.
My different setups:
Windows 10 and Ubuntu 14.04 (tried both)
Dart SDK current stable and dev version
pub build --mode:release and debug, from commandline and within Webstorm
various transformers, various orders, various dependency versions in pubspec.yaml
Aside from the index.html file my output folder seems fine, elements are present in e.g. output_folder/build/web/packages/polymer_elements/.
I know that everything that is compiled into the index is necessary, but why does it not generate links to the files in the created build/polymer_elements folder? I assume it is possible and the live versions of the examples I found have not been edited manually to link to all elements and scripts and cut them from index.html. I know it probably does not even affect load times in a significant way, but it still bugs me.
Thanks for any help in advance, don't be shy to point out if I read over something very basic or just did not search for the right term :D

This is a deployment optimization, similar to the vulcanize tool for polymer js, except that its the default in Dart. Html imports create tons of extra requests which is slower than just downloading the one large file.

Inlining transformed code (JS/CSS) is normal behavior and none of the options to dart2js will affect this.
I believe the demo output linked in the tutorial you mentioned was unfortunately not the actual dart output. I believe https://polymer-checkout.firebaseapp.com/ is a demo of the original polymer version, not the dart version.

Related

Unable to drag files after installing communication with python script

I built an electron app that allowed dragging files in, with a jQuery script that just takes some info from that (path) and adds an li to a list. That's it. It worked great.
Then I followed this guide, because the next step is to send that information to a python script that analyzes the files (maybe relevant: when installing zeroRPC I built from sources, didn't rely on the prebuilt fork that's available there).
Now I get this crazy bug where when I drag files into the app my mouse pointer changes to not-allowed and the drop event doesn't fire. It's so weird.
I don't have any code sample to give because I can't really tell which part is wrong. The only changes I've done are the ones in the guide I linked, and they have nothing to do with the front-end. I'm really confused by this. not-allowed? Why?
Well, as suspected, the issue had nothing to do with either the front end or the back end. None of my code, really. It turned out that since I needed to compile some stuff while preparing zeroRPC, I used powershell as an administrator,, and you can't drag files from user-run explorer into an admin-run electron app - which makes sense and is in fact an expected behavior (it just so happened that I encountered this after doing some work, causing me to think the problem was with something I changed in my code).

Can I have two apps in one webpage in Dart + polymer?

I have a dart + polymer app, which I have uploaded to my home page. The entry point is not index.html. It works fine.
I have now developed a home page, index.html, again in polymer and dart. Essentially, it's another app of course. It's n the same top level folder as my app. I've been playing around uploading (which takes ages!) the packages subfolders, but can't get index.html to display at all - yet.
So my question is, will the packages subfolders conflict with each other, and I shouldn't do it?
Thanks
cheers
Steve
If they are both polymer apps on the exact same version and all their packages are the exact same version then you might be ok, but I wouldn't suggest it.
Instead, can you make a single package which has two entry points (one for each of your apps)? If you want to keep your code separate for each of them you can do that still by moving everything into the lib folder and using a git or path dependency on each package (you probably don't want to publish your apps to pub).

Buttons not working when Dart project is moved to server

I'm a math teacher with some novice Java skills. About six years ago I made some applets so my students could practice word problems. As time went on, more and more of my students have had problems using the applets because of browser incompatibility (I think). So this summer I've been working to convert the applets into a Dart app. The entire project is two textareas and about eight buttons that either display a problem or its solution.
So far I've got it working just fine in Dart Editor. It compiled to JavaScript without an error or warning and runs well in JavaScript, also through Dart Editor.
I copied the files to my website using FileZilla, but when I access the app on the server via a browser (I tried Safari and Internet Explorer) the app looks correct but none of the buttons work. That is, nothing happens when they are clicked. I'm not sure that I have copied all of the correct files/folders. I copied everything to the server that is within the web/ directory. There are two HTML files, one in out/ and one in web/. Which HTML file should it launch from? And should I just rename that file to index.html?
I've got about 40+ hours on the Dart phase of the project but am about out of time to devote to this particular problem. I've put in a few hours searching for help and related examples online, but I think my questions are so basic that there is no information available.
Again, I'm not a web developer or programmer. Think 50 year old math teacher.
Since a Dart project contains symlinks to dependencies, you can't simply copy a project to a server and have it work. pub deploy is a command that bakes your application and bundles the files for copying to a server.
It's somewhat a early, but there's a description here: https://docs.google.com/document/d/13y7yCwq9GtPChXtd6t0YMcUtMJLZq2IVwq546Dve_No/edit

Markdown parser for markItUp editor or stable WMD-showdown release

A bit of a long-winded question(s)...
Is anyone aware of a markdown parser for markItUp editor? I tried showdown.js but it appears there is no way to integrate it with markItUp. This is despite makrItUp having a configuration API that allows you to specify a custom parser path and variable using previewParserVar and previewParserPath arguments.
In reality I prefer using WMD Editor, but when I tried using the SO version on gitHub I found it to be very buggy. There are so many forks but I'm unable to find a stable one.
I eventually found this fork, jquery-markedit, which is really cool, but when the form is posted, unlike the original wmd-fork, the form does not post the parsed text. The textarea data is posted as plain text. The text is parsed fine for preview, but it seems odd that it's not parsed for submission.
So I decided to resort to markItUp which has a markdown set but does not have a parser.
The version of WMD that SO currently uses is different from that on gitHub wmd-fork - is anyone aware of the current version SO is using and if it is available as open source?
Yes I'm aware of markitup!. I recently (today) tested markitup! and WMD. What strikes me is markitup! seems to have no undo functionality. And the header (h1 - h6) functionality in markitup! requires 6 buttons, but only 1 button in WMD.
Among all WMD repos, I've downloaded and tested these 2 repos, and I think they seem promising (I've tested them only 30 seconds each so I might be very incorrect).
umamo, which (says its commit messages) adds LaTeX math.
klipstein, which fixes buggs and makes | separators visible.
Both are based on the Open Library repo, which I need because it makes it possible to have many editors open at once. However, that fork did lots of refactoring; I don't know if that'll make it messy to merge changes from other branches.
I have no idea which repo Stack Overflow uses.
By the way, here is an interesting showdown.js repo (showdown is the JavaScript implementation of Markdown used by WMD), which implements support for RTL languages (according to its readme file). I'm considering including those changes in yet another WMD repo :-)
https://github.com/hasenj/showdown/tree/
Hope this helps,
Magnus

Source code search with Google Desktop

Is there a indexing plugin for GDS that allows for source code search? I see some for specific types (Java, C++, ...) and one for "any text". These are nice, but I would like one that allows for many/configurable extensions (HTML, CSS, JS, VB, C#, Java, Python, ...). A huge bonus would be to allow for syntax highlighting (http://pygments.org/) in the cache.
I just found Dropout and it seems to work great. Put Dropout in any folder and it will index all files in that folder. I put it in my Projects folder and it crawled all my code. Very fast and flexible search. Dropout
You could use OpenGrok or some other code-specific search engine instead.
I wrote a quick review of some of them some time ago.
It has been a long time, but the last time I tried to use Google Desktop Search for searching code, I found it quite inappropriate for that task, as I outlined at [http://perlmonks.org/?node_id=490310], the gist of which is that GDS (silently) only indexed a tiny fraction of many source code files (and made it quite a challenge to figure out why searching so often failed to find so much of what was in source code files).
I found Copernic Desktop Search worked better on code files (but I also had trouble with later versions of it being buggy in not finding all matches so I've been staying with version 2.1.1). But these days I don't use it much (mostly because I don't have permission to install such things on the laptop provided by my new employer).
You can try out Larry's Any Text File Indexer. You can specify a list of extensions at install time and it will do full text search on those file types.
Im just giving this a go:
http://desktop.google.com/plugins/i/java.html?hl=en
..also you can search for things in your Java tree using the following syntax in Google Desktop:
<YOUR SEARCH> filetype:java under:"C:\hft\trunk"
..where I keep my code in "C:\hft\trunk"
This is not a Google Desktop plugin, but works for what we need.
We have started using http://svnquery.tigris.org/ and it seems to work and is very fast. I wish it supported multiple repositories per site. We have a repository per project, so currently I have to create a virtual directory for each project we have. Not a show stopper, just something we need to automate in our project setup script.

Resources