A little background:
My app is built on Polymer 2.x and is being hosted on a server that does not support HTTP/2 and does not have a certificate for HTTPS. We must support IE11, Chrome, Firefox, and Safari.
Problem:
I'm running into an issue with browser caching. I was hoping to use the service worker that the Polymer CLI generates to handle the cache busting. However, since our client's server doesn't have HTTPS enabled, we are unable to utilize it. Regardless, we have to support IE 11 on a single build, so service workers aren't an option.
I cannot figure out a way to bust the cache on new deployments. On the Polymer CLI github page, there is an open issue regarding this topic, but there hasn't been any traction since 2016. From watching the YouTube videos on Polymer, it looks like there is (or used to be) a way to intercept the build using Gulp, but I can't seem to figure it out.
Any help is greatly appreciated!
You can use the polymer-build library if you want to build a Polymer project using gulp. You can read about it here:
https://github.com/Polymer/polymer-build
Briefly mentioned in the docs here:
https://www.polymer-project.org/2.0/toolbox/build-for-production#use-polymer-build
Then you can cache bust using something like gulp-rev, but you have to make sure that you're not rewriting the custom element names, just the filenames and import paths. (I tried this once with gulp-rev-all, and by default it was replacing <app-header> with <app-header-a9fe00> or something like that.)
While creating the build run polymer build sw-precache-config.js
I've created gulp-polymer-build to help with this very issue. It borrows from polymer-cli build code, and supports your build configs in polymer.json. It allows you to modify your source stream before building, and then modify the forked streams for all builds you've configured in polymer.json. This makes it easy to use gulp-rev and gulp-rev-replace to do asset versioning.
Related
I am setting up Heroku CI with Elixir Phoenix buildpack. I want to start using Dialyzer.
Diazlyer is a static analysis tool that before the first run takes at least a couple of minutes to create a "persistent lookup table" (PLT) of types from Erlang, Elixir and project dependencies. Later, project analysis is much quicker. I want to cache the PLT.
I've found this section on caching during build: https://devcenter.heroku.com/articles/buildpack-api#caching but I can't find anything about caching in test-setup or test script.
Is there test/CI cache or is it only usable in buildpacks?
(Tomasz, I know that you already have found a path how to approach this problem, but I will share here publicly what I have shared with you privately so that others might also benefit.)
Is there test/CI cache or is it only usable in buildpacks?
Seems that in test/CI you can not do it, you have to use a buildpack. Or maybe hold the cache somewhere outside of Heroku (seems like not a good way to me though).
Have you seen this https://github.com/tsloughter/heroku-buildpack-erlang-dialyzer? It seems dated but maybe it has some hint that can be useful to you.
Setting up backpacks is rather straight forward and for your need this seems the only option that would support caching.
I've built an app using arrowDB for the backend. Is there a simple way to duplicate development data to production?
Seems like an oversight not to be able to do this, have an app going through review process and just realised all our test data won't be accessible
As far as I know, there is no feature like this right now.
You could probably build your own using their REST API. I haven't seen a solution like this built yet but I definitely think it is possible. If I get some free time, I will try to put one together and will post a link here.
We are working on a mobile portal using Worklight 5.0.6 with the Mobile Web environment.
While loading the application, all the resources like js, css, images etc.. are loaded together. Due to this it takes too much time to load the page. How can we restrict the resources (which are not required) to be loaded together with the application. And how can we force to load only the required resources?
Sounds like what you're asking is:
How to reduce the size of the application
How to reduce the network traffic produced by the application
Indeed, in Worklight 6.0.0.0 there is: the Minification and Concatenation feature as well as application cache (auto-manifest generation). Since you don't have that in 5.0.6, what you could do is:
Regardless of any feature, only keep in your app what you're actually using.
Remove images and libraries you're not using
Use png-crush to minimize the file size of images
Remove dead code
For network traffic:
Add a manifest file to your application and list in it all the resources you'd like to cache as opposed to always fetch. Application Cache is a web standard so you can simply follow articles on the web.
You could "manually" minify your application resources; you can accomplish this using Google Closure.
BE CAREFUL! If you choose this path, make sure to only use the WHITESPACE_ONLY or SIMPLE_OPTIMIZATION compilation levels. Do not use ADVANCED_OPTIMIZATIONS on the Worklight framework files - behavior will be unknown (it may work, it may not, it could suddenly fail at some parts - this is not supported by Worklight).
As for only loading what you want to, ala RequireJS, Worklight is not yet equipped to handle this, so this is not a viable option for you.
There is IMO not much to do in 5.0.6 about this; 6.0.0.0 took it a step forward and the upcoming 6.1.0 handles it better as well (the Mobile Web environment is much lighter in regards to its structure and number of files), but you cannot do moduler loading of resources just yet.
I am trying to implement jasmine-maven-plugin for my project.
In my project there are multiple separate web projects, I successfully integrate the above plugin in all of my web projects except one.
I have used HtmlUnit driver for all of my web projects but getting RuntimeException: Exception invoking setOnopen from WebSocket class for a particular web project, others are executing fine.
Instead of htmlunit if I use phantomjs driver then it is working seamlessly but for that I have to keep the phantomjs executable in my system PATH which is not go with the maven philosophy, I do not want to keep any separate executable in my system. Due to this I want to use htmlunit driver which is throwing the above setOnopen exception.
I did lots of google but not able to get any solution, if you have any insight on this issue please let me know. Thanks In advance.
If you want to avoid requiring phantomjs be installed separately you may want to take a look at these projects for some ideas:
https://github.com/qa/arquillian-phantom-binary
https://github.com/qa/arquillian-phantom-driver
And take a look at this forum discussion:
https://groups.google.com/forum/#!topic/phantomjs/yZj_ciH21pE
I've yet to have time to try this out myself but it sounds promising. Also, note that you don't need to have phantomjs on your system path. You can specify the location of the binary using the phantomjs.binary.path property. See the second example on this page which shows how to configure it using this property.
Hope that helps.
I am really confused at to how Meteor works.
I know there's a server side where you just install it using the terminal.
But what about the client?
Does the client need to install anything?
For example, clients need to install Adobe Flash to run Flash. Are we talking about the same thing here? Or can the client just access it through a regular page without installing anything.
Thanks for the clarification.
<3 StackOverflow
Meteor is a pure javascript web-application framework.
All you need to run meteor is a JavaScript environment.
Server-side, NodeJS is the gold standard javascript environment.
Client-side, all you need is a browser that supports javascript.
There are no plugins required or other magic at work. It's just javascript.
I am assuming you mean the Meteor Http Server? In this case, you can think of it as being very similar to SignalR or node.js. Basically javascript on the client handles receiving events that come back from the server, so you will generally need to include a script on the client side.
You may want to read the following links for more information.
http://meteorserver.org/browser-techniques/
http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx
I think the question refers to http://meteor.com, and if that is the case the client does not need to install anything.
Meteor is a framework for writing Javascript applications, and as such all modern browsers support it "out of the box". The initial request for a web site will download the HTML, CSS and Javascript and it will run just as any other web application like GMail, etc.
You can check out a series of example applications at http://madewith.meteor.com and you should be able to run them without adding any plugins, etc.