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

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

Related

Can't create a directory in the correct directory in AndroidStudio 3.0

Am reading the Android App Dev for Dummies 3rd edition. I've had no headaches till I reached page 92 where it asks me to
"...create the file
src/main/java/com/dummies/silentmodetoggle/util/RingerHelp.java"
The only thing is that I cannot find a way to create the directory "util" in the proper directory. I tried it many ways, including doing it manually within File Explorer, but that didn't show up in my project.
According the File Explorer the directory is in the right place. But according to AndroidStudio it is not (appears to be one level up).
It appears that there was a lower version of AndroidStudio when this book was published, yet I do appear to have the latest version of the book.
I feel as if I am asking a stupid question, I hope the answer is something obvious that is right in front of my nose.
Project structure:

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

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.

Linking to an external www-folder - Tools for Apache Cordova (VS 2015)

For a project I'd like to use an existing website as a base for a cordova app. My project setup looks as follows:
One Solution with two projects
A ASP.NET webservice project (with website aka html/js/css)
An tools for apache cordova project
I don't want to copy the html/js/css files from the website on every build. Instead, I thought I could get away with some kind of a link to the www-folder in the ASP.NET project. I tried several approaches:
Creating a filesystem link (tried 'mklink' with parameters /D and /J - /H is not working for directories
Editing the .jsproj file and add a tag to link to the other project's www-folder
The second approach didn't work at all. Just got some weird errors when trying to load the project again (saying something about file duplicates).
The first approach worked a little bit: It is working, when targeting the windows platform. It is NOT working, when targeting iOS.
When targeting iOS, everything is copied just fine to the platforms\ios folder (read, all the content of the linked www folder is copied to the platforms\ios\www folder). But it is not copied correctly to the remote build tool on Mac OS X! It really just copies the directory link as a file. Remotebuild then failes with a 'missing www directory in top level' message.
Any suggestions how to add a link so the content is copied (instead of the actual link)?
Is there a way to take detailed influence on the build process for specific platforms?
Is there a way to create a hardlink to a directory in windows? What are the drawbacks?
I'd really like to avoid copying the files on build (which would be simple enough with a prebuild script), because there's a high risk of loosing changes made while debugging.
I'm aware that setting a link is also not the best solution, since it has to be done per machine and can't be checked in to a version control system. So, if somebody knows of a better aproach to handle my scenario, let me know.
I work on the Tools for Apache Cordova in Visual Studio at Microsoft.
I'm sorry but VS-TAC does not support add as link. To prevent confusion we removed the option in update 3.
The best solution I can give you is to copy files from one project to another. Another user asked this question a week ago and came up with a hacky solution. Please see this for more information:
VS2015 typescript cordova add as a link
Sorry for the trouble and thank you for the feedback!

Can't open project: "One or more lines were too long and have been truncated"

I'm having some kind of problem with my project that me and my friend is working on. When I try to open the project that I've been working on it gives me an error message saying that "one or more lines were too long and have been truncated" and thus I can't see my code or GUI. When my friend opens the project on his computer (The project is on dropbox so it's the same file) there's no problem at all. I've googled but couldn't find anything. I just did a repair of RAD Studio but no luck. We have 2 forms and a unit that we use, the unit and the mainform isn't working for me but the second form is no problem.
Thanks!
Make a copy of your project directory.
Search your harddisk for XXXX.pas and XXXX.dfm
Hopefully there will be some temperary files that match - like "mylostform.dfm.~1307~" . copy the newest to your project directory, and rename them to "mylostform.dfm" and "mylostform.pas".
Kind regards,
Geir Bratlie
From the comments, you have Dropbox, and the Restore functionality is available, but using it would cost you a week's worth of work.
If I was in that situation, here's what I would do:
Copy the current file to somewhere else (My Documents, for example).
Use Dropbox Restore to get the old version that works.
Make a copy of this, because you're going to be modifying it
Ensure that you can open it in the IDE.
Use Beyond Compare to open the two files side-by-side. (If you don't have this, you really should!)
If they're completely different from each other, you have a serious problem. If not, you'll see the changes you've made. Start copying changes one at a time, and after each change, save and try to open it in the IDE.
At some point, you won't be able to. That's where your problem lies. Now you can fix it!

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

Resources