Closed nicoespeon closed 10 years ago
So basically, you just want to load arbitrary data when developing offline ?
In config.js
, we can add a development:true
field which will activate some developers features (like this one)
Precisely :+1:
I think it may be better to consider a development
object so we can switch features one by one. Doing so we could stay in DEV mode and still check quickly if everything is running as expected with remote values (for instance).
Something like this:
development: {
fakeData: true,
devFeatureOne: false,
godSkipping: true
}
Still, it's just an idea and I don't have anymore use case for now. So a development: true
to switch between remote and local data will be fine for now. The use case is: I don't have an Internet connection but still want to be able to work on the project :)
Or we can provide a fallback for everyone ! For example we can store the data in localstorage, and if the next time the brower cannot fetch new content we deliver the data from the cache. It will also mean we could have a way to know when the connection is available and that moment update the content (I know, this part is not really relevent for a blog, but hey, do you want to have the biggest ?)
Sure, we're currently dealing with that kind of feature with the Vinoga game. We managed to create a dualStorage environment easily in Backbone.js.
I guess we could do the same here for sure :-)
Plus, it sounds easier to implement (no other board to create, nor configuration).
Finally it will be a simple fallback for data (no developer mode needed for that function)
If I'm not connected, I still want to be able to code. So I need a local JSON dataset to be loaded instead of
res.data
on load.It should be configurable from
config.js
(default use the connection).