Several host page compile full project - google-app-engine

I have a GWT application that use and have 2 host pages with 2 differents EntryPoint (gwt.xml files) which some code and most important, Database (datastore in Google App Engine) common.
The problem is that one of them makes use of several external Java libraries, including SmartGWT with its JS, meanwhile the second one use none of them. When I deploy (and compile) to Google App Engine, I need to include reference in the second entry point to SmartGWT, although it's not used. If inherits directive lacks, I get lot of compilation errors. I don't want to load SmartGWT JS files (2 MBytes) when they are not necessary, growing download from a few Kbytes to 100x times Kilobytes with SmartGWT. This second host page is a Google Chrome Extension, where light load is a strong requirement.
If I run in GAE SDK eclipse local webserver without any reference to SmartGWT in second host page, it works. But if I compile the whole project (although in first hots page references to SmartGWT remains) I get errors, related to SmartGWT absence.
Is it possible to make a separate compilation of two host pages?

Your project appears to be burdened with a dependency of questionable value. If your project does not make heavy use of GWT, consider rewriting your web pages to not use GWT. In some cases a framework has more drawbacks than benefits. That does not mean the framework itself is bad, but it may be a big sledgehammer cracking a small nut. Your project has only two pages, so it is imaginable that making it without GWT is feasible.

Related

How to get from zero to Mobile Web App with Data in 60 seconds

I know that all these components exist, however I really am trying to figure out if someone has brought all these together.
Here is what I need:
JavaScript/NodeJS core application boilerplate/framework
With a website, HTML app (aka PhoneGap or even better Ionic), and ideally option to add something like a desktop app (like electron) client flexibility
All with possibility of different/specialized frontend code so all assets and HTML could be packaged into the app
Ideally kept in one GIT repo
With shared code amongst all UIs
Ability to use Angular 2 in all environments (or something similar)
Realtime? standardized data connection with data source (like meteor's DDP), I really dislike polling and I don't want to have to write my own data protocol
Have some kind of authentication capacity
Already exist in some way
What I have been eyeballing thus far is Ionic2 on top of Meteor, however it is remarkably difficult to find an actually working example of them playing together and I have not found any with separate codebases between the two interfaces.
To clarify, below is sort-of what I envision for a folder structure:
public/
common/
models/
business-logic/
server/
web/
desktop/
mobile/
And in that, all UIs and server can import from the common folder.
The end goal is to have something like Slack where they have 3 different ways of accessing the same data using the same rules but can really specialize in each interface type.
Does this exist?
I am really looking to have something that can be started with:
git clone http://github.com/a/bc
npm install
# do some other things that are documented
meteor run ios
Or am I not gonna have my cake and be able to eat it too?
I know I am shooting for the moon, but I know I can't be the first person looking to do this
For the backend I think that LoopBack may be a good bet if you want fast developement.
They have some examples for iOS, Android and Angular apps on their website:
You may get some ideas from their documentation or several example projects on GitHub.
LoopBack is currently backed by IBM.

Is there consensus on a view engine for Nancy?

I was a little startled to learn that Nancy has its own razor implementation, that may or may not behave like razor. In practice, does this cause issues? What are "most people" using for a Nancy view engine? Why was the real razor not used?
First the easy answer. The Razor engine is, by far, the most downloaded view engine available for Nancy https://www.nuget.org/packages?q=nancy.viewengines
Now for the more complicated questions
Why was the real razor not used?
Because the "real" (and by real I'm going to assume that you mean the one used by the ASP.NET stack) Razor engine is tied to the HTTP abstractions that are built into the ASP.NET stack (HttpContext and all its friends) so there is no straight forward way to use it with Nancy.
The slightly longer answer for this is that you have to understand that Razor is really a parser and a Razor view engine is what sits in the middle of the consumer and the parser.
Nancy uses the Razor parser but we have to have our own view engine because that's what enabled Nancy to parse and execute Razor templates.
Now, it does get even more complicated. Many of the features you see in the ASP.NET Razor view engines, such as master pages, partials, various helpers, _ViewStart and so on, are not Razor (the parser) features, but they are an additional feature set that have been built into the view engine (you can almost think of it as middleware).
This means that for our engine we've had to re-implement much of these features because that's what's come to be expected from a Razor view engine.
I would like to point out that, if it was possible, then we would love to ditch our own implementation and use the one built by Microsoft (less code for us to maintain and it would mean we'd support 100% the same feature set), but unfortunately that's not our decision to make.. we can't take a dependency on their abstractions I am afraid
Hope this clears things up
/A
We have been using the Razor implementation from Nancy for a while now. We have run into a couple of issues that are making us either switch to SSVE or abandon Nancy (we do really love Nancy).
The first issue with Razor is you cannot precompile views like you can in MVC which leads to much longer startup times. We have had many complaints about this.
The second issue is there seems to be a long-standing bug in the Razor implementation with Nancy which causes a situation that is only resolved by recycling the application pool. I'm not an expert but it seems when the project is loaded there is a temporary DLL being compiled and generated at that time (this explains the slower load times) but sometimes there a problem which leaves to the instance not being able to be created. It seems to be at this location: https://github.com/NancyFx/Nancy/blob/master/src/Nancy.ViewEngines.Razor/RazorViewEngine.cs#L238. Basically "viewAssembly.GetType("RazorOutput.RazorView")" is NULL at various times which causes only an error message to be displayed on every page, for every user, at all times and the only way to fix it is to reload the application (recycle the application pool)
Just my two cents and I know this post is older but maybe others will see some of the problems we have run into. I've opened a GitHub issue but the bug is hard to reproduce for us and it hasn't gone anywhere.

Parallel Module Deployment using App Engine SDK

TL;DR Is there a way to deploy App Engine modules in parallel?
I've built a go application using Google's App Engine SDK for Go. This application defines multiple modules. These modules are self-contained, and do not require any sort of dependency across other modules.
When I attempt to deploy the modules to the Google Cloud, I can't help but notice that the modules are uploaded sequentially. This would be fine if deployment was relatively quick, but each module requires it's own redundant compilation of the Go binary. Hence, on top of the regular upload time, I have to wait for my app to compile [module count] x [compilation time] every time I want to deploy.
The obvious (quick) solution is to deploy in parallel, so I created a simple bash script to deploy each module independently. The problem I immediately encountered with this "solution" was a HTTP 500 response from the App Engine API. The whole umbrella application, spanning across all the modules, seems to "lock" whenever any individual module is updated. This scenario creates a race condition, under which only the first module to trigger a deploy succeeds and the others fail.
I fear that this is a holdover from the legacy languages in App Engine. Since every module uses the same Go binary, it doesn't really necessitate multiple compilations of the same code. Repeated compilation is redundant, and there is no way to circumvent the lock.
One hypothetical solution, which I have only a vague understanding of, is to compile in parallel and deploy in series. I imagine that this approach would involve taking apart the configuration tool and reworking it to execute in the aforementioned manner- though I can't say for sure (yet).
Any help here would be much obliged. Thanks!
You can deploy to another "version" of your App Engine app, then when all modules are deployed, do a very fast version switch?
Versions also allow for traffic splitting if you need/want that kind of thing.

Cross-platform mobile API -- Looking for recommendations

So, yes, this is probably 1000th question on the subject. However, my question is somewhat different from others that were asked about this, so please bear with me:
I am looking to develop a single mobile-app that targets the three/four popular and/or growing mobile platforms (Iphone, Android, WinPhone7, RIM). This application is an extension of an existing SaaS system that my startup currently offers. This mobile-app would provide a quick-and-simple way to view up-to-date status & chart & report information for the data that SaaS application collects. Connection to the internet is required 100%. No data entry besides username/password. App is very simple with 5-6 "pages".
In phase 1, all that would need to be supported is for user to log in, get to see current status of his data stored in the cloud, get access to a few live reports
In phase 2, I'd like to be able to offer push-notification of certain key events from my servers in the cloud
My goals are:
1) The back-end processing that generates data for reports is already written in ASP.NET MVC2. I want to re-use it. It can be exposed as either a WCF service or published on a mobile-friendly website
2) I'd like to be able to deploy the patches faster than through the official app-stores/marketplaces.
3) I cannot afford to spend a lot of resources to target three-four proprietary platforms, for an app that is auxiliary to the vertical purpose of the business. I want to develop it once for all 3-4 platforms.
4) I do not have access, nor do I want to purchase a Macbook
5) I do want to deploy thru the vendor-specific application marketplaces
6) I'd like to stay way from proprietary languages/frameworks/lock-ins
Sounds like what I need is a shell around a mobile-friendly site that can be packaged as an app. Are there existing products that can make it REAL EASY for me to do so? Will doing so, preclude me from doing push notifications in phase 2?
Can anyone recommend a "shell" product that would make a wrapper around the website as well as Javascript library that would look the best across all 4 platforms. I've seen the names like Jqtouch, Jquery Mobile, etc... but not sure which ones are better for what I need.
Do I need PhoneGap? I am not 100% sure here. Can PhoneGap use online-only html/javascript pages to translate into native code or must html/javascript files be distributed with the application? I'd rather have the website itself drive the UI completely, as I can keep changing the website without various version approval processes from vendor market-stores.
Thank you for help
I don’t think you need Phonegap after reading about your project goals. You might consider a Web App instead of a native one if you 1) dont want to buy a mac (required for iOS even tho you can compile it in the cloud: https://build.phonegap.com/), and 2) want to apply and deploy updates anytime without going thru those platform independent marketplaces and approval processes.
jQuery Mobile would be an excellent choice, currently (at this very moment) in Alpha 3 but a very stable one and you can deploy your system on any of those platforms. Note that if you focus your efforts in a Web App you can’t target the second phase you mentioned: Push Notifications.
If you decide going Native, then Push Notifications services can be deployed into your Phonegap project once you setup the proper web services and certificates (take a look # http://easyapns.com);
..and one quick note, the idea of phonegap is that all resources (html, js, images. etc) have to be distributed locally within the app and then getting online data (like reports, etc) using JSON from another web service, and that’s another easy task to accomplish. Phonegap DOES NOT compile your HTML files into native code (ObjectiveC or Java), it just load your Web App into a UIWebKit component at run time (in the case of an iOS app)
Another alternative could be using Titanium - http://www.appcelerator.com but this approach is more javascript oriented and your final app looks much more native. (not HTMLs here so I think thats a drawback for you)
Hope it helps :)

Uploading a simple web2py app to GAE

I created a web2py app that is extremely light, with the goal of eventually making the app support JSON-RPC calls, and maybe a few other things.
I found some tutorial online that (on winxp) had me get the source code for web2py and extract it on top of the compiled program. At the top level, I edited app.yaml with my program name and used the GAE SDK to upload the program. It looks like that uploaded everything including example applications. I think it's including a whole gluon directory, and other dir's full of py files. Is there a way to setup web2py to only upload my application, and what's minimally required to run it?
The app.yaml that comes with web2py includes a section skip_files and it should contain, among others, this line:
(applications/(admin|examples)/.*)|
You can change it to
(applications/(admin|examples|welcome)/.*)|
So that welcome app is not deployed. You add more apps that you may have and do not want deployed.
At minimum you need:
web2py/gaehandler.py
web2py/gluon/* (and subfolders, this is web2py)
web2py/applications/theoneappyouwanttodeploy/* (and subfolders)

Resources