Why webstorage deprecated?

Discussion and feedback on Construct 2

Post » Mon May 04, 2015 3:50 am

Why WebStorage deprecated and replaced with a new one in which all of the functions that exist in localStorage already in WebStorage. Except how to use events, action and expression.

I tried to replace all my work by using localStorage, but I feel more comfortable WebStorage used especially in using the expression. For example, I use filechooser and save the image url into WebStorage, and at that moment I will load the image in a sprite by using the expression "load image from WebStorage.LocalValue (" My Key "). It can not be used directly when using localStorage. Where you have to create a new event and write down one by one.

In addition, localStorage slower than WebStorage, for example, at the start of the layout, all objects that were loaded using WebStorage faster so milliseconds compared to localStorage.

I look forward to the latest version of C2 still provide features WebStorage.

Sorry for my english ... (I find it difficult to express using the English language).
B
36
S
13
G
1
Posts: 88
Reputation: 3,101

Post » Mon May 04, 2015 5:35 am

@nikosurfing. I think it is being removed as an option for apps released to Google Play Store, another example of google breaking things!
If it can be done, someone on the web will show you how to do it!

CDASI Games Mentality Break Splat-a-bug FlapFleet Challenge
B
35
S
13
G
7
Posts: 363
Reputation: 7,283

Post » Mon May 04, 2015 6:36 am

i copied this from the first local storage release


New Local Storage plugin

The new Local Storage does mostly the same thing as WebStorage - storing data locally to a user's device - but with a number of improvements:

Asynchronous storage: WebStorage was synchronous, so a long store/load would jank the game (pause while it processes). Local Storage uses asynchronous storage where supported (IndexedDB or WebSQL) firing triggers when stores or loads are complete, allowing storage to work in parallel to the game and improving performance in storage-intensive scenarios. (Note on old browsers which don't support IndexedDB or WebSQL it falls back to using synchronous storage like WebStorage did, but all modern browsers support asynchronous storage.)
WebStorage often faced tight storage limits, commonly with just around 5mb total storage allowed. Since Local Storage uses IndexedDB or WebSQL where supported and these have higher storage quotas, on many platforms you have a much higher storage capacity (commonly around 50mb, or effectively unlimited after a permission prompt).
Local Storage preserves the types of values stored. WebStorage would return all values as strings, even if you store a number, which can cause confusing bugs. Local Storage returns a number if you store a number, avoiding issues with unexpected types.
The WebStorage API has actually been removed from Chrome Web Store apps, so WebStorage can't store anything on that platform. Since Local Storage uses IndexedDB in Chrome which is still supported, it means storage is now possible again in Chrome Web Store apps. WebStorage support may even be deprecated and removed from browsers in future, since there is a movement away from synchronous features, so moving to the new Local Storage plugin helps future-proof your apps.
'Session storage' has been removed in the new plugin, since it had no benefits over using global variables and added a lot of baggage.
It has a less confusing name (beginners frequently thought "Web" in the "WebStorage" name meant it wouldn't work offline, but it does)

These changes are too extensive to retro-fit to the old WebStorage plugin, so instead Local Storage has been introduced as a new plugin to replace WebStorage.

The downside is it's a little tricker to use. In particular since getting item values is asynchronous, there is not a simple "get item value" expression: you must use the "get item" action and then a moment later the "On item get" trigger fires with the value being available. Also note that since Local Storage uses a different storage mechanism, it will not be able to read any existing data saved with WebStorage. However the above benefits mean that it's still a good idea to transition to the new plugin if possible. Existing projects can keep using WebStorage, but it is now deprecated and cannot be used in new projects.
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Mon May 04, 2015 10:55 am

If you don't want to publish to chrome web store then it's not a problem and you don't have to use the new plugin, I think.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Mon May 04, 2015 11:35 am

Thanks for your info guys... I hope localstorage wouldn't deprecated just like his brother. Now, i have a job to change all webstorage to localstorage.
B
36
S
13
G
1
Posts: 88
Reputation: 3,101


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests