Skip to content

BRJS 1.0 Compatability

Latest
Compare
Choose a tag to compare
@andy-berry-dev andy-berry-dev released this 03 Jun 10:41
· 1 commit to master since this release

AppCache Plugin v3.0.0 - BRJS 1.0 Compatibility

Changes to make the plugin compatible with BRJS 1.0 plugin API changes.

  • The version is now configured via the internal BRJS version rather than a separate config file. See below for usage.
  • The tokens $timestamp and $brjsVersion are no longer needed or supported as the BRJS model version already provides this.

Usage

Quick start

Usage

Installation

  • Copy the plugin JAR to the BRJS conf/java folder.

Enabling

  • The plugin provides the appcache.url tag handler. This tag will replaced with the URL to the manifest file, so you should set the manifest attribute on the html element to use the tag as its value.
    • To do this change the html element to <html manifest="<@appcache.url@/>">

Configuration

  • By default the appcache is disabled in 'dev' and a URL that returns a 404 response will be used to disable the cache
  • The appcache version is configured via the BRJS version property.
  • To enable the appcache in 'dev' the version should be changed to a numbered version. To do this run the serve command
    with the 'version' argument, for example brjs serve -v 1.2.3. A timestamp will be appended to the
    version to ensure versions are unique.
    • The timestamp is calculated when the serve is started and will not
      change on subsequent reloads. This is to ensure the version remains static in the manifest as browser's
      will throw an exception is the manifest file changes while assets are being downloaded. To change the version
      the server will need to be restarted for a new timestamp to be generated.
  • When building an app for production the version can be supplied via the 'version' argument, for example brjs build-app foo -v 1.2.3.
    As with the serve command a timestamp is also appended to this version.