Recent updates to Acre, our app development environment

Jason’s recently pushed out an update to Acre, Freebase’s hosted app development environment. He sent me an email with a list of changes, so here they are verbatim:

  • acre.response object. With this release, you can now set headers incrementally and from within templates using the new acre.response object. Previously, the HTTP headers of the response could only be set all at once via acre.start_response. In addition, acre.start_response was only usable from scripts and could not be called from within templates. While scripts that currently use acre.start_response should continue to work for now, we do plan on deprecating that API in the future. More documentation here.
  • Easily pass variables to the browser. To make it easier to send a value from a script running in Acre to a script running client-side in the browser, we have added a new convenience method called acre.markup.define_browser_var(value, name). This new API just outputs a script tag which declares var name = value. This API is necessary because it’s not possible to safely support $-substitution within <script< tags.
  • HTML and XML parser changes… and Sizzle support. These have been moved to acre.xml and acre.html (form XML. and HTML respectively) in order to avoid some conflicts we were having with Rhino’s internal parsing. In addition, thanks to Stefano, there’s now an example of how to use Sizzle (jQuery’s DOM selector engine) server-side in Acre. If you have a use case involving web-scraping, then you’ll want to take a look: http://sizzle.stefanomazzocchi.user.dev.sandbox-freebaseapps.com/
  • App Editor now supports IE7. Finally, some support for that “other” browser. :-) We haven’t had a chance to test it as thoroughly as we’d like, so please let us know at bugs.freebase.com of any issues you find. IE6 is still not supported (and won’t ever be) and we’re waiting for the official release of IE8 to complete support for that one… although it should work OK in IE7 mode.
  • New API Keys dialog in app editor. If you want to add or remove API Keys (secrets for using third-party services that you don’t want others to be able to see or clone in your source code) you can now do that from within the app editor itself by picking API Keys… from the App menu.
  • More oauth providers. We’ve added built-in support for Google and Netflix. Because Google requires oauth credentials to have the scope of a specific service, we’ve defined separate providers for each to make it simpler to use. You still only need to enter in an OAuth token and secret once for all of the Google services (in the API Keys dialog), however.
  • Caching off by default. We used to send somewhat non-sensical cache control headers by default. We’ll be trying to set more intelligent defaults over the next few releases, but for 17 the default is to not cache at all. However, you can use acre.response.set_header to explicitly set your own cache control headers if you want.
  • Customize your own error page. Want to provide something more friendly than the “fail rhino” to your users? If you create a file named ‘error’ in your app that will be displayed instead of the default error script. The error information will also be available in acre.environ.error_info if you’d like to include that in your page.

Comments are closed.

About

Freebase is a free database of the world's information. This is the official Freebase blog.