Published 2015-05-09 00:00:00

My final words this week on the builder - handling resources, and fake web servers

While I talked in the other posts about how the builder extracts the API for various components from the libvala library and the vapi files, some information that the builder requires has to be manually, created or fetched from other locations.

When the Builder was written in seed, it basically looked at the source code directory, and read files relative to the source code. For the Vala version however, it's not expected to know about the source code directory, so I had to use a different approach.


The Resources


The builder needs various files to run, most of which are in the resources folder in the source tree, this includes
  • Usage files for Roo, and Gtk - these are the files that define that you can add a Gtk.Box to a Gtk.Window, or a Roo.data.Store to a Roo.grid.Grid and if the child element is a property or just a standard child in the tree.

  • HTML and javascript for rendering the preview. When the Preview of the web applications are rendered, there is a standard set of javascript and HTML that make up the page.

  • An overrides file for the Gtk API, Since we write the source code in vala, It generates constructors for the Gtk Objects instances, the parameters that are needed for the contructor are usually named to match properties, so it can fill in the correct values for the constructors. In some instances this is not correct (a Gtk.ListStore for example as a variadic value for the column data) so the overides file does some mapping here to help out the code writer.

  • The Roo API, when we generate the documentation http://roojs.com/roojs1/docs/ for roojs and the bootstrap part, we also output a javascript file which contains the API details.

  • Plugin editors - as discussed in the previous post, we use bjs files (the default file standard for the builder) to store the plugin code. 


When fetched these files are now put in the ~/.Builder/resources folder.

Fetching the resources


When I converted the application to use vala, we originally hard coded this to locations on the file system, however that was not really that portable, so I added some code to download the files using libsoup from our git repository. This code would run when the builder started, and could often delay startup times by a half a minute. 

Since these files do not change much, this loading was a bit of an overkill, however since we fetched from the standard git web cgi, there was no simple way to check if the file being downloaded was any different from the file already on the file system. To get around this, we needed to find another way to fetch updated resources.

Our in-house git repo is partially mirrored on github, so after fixing the auto-mirroring hooks, I changed the code in the builder to use the github file API. Along with this I added the ability to 'update' the resources while the application was running (there's a buttons for it now.. although it may move soon to the new Gtk.Headerbar menu button.).

Using the github API we are able to parse the resulting JSON directory listing, find out the git sha1 for the required file, and compare it to the sha1 on the local file system. Meaning we only need to fetch files which differ. Current this is hard coded to our github repo, but It would be trivial to add a setting to pull this from a user-defined github repo, enabling users to add their own Editors, or even start sharing templates for applications or web sites.

A fake web server


The 'Web' application creator part of the builder uses Webkit, historically this has used a mix between the local resources, and also assumes that the roo library is also available via apache on localhost. To try and make it easier to use, I had for quite a while considered serving the javascript and images from the roo library either using a web server built into the application, or by some similar method.

As I investigated this I discovered due to the change in how Webkit2 now seperates the rendering, it is no longer possible to capture requests for network resources and supply a different response. It is however possible to register a special url scheme - in our case we used xhttp://. this can then be handled by the builder, so that it returns a file from the local files system (either a file from the resources downloaded above, or a file from the local file system. At present we are serving the roojs library from the local files system. but the location is hard coded.. (this needs to be fixed).. the code for this is inside our FakeServer.vala 

Anyway that's quite enough about the builder...

Comments

Application to utilize magma
According to me you changed over the application to utilize magma, we initially hard coded this to areas on the document framework, however that was not by any means that compact, so I added some code to download the records utilizing lib soup from our git store
#0 - Essay Service UK ( Link) on 2017-11-22 20:00:43 Delete Comment
App
The Ajax demonstrate includes utilizing a web API as an intermediary to more keenly ask for information instead of simply having the program to reload the whole page.
#1 - get assignment done ( Link) on 2017-12-26 14:11:54 Delete Comment
web servers
It creates constructors for the Gtk Objects occurrences, the parameters that are required for the contructor are normally named to coordinate properties, so it can fill in the right esteems for the constructors.
#2 - michealclark ( Link) on 2017-12-26 15:07:13 Delete Comment
Best Health Insurance
Wonder Cube Company point is to instruct our guests about Insurance and we are here for your correct advising distinctive classes we have about Insurance and we are here to help and convey you the correct Information about Insurance as you require.
#3 - Laura Martin ( Link) on 2017-12-29 01:42:00 Delete Comment
App Builder and fake web servers
At the point when the Builder was composed in seed, it essentially took a gander at the source code registry, and read documents in respect to the source code. For the Vala form in any case, it's not anticipated that would think about the source code registry, so I needed to utilize an alternate approach.
#4 - CourseworkLounge.co.uk ( Link) on 2018-01-01 15:56:36 Delete Comment
I think the most well-known held
I think the most well-known held conviction by those that comprehend what most hosting audit destinations are, is that they are about high member payouts. Which happens, however not with all facilitating surveys. Some don't do it for associate installments. am i right?
#5 - Assignment Help ( Link) on 2018-01-03 14:57:38 Delete Comment
fake web servers
It makes constructors for the Gtk Objects events, the parameters that are required for the contructor are typically named to facilitate properties, so it can fill in the correct regards for the constructors.
#6 - writingessay.co.uk ( Link) on 2018-01-03 22:04:27 Delete Comment
App Builder
Our in-house git repo is somewhat reflected on GitHub, so in the wake of settling the auto-reflecting snares, I changed the code in the developer to utilize the GitHub document API. Alongside this, I added the capacity to 'refresh' the assets while the application was running (there's a catch for it now.. in spite of the fact that it might move soon to the new Gtk.Headerbar menu catch.).
#7 - EssayAvenue.co.uk ( Link) on 2018-01-04 15:33:51 Delete Comment
australia
Esteem it for sharing your expert site. Thankful for sharing this incredible website.
#8 - jimmyalex ( Link) on 2018-01-06 17:41:13 Delete Comment
My Opinion

Github app builder providing the save platform for the developers. They can get a solution to their coding and solve their bugs.
My Opinion

Github app builder providing the save platform for the developers. They can get a solution to their coding and solve their bugs.
Fetching Resources from github in the App Builder and fake web servers
Most applications will utilize a current wrapper library in your preferred dialect, however it's critical to acclimate yourself with the basic API HTTP strategies first.
#11 - Best Essay Writing Service ( Link) on 2018-01-09 18:05:14 Delete Comment
GroovyEssays
I think the most surely understood held conviction by those that appreciate what most facilitating review goals are, is that they are about high part payouts. Which happens, however not with all encouraging reviews. Some don't do it for relating portions. am I right?
#12 - GroovyEssays.co.uk ( Link) on 2018-01-09 20:48:17 Delete Comment
Do My Myob Assignment
I’m really impressed with your article, such great & usefull knowledge you mentioned here
#13 - Do My Myob Assignment ( Link) on 2018-01-13 14:47:50 Delete Comment
essay writer
I think the most understood held conviction by those that grasp what most facilitating review goals are, is that they are about high part payouts. Which happens, however not with all encouraging studies. Some don't do it for relating portions. am I right?
#14 - essay writer ( Link) on 2018-01-16 15:25:09 Delete Comment

Add Your Comment

Follow us on