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 node.js #335

Open
hackerwins opened this issue Jul 17, 2022 · 4 comments
Open

Support node.js #335

hackerwins opened this issue Jul 17, 2022 · 4 comments
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers

Comments

@hackerwins
Copy link
Member

Description:

General JS SDK supports not only Browser but also NodeJS(For example, Firebase JS SDK works well with NodeJS: Link).

However, the Yorkie JS SDK has yet to implement support for browsers only. Let's make it work well in NodeJS as well.

Why:

  • Users using NodeJS can also use Yorkie.
@hackerwins hackerwins added the enhancement 🌟 New feature or request label Jul 17, 2022
@CharlesSampson44
Copy link

import xhr2 from "xhr2";
global.XMLHttpRequest = xhr2;

and it works...

@blurfx
Copy link
Member

blurfx commented Jul 22, 2023

I've done some research and it looks like xhr2 could be a way to use yorkie-js-sdk in node.js, but it's not a clean way because the yorkie-js-sdk needs to verify that you are in a node environment and set the xhr2 shim.

Also grpc-webusesXMLHttpRequest, so I don't think we'll be able to support it anytime soon.

So, I think using connect-web(#375) instead of grpc-web is better way.

@hackerwins hackerwins added the good first issue 🐤 Good for newcomers label Jan 10, 2024
@hackerwins
Copy link
Member Author

Related to yorkie-team/yorkie#668

@hackerwins
Copy link
Member Author

hackerwins commented Jul 16, 2024

It would be also beneficial to support Node.js in the Yorkie JS SDK for MongoDB migration during Yorkie updates.

Currently, Operations are encoded in Protobuf and stored in the DB. This makes it challenging to update operations in the MongoDB built-in JavaScript environment. However, MongoDB scripts allow loading external scripts using require. Enabling Node.js support in the Yorkie JS SDK and loading it in MongoDB scripts would facilitate direct utilization of operation encoding and decoding for data modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers
Projects
Status: Backlog
Status: Todo
Development

No branches or pull requests

3 participants