Open mcasimir opened 10 years ago
The reason why we serve hoodie.js via /_api/_files/hoodie.js
is because of plugins, which usually extend the frontend API.
I guess you serve your app from a different URL than the Hoodie Backend, which doesn't let you add hoodie.js to your appcache, correct?
I've a similar problem for an own app, I currently store the dynamic hoodie.js to my asset folder, but also planned to create a grunt task for it. Similar to your hoodie compile-js [DEST]
idea.
In future, the hoodie.js might be even more dynamic, e.g. you might define validation rules in the admin panel that would be synced to the frontend, so store methods would fail right away, without even syncing it etc. We're not sure what will come out of it, cool things are possible once you think about it.
Hi, Why the default way to load hoodie.js is from remote server (
/_api/_files/hoodie.js
)? This makes offline-first storage less useful, since i can't be offline and download hoodie.js.Although one could manually download the script from api server to its assets folder it is very difficult to integrate hoodie.js in an independent build process this way.
So i suggest either to provide a static precompiled hoodie.js and plugins via bower.js or, to keep consistent with
hoodie-cli
way to install things: let's just add a new command to hoodie-cli eg.hoodie compile-js [DEST]
so we can get the dynamic version ofhoodie.js
file right from the command line without running the server.