racido / broccoli-manifest Goto Github PK
View Code? Open in Web Editor NEWHTML5 cache-manifest compilation for broccoli
License: MIT License
HTML5 cache-manifest compilation for broccoli
License: MIT License
I currently use "real" URLs in my ember app, which unfortunately breaks the manifest since it uses relative paths.
To get around this, it feels like there should be a mechanism to transform paths (e.g. to add support for CDNs as well).
Thoughts? I'll be coding up a quick implementation on my fork.
I should figure out how to read the ember-cli app config, so options can be configured. Right now all options are fixed.
Currently, the implementation only works for the top-level /
domain, but if you try to view a resource offline like /posts
, since there's no posts/index.html
cached, you will get the offline page.
I have tried editing the fallback
section to serve index.html
, but this still fails because the browser will request manifest.appcache
from the nested domain, so resource/manifest.appcache
. My next idea was to duplicate the top-level assets and files in the manifest.appcache
, and this worked, but the problem was that this new appcache generated from the nested resource was overwriting the appcache initially created on the top-level (/
).
Are there any suggestions on configuring nested resources/routes to work in a SPA application? Perhaps this isn't related to this particular plugin, but I thought it might be useful to explain that this plugin cannot deal with nested resources.
I've implemented broccoli-manifest in a test project and tested with success in Firefox and IE when I kill the server. Yet it doesn't seem to work in the latest version of Chrome. I still get the 'This webpage is not available' message.
I followed all installation steps. The ember-cli-build (the new broccoli file) file looks like this:
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var mergeTrees = require('broccoli-merge-trees');
var writeManifest = require('broccoli-manifest');
var writeServiceWorker = require('broccoli-serviceworker');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
});
var completeTree = app.toTree()
return mergeTrees([completeTree, writeManifest(completeTree), writeServiceWorker(completeTree)]);
};
Would it make sense to fingerprint the assets in the manifest. If they're stored in the local browser cache, but they've changed, the mainfest will be updated, but the asset may not be. Not sure the internal workings of if an asset has changed whether it gets re-loaded when the manifest changes...
We discussed this in IRC a bit earlier this morning, and I have implemented the plumbing needed for broccoli-manifest
to become an addon and give it direct access to the final post-processed tree.
This PR is merged now:
As part of this change I removed broccoli-asset-rev
from being included internally in Ember CLI, and made it an addon. You can see the changes needed for that here:
ember-cli/broccoli-asset-rev#8
Hopefully, this is all you need, and the Ember CLI PR is merged before the next version is cut.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.