Skip to content
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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

ffghdfh
Copy link

@ffghdfh ffghdfh commented Mar 2, 2024

lemme in please 🥺

@CubesterYT
Copy link
Collaborator

Please don't close and open the PRs. Are you experiencing some kind of problem?

@ffghdfh
Copy link
Author

ffghdfh commented Mar 2, 2024

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😅
i've just been trying to add my extension and there was always something that came up! But i guess i just gotta play the waiting game...

@CST1229
Copy link
Collaborator

CST1229 commented Mar 2, 2024

i've just been trying to add my extension and there was always something that came up! But i guess i just gotta play the waiting game...

Don't expect pull requests to be merged soon; GarboMuffin (TurboWarp's creator) has a job and mostly only is active here on weekends.

@ffghdfh
Copy link
Author

ffghdfh commented Mar 3, 2024

i've just been trying to add my extension and there was always something that came up! But i guess i just gotta play the waiting game...

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 😅
Okay that's good to know, thank you for letting me know about that too! :D

@@ -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.
Copy link
Contributor

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!)

Copy link
Author

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);
Copy link
Contributor

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.

Copy link
Author

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!

Copy link
Author

@ffghdfh ffghdfh left a 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!

@DNin01
Copy link
Collaborator

DNin01 commented Mar 16, 2024

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?

@CST1229
Copy link
Collaborator

CST1229 commented Mar 17, 2024

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
there is a limit, but it's gigabytes in size (and also browser-dependent)

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
@CubesterYT
Copy link
Collaborator

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.

@GarboMuffin GarboMuffin added the pr: new extension Pull requests that add a new extension label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new extension Pull requests that add a new extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants