-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(indexDB): Support indexDB for Safari browser #101
Conversation
localForage 1.5.0 supports now indexDB for Safari browser: "We now use IndexedDB as the storage engine for Safari v10.1 (and above)." localforage-cordovasqlitedriver updated also to localForage 1.5.0: thgreasi/localForage-cordovaSQLiteDriver#19
Hey @danielsogl, while I love this PR (kill websql with 🔥 lol), this breaking change scares me a little. I am going to have to look into that more and see how it would potentially impact the community. |
@jgw96 would be nice! |
@jgw96 It may be a major version change, as localForage has done a breaking change :) Did you gather feedback about the impact of the change? There is an issue that affects PWA in Safari private browsing mode (and maybe other browsers) that I am trying to address with the issue I opened in their repository and would be great to get it solved in ionic storage too when ready :) |
@danielsogl I think that after updating to LF v1.5.0, you will no longer need the If there was a confident way to detect whether the app runs for the first time or not + check whether it's on safari, then we could easily decide about using indexeddb or websql driver respectively. Related discussion: localForage/localForage#676 |
@danielsogl, @jgw96, @jesusbotella var driverPreferenceOrder = [
localforage.INDEXEDDB,
localforage.WEBSQL,
localforage.LOCALSTORAGE
];
localforageCompatibility1_4.config().then(function() {
localforage.config({
driver: driverPreferenceOrder
});
// or
// return localforage.setDriver(driverPreferenceOrder);
}).then(function() {
// your LF code here
}); ? |
@thgreasi I think it would be really good and pretty easy to implement. So you use that localforageCompatibility1_4 plugin to maintain compatibility with the older version, right? I suppose that it could be configurable inside ionic storage in order not to load the polyfill always, but only for the cases that the developer wants to make a transition from the older version to the new one. |
Yes that's right. The code is already there to check out but it depends on the not-yet-released LF v1.5.1, so I haven't published it. I'm currently waiting for a review on the respective LF PR and trying to gather as much feedback on the API if the compatibility plugin. |
@danielsogl localForage-compatibility-1-4 was just released to resolve the safari migration issue. Please check it out, I hope that you will like it. |
localForage 1.5.0 supports now indexDB for Safari browser: "We now use IndexedDB as the storage engine for Safari v10.1 (and above)."
localforage-cordovasqlitedriver updated also to localForage 1.5.0: thgreasi/localForage-cordovaSQLiteDriver#19