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

support indexedDB implement #385

Open
calvin2021y opened this issue Jun 5, 2023 · 8 comments
Open

support indexedDB implement #385

calvin2021y opened this issue Jun 5, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@calvin2021y
Copy link

calvin2021y commented Jun 5, 2023

can add indexedDB implement into txiki.js ?

@saghul
Copy link
Owner

saghul commented Jun 5, 2023

What would it be backed by?

@calvin2021y
Copy link
Author

sqlite or levelDB ?

@saghul
Copy link
Owner

saghul commented Jun 6, 2023

One SQLite is added to the core indexedDB could potentially be shimmed.

@saghul
Copy link
Owner

saghul commented Sep 27, 2023

SQLite support landed: #395

@jimmywarting
Copy link
Contributor

Think we first need to impl structural clone that can clone complex object to/from arraybuffers or something first.
IndexedDB can contain complex types such as TypedArrays Blobs circular refs Object literals regex and much more.

If i remember correctly chrome used sqlite + cbor for storing stuff in?
or maybe it was their own impl. of v8.serialize/deserialize... don't remember.

@saghul
Copy link
Owner

saghul commented Nov 14, 2023

For structuredClone support please follow quickjs-ng/quickjs#16

Once we have it in QuickJS we can update here.

@bnoordhuis
Copy link
Contributor

or maybe it was their own impl. of v8.serialize/deserialize...

I think it's this (or was, at least). I earned a $15k bug bounty last year for a bug in the deserializer that was exploitable across sandboxes. /tangent

@saghul
Copy link
Owner

saghul commented Jul 19, 2024

For structuredClone support please follow quickjs-ng/quickjs#16

Once we have it in QuickJS we can update here.

FYI, I added structuredClone here. It's pretty small, so I could port it to QuickJS, but in order to be correct we'd need DOMException, which I'm a bit more in doubt about, plus the version we'd ship doesn't work for other clonable things QuickJS doesn't have...

Anyway, if someone wants to give it a try, all the ducks should be in a row now :-)

@saghul saghul added the enhancement New feature or request label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants