-
Notifications
You must be signed in to change notification settings - Fork 235
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
IndexedDB extension (omg this is like my 3rd try lol) #1341
base: master
Are you sure you want to change the base?
Conversation
Please don't close and open the PRs. Are you experiencing some kind of problem? |
Oh sh#t sorry, didn't know I shouldn't do that😅 |
Don't expect pull requests to be merged soon; GarboMuffin (TurboWarp's creator) has a job and mostly only is active here on weekends. |
OHHH! I THOUGHT ALL OF Y'ALL WHO COMMENT COULD TOTALLY MERGE IT AND JUST DIDN'T WANT TO 😅 |
extensions/ffghdfh/indexedDB.js
Outdated
@@ -0,0 +1,225 @@ | |||
// Name: Indexed Database | |||
// ID: ffghdfhIndexedDB | |||
// Description: Lets you use an IndexedDB database, allowing for you to store more than 5MB of data locally. By chair_senpai. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other extensions or the CONTRIBUTING.md on how to add proper credit (It's not in the description, as misleading as that may be!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so i think you probably meant the // By: thingy, sorry for leaving that out, I just went off of the local storage extension which did not have that, oops!
|
||
getValue(args) { | ||
const { KEY } = args; | ||
return this._getValue(KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning "undefined" as a string is not within typical conventions for Scratch/TurboWarp. Just return an empty string if it fails to get a key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okie dokie, changed that too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed what y'all asked for!
I worry that projects might abuse this to take up lots of storage on users' devices, and local storage is fine for the most common use cases. Does IndexedDB have any limits? |
https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#other_web_technologies |
Updated IndexedDB extension with new features and improvements - Renamed "get value for key ()" to "get key ()" - Set all default block values to empty strings - Added "export db" reporter block to export the entire database as a JSON string - Added "import db from ()" command block to import and replace the database from a JSON string - Added "merge db from ()" command block to merge data from a JSON string without overwriting existing keys
Made the "get key" block return nothing because this extension won't ever be merged into the turbowarp extensions anyways so I don't care anymore lol imma do it my way
Hey man! Remember me? I'm a TurboWarp Collaborater now so I can do a full thorough review and revisions on your PR, such as prettier, translation functions, etc. So let me know if your PR is ready and I'll do the things. |
lemme in please 🥺